diff --git a/Cargo.toml b/Cargo.toml index 760cf986..5bf6c4cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ log = "~0.4" uuid = { version = "~0.8", features = ["v4", "serde"] } [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/db-traits/Cargo.toml b/db-traits/Cargo.toml index 1424f101..3c90e8f7 100644 --- a/db-traits/Cargo.toml +++ b/db-traits/Cargo.toml @@ -21,5 +21,5 @@ path = "../edn" path = "../core-traits" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] diff --git a/db/Cargo.toml b/db/Cargo.toml index bbe62b85..1085b1cc 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -22,7 +22,7 @@ serde_json = { version = "~1.0", optional = true } serde_derive = { version = "~1.0", optional = true } [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/db/src/cache.rs b/db/src/cache.rs index 008ff0aa..c4ac794a 100644 --- a/db/src/cache.rs +++ b/db/src/cache.rs @@ -61,6 +61,7 @@ use std::iter::Peekable; use failure::ResultExt; use rusqlite; +use rusqlite::{params_from_iter}; use core_traits::{Binding, Entid, TypedValue}; @@ -1071,7 +1072,7 @@ impl AttributeCaches { replacing: bool, ) -> Result<()> { let mut aev_factory = AevFactory::new(); - let rows = statement.query_map(&args, |row| Ok(aev_factory.row_to_aev(row)))?; + let rows = statement.query_map(params_from_iter(&args), |row| Ok(aev_factory.row_to_aev(row)))?; let aevs = AevRows { rows }; self.accumulate_into_cache( None, diff --git a/db/src/db.rs b/db/src/db.rs index 8b7401e7..5d2747cd 100644 --- a/db/src/db.rs +++ b/db/src/db.rs @@ -24,6 +24,7 @@ use rusqlite; use rusqlite::limits::Limit; use rusqlite::types::{ToSql, ToSqlOutput}; use rusqlite::TransactionBehavior; +use rusqlite::{params_from_iter}; use crate::bootstrap; use crate::{repeat_values, to_namespaced_keyword}; @@ -804,7 +805,7 @@ impl MentatStoring for rusqlite::Connection { values); let mut stmt: rusqlite::Statement = self.prepare(s.as_str())?; - let m: Result> = stmt.query_and_then(¶ms, |row| -> Result<(i64, Entid)> { + let m: Result> = stmt.query_and_then(params_from_iter(¶ms), |row| -> Result<(i64, Entid)> { Ok((row.get(0)?, row.get(1)?)) })?.collect(); m @@ -948,7 +949,7 @@ impl MentatStoring for rusqlite::Connection { // TODO: consider ensuring we inserted the expected number of rows. let mut stmt = self.prepare_cached(s.as_str())?; - stmt.execute(¶ms) + stmt.execute(params_from_iter(¶ms)) .context(DbErrorKind::NonFtsInsertionIntoTempSearchTableFailed) .map_err(|e| e.into()) .map(|_c| ()) @@ -1042,7 +1043,7 @@ impl MentatStoring for rusqlite::Connection { // TODO: consider ensuring we inserted the expected number of rows. let mut stmt = self.prepare_cached(fts_s.as_str())?; - stmt.execute(&fts_params).context(DbErrorKind::FtsInsertionFailed)?; + stmt.execute(params_from_iter(&fts_params)).context(DbErrorKind::FtsInsertionFailed)?; // Second, insert searches. // `params` reference computed values in `block`. @@ -1070,7 +1071,7 @@ impl MentatStoring for rusqlite::Connection { // TODO: consider ensuring we inserted the expected number of rows. let mut stmt = self.prepare_cached(s.as_str())?; - stmt.execute(¶ms).context(DbErrorKind::FtsInsertionIntoTempSearchTableFailed) + stmt.execute(params_from_iter(¶ms)).context(DbErrorKind::FtsInsertionIntoTempSearchTableFailed) .map_err(|e| e.into()) .map(|_c| ()) }).collect::>>(); diff --git a/db/src/debug.rs b/db/src/debug.rs index b2ece25e..895c7700 100644 --- a/db/src/debug.rs +++ b/db/src/debug.rs @@ -306,10 +306,9 @@ pub fn transactions_after>( pub fn fulltext_values(conn: &rusqlite::Connection) -> Result { let mut stmt: rusqlite::Statement = conn.prepare("SELECT rowid, text FROM fulltext_values ORDER BY rowid")?; - let params: &[i32; 0] = &[]; let r: Result> = stmt - .query_and_then(params, |row| { + .query_and_then([], |row| { let rowid: i64 = row.get(0)?; let text: String = row.get(1)?; Ok((rowid, text)) diff --git a/db/src/timelines.rs b/db/src/timelines.rs index 38fb1782..ae14e047 100644 --- a/db/src/timelines.rs +++ b/db/src/timelines.rs @@ -10,7 +10,7 @@ use std::ops::RangeFrom; -use rusqlite; +use rusqlite::{self, params_from_iter}; use db_traits::errors::{DbErrorKind, Result}; @@ -81,10 +81,7 @@ fn move_transactions_to( new_timeline, crate::repeat_values(tx_ids.len(), 1) ), - &(tx_ids - .iter() - .map(|x| x as &dyn rusqlite::types::ToSql) - .collect::>()), + params_from_iter(tx_ids.iter()) )?; Ok(()) } diff --git a/public-traits/Cargo.toml b/public-traits/Cargo.toml index 5b377b18..cfa9edb8 100644 --- a/public-traits/Cargo.toml +++ b/public-traits/Cargo.toml @@ -20,7 +20,7 @@ tokio = { version = "1.8.0", features = ["full"] } uuid = "~0.8" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.hyper] diff --git a/query-projector-traits/Cargo.toml b/query-projector-traits/Cargo.toml index 89f631b2..20e377fa 100644 --- a/query-projector-traits/Cargo.toml +++ b/query-projector-traits/Cargo.toml @@ -15,7 +15,7 @@ failure = "~0.1" failure_derive = "~0.1" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/query-projector/Cargo.toml b/query-projector/Cargo.toml index 240c0ffd..f8e1763c 100644 --- a/query-projector/Cargo.toml +++ b/query-projector/Cargo.toml @@ -11,7 +11,7 @@ failure = "~0.1" indexmap = "~1.7" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.core_traits] diff --git a/query-pull/Cargo.toml b/query-pull/Cargo.toml index 2f96a10b..449295f6 100644 --- a/query-pull/Cargo.toml +++ b/query-pull/Cargo.toml @@ -13,7 +13,7 @@ failure = "~0.1" path = "../query-pull-traits" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/query-sql/Cargo.toml b/query-sql/Cargo.toml index 0a8e743a..92168b95 100644 --- a/query-sql/Cargo.toml +++ b/query-sql/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.2" workspace = ".." [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/sql/Cargo.toml b/sql/Cargo.toml index b60f6a61..4043cbc5 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -11,7 +11,7 @@ failure = "~0.1" ordered-float = "~2.5" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.core_traits] diff --git a/tolstoy-traits/Cargo.toml b/tolstoy-traits/Cargo.toml index 4c2d648d..85aff68c 100644 --- a/tolstoy-traits/Cargo.toml +++ b/tolstoy-traits/Cargo.toml @@ -19,7 +19,7 @@ serde_json = "~1.0" uuid = { version = "~0.8" } [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.db_traits] diff --git a/tolstoy/Cargo.toml b/tolstoy/Cargo.toml index 6f445c53..3b6699ad 100644 --- a/tolstoy/Cargo.toml +++ b/tolstoy/Cargo.toml @@ -25,7 +25,7 @@ lazy_static = "~1.4" uuid = { version = "~0.8", features = ["v4", "serde"] } [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn] diff --git a/tools/cli/Cargo.toml b/tools/cli/Cargo.toml index 7fb1000d..e381265a 100644 --- a/tools/cli/Cargo.toml +++ b/tools/cli/Cargo.toml @@ -34,7 +34,7 @@ termion = "~1.5" time = "~0.2" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.mentat] diff --git a/transaction/Cargo.toml b/transaction/Cargo.toml index c8661cc9..8e94cee7 100644 --- a/transaction/Cargo.toml +++ b/transaction/Cargo.toml @@ -10,7 +10,7 @@ sqlcipher = ["rusqlite/sqlcipher"] failure = "~0.1" [dependencies.rusqlite] -version = "~0.24" +version = "~0.25" features = ["limits", "bundled"] [dependencies.edn]