mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-09 13:02:19 +08:00
Deprecate NO_PARAMS in favor of passing an empty array
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
//!
|
||||
//! ```rust
|
||||
//! # use rusqlite::blob::ZeroBlob;
|
||||
//! # use rusqlite::{Connection, DatabaseName, NO_PARAMS};
|
||||
//! # use rusqlite::{Connection, DatabaseName};
|
||||
//! # use std::error::Error;
|
||||
//! # use std::io::{Read, Seek, SeekFrom, Write};
|
||||
//! # fn main() -> Result<(), Box<dyn Error>> {
|
||||
@@ -113,7 +113,7 @@
|
||||
//! // must be done via SQL.
|
||||
//! db.execute(
|
||||
//! "INSERT INTO test_table (content) VALUES (ZEROBLOB(10))",
|
||||
//! NO_PARAMS,
|
||||
//! [],
|
||||
//! )?;
|
||||
//!
|
||||
//! // Get the row id off the BLOB we just inserted.
|
||||
@@ -154,7 +154,7 @@
|
||||
//!
|
||||
//! ```rust
|
||||
//! # use rusqlite::blob::ZeroBlob;
|
||||
//! # use rusqlite::{Connection, DatabaseName, NO_PARAMS};
|
||||
//! # use rusqlite::{Connection, DatabaseName};
|
||||
//! # use std::error::Error;
|
||||
//! # fn main() -> Result<(), Box<dyn Error>> {
|
||||
//! let db = Connection::open_in_memory()?;
|
||||
@@ -164,7 +164,7 @@
|
||||
//! // must be done via SQL.
|
||||
//! db.execute(
|
||||
//! "INSERT INTO test_table (content) VALUES (ZEROBLOB(10))",
|
||||
//! NO_PARAMS,
|
||||
//! [],
|
||||
//! )?;
|
||||
//! // Get the row id off the blob we just inserted.
|
||||
//! let rowid = db.last_insert_rowid();
|
||||
|
@@ -194,7 +194,7 @@ impl<'conn> Blob<'conn> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{Connection, DatabaseName, NO_PARAMS};
|
||||
use crate::{Connection, DatabaseName};
|
||||
// to ensure we don't modify seek pos
|
||||
use std::io::Seek as _;
|
||||
|
||||
@@ -203,11 +203,8 @@ mod test {
|
||||
let db = Connection::open_in_memory().unwrap();
|
||||
db.execute_batch("CREATE TABLE test_table(content BLOB);")
|
||||
.unwrap();
|
||||
db.execute(
|
||||
"INSERT INTO test_table(content) VALUES (ZEROBLOB(10))",
|
||||
NO_PARAMS,
|
||||
)
|
||||
.unwrap();
|
||||
db.execute("INSERT INTO test_table(content) VALUES (ZEROBLOB(10))", [])
|
||||
.unwrap();
|
||||
|
||||
let rowid = db.last_insert_rowid();
|
||||
let mut blob = db
|
||||
|
Reference in New Issue
Block a user