Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 907 Bytes

README.md

File metadata and controls

43 lines (37 loc) · 907 Bytes

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