mirror of
https://github.com/isar/rusqlite.git
synced 2025-12-21 19:02:23 +08:00
Use ?NNN format instead of ?
https://sqlite.org/lang_expr.html#parameters > But because it is easy to miscount the question marks, the use of this parameter format is discouraged. Programmers are encouraged to use one of the symbolic formats below or the ?NNN format above instead.
This commit is contained in:
@@ -17,13 +17,13 @@ impl Connection {
|
||||
/// # use rusqlite::{Connection, Result};
|
||||
/// fn insert_new_people(conn: &Connection) -> Result<()> {
|
||||
/// {
|
||||
/// let mut stmt = conn.prepare_cached("INSERT INTO People (name) VALUES (?)")?;
|
||||
/// let mut stmt = conn.prepare_cached("INSERT INTO People (name) VALUES (?1)")?;
|
||||
/// stmt.execute(["Joe Smith"])?;
|
||||
/// }
|
||||
/// {
|
||||
/// // This will return the same underlying SQLite statement handle without
|
||||
/// // having to prepare it again.
|
||||
/// let mut stmt = conn.prepare_cached("INSERT INTO People (name) VALUES (?)")?;
|
||||
/// let mut stmt = conn.prepare_cached("INSERT INTO People (name) VALUES (?1)")?;
|
||||
/// stmt.execute(["Bob Jones"])?;
|
||||
/// }
|
||||
/// Ok(())
|
||||
|
||||
Reference in New Issue
Block a user