Deprecate NO_PARAMS in favor of passing an empty array

This commit is contained in:
Thom Chiovoloni
2020-11-03 01:32:46 -08:00
parent 2461ebf62f
commit 22121772a2
23 changed files with 126 additions and 210 deletions

View File

@@ -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();

View File

@@ -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