Struct sqlite3::core::PreparedStatement
[−]
[src]
pub struct PreparedStatement { /* fields omitted */ }
A prepared statement.
Methods
impl PreparedStatement
[src]
fn execute(&mut self) -> ResultSet
Begin executing a statement.
An sqlite "row" only lasts until the next call to
ffi::sqlite3_step()
, so ResultSet
has a corresponding
lifetime constraint, which prevents it ResultSet
from
implementing the Iterator
trait. See the Query
trait
for and Iterator
over query results.
impl PreparedStatement
[src]
A compiled prepared statement that may take parameters. Note: "The leftmost SQL parameter has an index of 1."1
fn ignore_detail(&mut self)
Opt out of copies of error message details.
fn bind_null(&mut self, i: ParamIx) -> SqliteResult<()>
Bind null to a statement parameter.
fn bind_int(&mut self, i: ParamIx, value: i32) -> SqliteResult<()>
Bind an int to a statement parameter.
fn bind_int64(&mut self, i: ParamIx, value: i64) -> SqliteResult<()>
Bind an int64 to a statement parameter.
fn bind_double(&mut self, i: ParamIx, value: f64) -> SqliteResult<()>
Bind a double to a statement parameter.
fn bind_text(&mut self, i: ParamIx, value: &str) -> SqliteResult<()>
Bind a (copy of a) str to a statement parameter.
TODO: support binding without copying strings, blobs
fn bind_blob(&mut self, i: ParamIx, value: &[u8]) -> SqliteResult<()>
Bind a (copy of a) byte sequence to a statement parameter.
TODO: support binding without copying strings, blobs
fn clear_bindings(&mut self)
Clear all parameter bindings.
fn bind_parameter_count(&mut self) -> ParamIx
Return the number of SQL parameters. If parameters of the ?NNN form are used, there may be gaps in the list.
unsafe fn expose(&mut self) -> *mut sqlite3_stmt
Expose the underlying sqlite3_stmt
struct pointer for use
with the ffi
module.
fn changes(&self) -> u64
Return the number of database rows that were changed or inserted or deleted by this statement if it is the most recently run on its database connection.
cf sqlite3_changes
.
Trait Implementations
impl Drop for PreparedStatement
[src]
impl StatementUpdate for PreparedStatement
[src]
fn update(&mut self, values: &[&ToSql]) -> SqliteResult<u64>
Execute a statement after binding any parameters.
When the statement is done, The number of rows modified is reported.
Fail with Err(SQLITE_MISUSE)
in case the statement results
in any any rows (e.g. a SELECT
rather than INSERT
or
UPDATE
).
impl<F> QueryEach<F> for PreparedStatement where
F: FnMut(&mut ResultRow) -> SqliteResult<()>,
[src]
F: FnMut(&mut ResultRow) -> SqliteResult<()>,
fn query_each(
&mut self,
values: &[&ToSql],
each_row: &mut F
) -> SqliteResult<()>
&mut self,
values: &[&ToSql],
each_row: &mut F
) -> SqliteResult<()>
Process rows from a query after binding parameters.
For call each_row(row)
for each resulting step,
exiting on Err
.
impl<F, A> QueryFold<F, A> for PreparedStatement where
F: Fn(&mut ResultRow, A) -> SqliteResult<A>,
[src]
F: Fn(&mut ResultRow, A) -> SqliteResult<A>,
fn query_fold(&mut self, values: &[&ToSql], init: A, f: F) -> SqliteResult<A>
Fold rows from a query after binding parameters.
impl<F, T> Query<F, T> for PreparedStatement where
F: FnMut(&mut ResultRow) -> SqliteResult<T>,
[src]
F: FnMut(&mut ResultRow) -> SqliteResult<T>,
fn query<'stmt>(
&'stmt mut self,
values: &[&ToSql],
txform: F
) -> SqliteResult<QueryResults<'stmt, T, F>>
&'stmt mut self,
values: &[&ToSql],
txform: F
) -> SqliteResult<QueryResults<'stmt, T, F>>
Iterate over query results after binding parameters. Read more