update rusqlite - all tests pass - some warnings
This commit is contained in:
parent
614ce63e2b
commit
15df38fc8f
17 changed files with 23 additions and 25 deletions
|
@ -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]
|
||||
|
|
|
@ -21,5 +21,5 @@ path = "../edn"
|
|||
path = "../core-traits"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<Vec<(i64, Entid)>> = stmt.query_and_then(¶ms, |row| -> Result<(i64, Entid)> {
|
||||
let m: Result<Vec<(i64, Entid)>> = 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::<Result<Vec<()>>>();
|
||||
|
|
|
@ -306,10 +306,9 @@ pub fn transactions_after<S: Borrow<Schema>>(
|
|||
pub fn fulltext_values(conn: &rusqlite::Connection) -> Result<FulltextValues> {
|
||||
let mut stmt: rusqlite::Statement =
|
||||
conn.prepare("SELECT rowid, text FROM fulltext_values ORDER BY rowid")?;
|
||||
let params: &[i32; 0] = &[];
|
||||
|
||||
let r: Result<Vec<_>> = 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))
|
||||
|
|
|
@ -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::<Vec<_>>()),
|
||||
params_from_iter(tx_ids.iter())
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -15,7 +15,7 @@ failure = "~0.1"
|
|||
failure_derive = "~0.1"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.edn]
|
||||
|
|
|
@ -11,7 +11,7 @@ failure = "~0.1"
|
|||
indexmap = "~1.7"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.core_traits]
|
||||
|
|
|
@ -13,7 +13,7 @@ failure = "~0.1"
|
|||
path = "../query-pull-traits"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.edn]
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.0.2"
|
|||
workspace = ".."
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.edn]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -34,7 +34,7 @@ termion = "~1.5"
|
|||
time = "~0.2"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.mentat]
|
||||
|
|
|
@ -10,7 +10,7 @@ sqlcipher = ["rusqlite/sqlcipher"]
|
|||
failure = "~0.1"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "~0.24"
|
||||
version = "~0.25"
|
||||
features = ["limits", "bundled"]
|
||||
|
||||
[dependencies.edn]
|
||||
|
|
Loading…
Reference in a new issue