Overhaul query API, removing the need for the _named variants of all functions, and rusqlite::NO_PARAMS

This commit is contained in:
Thom Chiovoloni
2020-11-02 23:34:08 -08:00
parent c45446ba73
commit 032aea73b8
10 changed files with 680 additions and 328 deletions

View File

@@ -94,7 +94,7 @@ mod value_ref;
/// # use rusqlite::types::{Null};
///
/// fn insert_null(conn: &Connection) -> Result<usize> {
/// conn.execute("INSERT INTO people (name) VALUES (?)", &[Null])
/// conn.execute("INSERT INTO people (name) VALUES (?)", [Null])
/// }
/// ```
#[derive(Copy, Clone)]
@@ -188,7 +188,7 @@ mod test {
let db = checked_memory_handle();
let s = "hello, world!";
db.execute("INSERT INTO foo(t) VALUES (?)", &[s.to_owned()])
db.execute("INSERT INTO foo(t) VALUES (?)", [s.to_owned()])
.unwrap();
let from: String = db
@@ -201,7 +201,7 @@ mod test {
fn test_value() {
let db = checked_memory_handle();
db.execute("INSERT INTO foo(i) VALUES (?)", &[Value::Integer(10)])
db.execute("INSERT INTO foo(i) VALUES (?)", [Value::Integer(10)])
.unwrap();
assert_eq!(

View File

@@ -336,7 +336,7 @@ mod test {
(?, 'neg one'), (?, 'neg two'),
(?, 'pos one'), (?, 'pos two'),
(?, 'min'), (?, 'max')",
&[0i128, -1i128, -2i128, 1i128, 2i128, i128::MIN, i128::MAX],
[0i128, -1i128, -2i128, 1i128, 2i128, i128::MIN, i128::MAX],
)
.unwrap();