Skip to content

Commit 01f38c0

Browse files
committed
test: update all to check postgres and sqlite
1 parent 51ffef2 commit 01f38c0

File tree

3 files changed

+289
-356
lines changed

3 files changed

+289
-356
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub enum BdkSqlxError {
3636
}
3737

3838
/// Manages a pool of database connections.
39-
#[derive(Debug)]
39+
#[derive(Debug, Clone)]
4040
pub struct Store<DB: Database> {
4141
pub(crate) pool: Pool<DB>,
4242
wallet_name: String,

src/postgres.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ impl Store<Postgres> {
121121
.fetch_optional(&mut *tx)
122122
.await?;
123123

124-
dbg!(&row);
125-
126124
if let Some(row) = row {
127125
Self::changeset_from_row(&mut tx, &mut changeset, row).await?;
128126
}
@@ -465,40 +463,6 @@ pub async fn local_chain_changeset_persist_to_postgres(
465463
Ok(())
466464
}
467465

468-
/// Drops all tables.
469-
#[tracing::instrument]
470-
pub async fn drop_all(db: Pool<Postgres>) -> Result<(), BdkSqlxError> {
471-
info!("Dropping all tables");
472-
473-
let drop_statements = vec![
474-
"DROP TABLE IF EXISTS _sqlx_migrations",
475-
"DROP TABLE IF EXISTS vault_addresses",
476-
"DROP TABLE IF EXISTS used_anchorwatch_keys",
477-
"DROP TABLE IF EXISTS anchorwatch_keys",
478-
"DROP TABLE IF EXISTS psbts",
479-
"DROP TABLE IF EXISTS whitelist_update",
480-
"DROP TABLE IF EXISTS vault_parameters",
481-
"DROP TABLE IF EXISTS users",
482-
"DROP TABLE IF EXISTS version",
483-
"DROP TABLE IF EXISTS anchor_tx",
484-
"DROP TABLE IF EXISTS txout",
485-
"DROP TABLE IF EXISTS tx",
486-
"DROP TABLE IF EXISTS block",
487-
"DROP TABLE IF EXISTS keychain",
488-
"DROP TABLE IF EXISTS network",
489-
];
490-
491-
let mut tx = db.begin().await?;
492-
493-
for statement in drop_statements {
494-
sqlx::query(statement).execute(&mut *tx).await?;
495-
}
496-
497-
tx.commit().await?;
498-
499-
Ok(())
500-
}
501-
502466
/// Collects information on all the wallets in the database and dumps it to stdout.
503467
#[tracing::instrument]
504468
pub async fn easy_backup(db: Pool<Postgres>) -> Result<(), BdkSqlxError> {

0 commit comments

Comments
 (0)