This crate is still EXPERIMENTAL do not use with mainnet wallets.
- Install postgresql with
psql
tool. For example (macos):brew update brew install postgresql
- Create empty test database:
psql postgres postgres=# create database test_bdk_wallet;
- Set DATABASE_URL to test database:
export DATABASE_TEST_URL=postgresql://localhost/test_bdk_wallet
- Run tests, must use a single test thread since we reuse the postgres db:
cargo test -- --test-threads=1
- Create empty test database:
psql postgres postgres=# create database example_bdk_wallet; postgres=# \q
- Set DATABASE_URL to test database:
export DATABASE_URL=postgresql://localhost/example_bdk_wallet
- Run example:
cargo run --example bdk_sqlx_postgres