An open API service indexing awesome lists of open source software.

https://github.com/bitcoindevkit/bdk-sqlx

BDK async storage implementation using postgres + sqlx
https://github.com/bitcoindevkit/bdk-sqlx

Last synced: 5 months ago
JSON representation

BDK async storage implementation using postgres + sqlx

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
```

## Example

1. 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
```