Skip to content

Commit

Permalink
Require new version of rusqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
czocher authored and cljoly committed Jun 18, 2023
1 parent 90c601d commit af4da52
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ path = "../../rusqlite_migration"
features = ["async-tokio-rusqlite"]

[dependencies.rusqlite]
version = ">=0.29.0"
version = "=0.29.0"
default-features = false
features = []
2 changes: 1 addition & 1 deletion examples/from-directory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ mktemp = "0.5"
include_dir = "0.7.3"

[dependencies.rusqlite]
version = ">=0.29.0"
version = "=0.29.0"
default-features = false
features = []
2 changes: 1 addition & 1 deletion examples/simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ lazy_static = "1.4.0"
mktemp = "0.5"

[dependencies.rusqlite]
version = ">=0.29.0"
version = "=0.29.0"
default-features = false
features = []
2 changes: 1 addition & 1 deletion rusqlite_migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tokio-rusqlite = { version = "0.4.0", optional = true }
log = "0.4"

[dependencies.rusqlite]
version = ">=0.29.0"
version = "=0.29.0"
default-features = false
features = []

Expand Down
7 changes: 1 addition & 6 deletions rusqlite_migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,6 @@ impl<'m> Migrations<'m> {

// Read user version field from the SQLite db
fn user_version(conn: &Connection) -> Result<usize, rusqlite::Error> {
// To keep compatibility with lower rusqlite versions
#[allow(deprecated)]
// We can’t fix this without breaking API compatibility
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
conn.query_row("PRAGMA user_version", [], |row| row.get(0))
Expand All @@ -795,9 +793,7 @@ fn set_user_version(conn: &Connection, v: usize) -> Result<()> {
// We can’t fix this without breaking API compatibility
#[allow(clippy::cast_possible_truncation)]
let v = v as u32;
// To keep compatibility with lower rusqlite versions, allow the needless `&v` borrow
#[allow(clippy::needless_borrow)]
conn.pragma_update(None, "user_version", &v)
conn.pragma_update(None, "user_version", v)
.map_err(|e| Error::RusqliteError {
query: format!("PRAGMA user_version = {v}; -- Approximate query"),
err: e,
Expand All @@ -807,7 +803,6 @@ fn set_user_version(conn: &Connection, v: usize) -> Result<()> {
// Validate that no foreign keys are violated
fn validate_foreign_keys(conn: &Connection) -> Result<()> {
let pragma_fk_check = "PRAGMA foreign_key_check";
#[allow(deprecated)] // To keep compatibility with lower rusqlite versions
conn.query_row(pragma_fk_check, [], |row| {
Ok(ForeignKeyCheckError {
table: row.get(0)?,
Expand Down
2 changes: 1 addition & 1 deletion rusqlite_migration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ path = "../rusqlite_migration"
features = ["async-tokio-rusqlite", "from-directory"]

[dependencies.rusqlite]
version = ">=0.29.0"
version = "=0.29.0"
default-features = false
features = []

Expand Down

0 comments on commit af4da52

Please sign in to comment.