Skip to content

chore: update rusqlite to 0.37.0 #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bdk_wallet = { version = "2.0.0", default-features = false, features = ["std", "

reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
rustls = { version = "0.23", default-features = false }
rusqlite = { version = "0.31.0", features = ["bundled"] }
rusqlite = { version = "0.37.0", features = ["bundled"] }
bitcoin = "0.32.4"
bip39 = "2.0.0"
bip21 = { version = "0.5", features = ["std"], default-features = false }
Expand Down
22 changes: 8 additions & 14 deletions src/io/sqlite_store/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ pub(super) fn migrate_schema(
})?;

// Update user_version
tx.pragma(Some(rusqlite::DatabaseName::Main), "user_version", to_version, |_| Ok(()))
.map_err(|e| {
let msg = format!(
"Failed to upgrade user_version from {} to {}: {}",
from_version, to_version, e
);
io::Error::new(io::ErrorKind::Other, msg)
})?;
tx.pragma(Some("main"), "user_version", to_version, |_| Ok(())).map_err(|e| {
let msg = format!(
"Failed to upgrade user_version from {} to {}: {}",
from_version, to_version, e
);
io::Error::new(io::ErrorKind::Other, msg)
})?;

tx.commit().map_err(|e| {
let msg = format!(
Expand Down Expand Up @@ -107,12 +106,7 @@ mod tests {
let connection = Connection::open(db_file_path.clone()).unwrap();

connection
.pragma(
Some(rusqlite::DatabaseName::Main),
"user_version",
old_schema_version,
|_| Ok(()),
)
.pragma(Some("main"), "user_version", old_schema_version, |_| Ok(()))
.unwrap();

let sql = format!(
Expand Down
7 changes: 1 addition & 6 deletions src/io/sqlite_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ impl SqliteStore {
if version_res == 0 {
// New database, set our SCHEMA_USER_VERSION and continue
connection
.pragma(
Some(rusqlite::DatabaseName::Main),
"user_version",
SCHEMA_USER_VERSION,
|_| Ok(()),
)
.pragma(Some("main"), "user_version", SCHEMA_USER_VERSION, |_| Ok(()))
.map_err(|e| {
let msg = format!("Failed to set PRAGMA user_version: {}", e);
io::Error::new(io::ErrorKind::Other, msg)
Expand Down
Loading