mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-18 21:25:09 +01:00
The bug comes with the SQLx-sqlite pool bug, where several connections are
created by default, but the `new` function takes care of that, fixing that bug
by making a single instance of the database.
If constructed directly, the pool would create several connections to the
database, which in most instances is fine, but with SQLite :memory: each
connection is entirely independent.
Also follow documentation to make sure that failed `acquire` will not end up
dropping connections by setting test_before_acquire to false
However, if your workload is sensitive to dropped connections such as using an in-memory
SQLite database with a pool size of 1, you can pretty easily ensure that a cancelled
`acquire()` call will never drop connections by tweaking your [`PoolOptions`]:
* Set [`test_before_acquire(false)`][PoolOptions::test_before_acquire]
* Never set [`before_acquire`][PoolOptions::before_acquire] or
[`after_connect`][PoolOptions::after_connect].
Cashu Development Kit SQLite Storage Backend
ALPHA This library is in early development, the api will change and should be used with caution.
cdk-sqlite is the sqlite storage backend for cdk.
Crate Feature Flags
The following crate feature flags are available:
| Feature | Default | Description |
|---|---|---|
wallet |
Yes | Enable cashu wallet features |
mint |
Yes | Enable cashu mint wallet features |
sqlcipher |
No | Enable encrypted database |
Implemented NUTs:
See https://github.com/cashubtc/cdk/blob/main/README.md
Minimum Supported Rust Version (MSRV)
The cdk library should always compile with any combination of features on Rust 1.63.0.
To build and test with the MSRV you will need to pin the below dependency versions:
cargo update -p half --precise 2.2.1
cargo update -p home --precise 0.5.5
cargo update -p tokio --precise 1.38.1
cargo update -p serde_with --precise 3.1.0
cargo update -p reqwest --precise 0.12.4
License
This project is distributed under the MIT software license - see the LICENSE file for details.