mirror of
https://github.com/isar/rusqlite.git
synced 2025-08-21 05:41:06 +08:00
Overhaul query API, removing the need for the _named
variants of all functions, and rusqlite::NO_PARAMS
This commit is contained in:
@@ -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!(
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user