https://github.com/bitcoindevkit/bdk-sqlx
BDK async storage implementation using sqlx + postgres or sqlite
https://github.com/bitcoindevkit/bdk-sqlx
Last synced: 3 months ago
JSON representation
BDK async storage implementation using sqlx + postgres or sqlite
- Host: GitHub
- URL: https://github.com/bitcoindevkit/bdk-sqlx
- Owner: bitcoindevkit
- License: mit
- Created: 2024-08-19T17:49:04.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-04-16T20:45:54.000Z (3 months ago)
- Last Synced: 2025-04-17T07:58:50.223Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 111 KB
- Stars: 4
- Watchers: 1
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bdk-sqlx
## Status
This crate is still **EXPERIMENTAL** do not use with mainnet wallets.
## Testing
1. Install postgresql with `psql` tool. For example (macos):
```
brew update
brew install postgresql
```
2. Create empty test database:
```
psql postgres
postgres=# create database test_bdk_wallet;
```
3. Set DATABASE_URL to test database:
```
export DATABASE_TEST_URL=postgresql://localhost/test_bdk_wallet
```
4. Run tests, must use a single test thread since we reuse the postgres db:
```
cargo test -- --test-threads=1
```
## Example1. Create empty test database:
```
psql postgres
postgres=# create database example_bdk_wallet;
postgres=# \q
```
2. Set DATABASE_URL to test database:
```
export DATABASE_URL=postgresql://localhost/example_bdk_wallet
```
3. Run example:
```
cargo run --example bdk_sqlx_postgres
```