pub struct Statement<'c> { /* private fields */ }Expand description
A prepared statement; an SQL statement that SQLite has compiled and made ready to bind and execute.
Implementations§
Source§impl<'c> Statement<'c>
impl<'c> Statement<'c>
Sourcepub fn prepare(
connection: &'c Connection,
query: impl AsRef<str>,
options: PrepareOptions,
) -> Result<Self, (ErrorMessage, Option<ErrorLocation>)>
pub fn prepare( connection: &'c Connection, query: impl AsRef<str>, options: PrepareOptions, ) -> Result<Self, (ErrorMessage, Option<ErrorLocation>)>
Compile SQL query text into a prepared statement that SQLite
can execute.
See PrepareOptions for the flags prepare understands. By default,
SQLite will prepare the statement transiently, using limited memory
that SQLite uses for short-lived operations (“lookaside allocator”). Use
PrepareOptions::persistent() if the statement will be executed again
over the program run.
pub fn binding(&mut self) -> Binding<'c, '_>
pub fn bind<'s, P>(&'s mut self, parameters: P) -> Result<Binding<'c, 's>>where
P: Parameters<'s>,
pub fn query<'s, P>(&'s mut self, parameters: P) -> Result<Execution<'c, 's>>where
P: Parameters<'s>,
pub fn execute<P>(&mut self, parameters: P) -> Result<isize>where
P: for<'a> Parameters<'a>,
pub fn insert<P>(&mut self, parameters: P) -> Result<Option<RowId>>where
P: for<'a> Parameters<'a>,
Sourcepub fn columns<'s>(&'s self) -> StatementColumns<'c, 's>
pub fn columns<'s>(&'s self) -> StatementColumns<'c, 's>
Inspect the columns returned by this statement.
Sourcepub fn parameters<'s>(&'s self) -> StatementParameters<'c, 's>
pub fn parameters<'s>(&'s self) -> StatementParameters<'c, 's>
Inspect the parameters declared by this statement.
Trait Implementations§
Source§impl<'c, 's> Connected for &'s mut Statement<'c>
impl<'c, 's> Connected for &'s mut Statement<'c>
fn as_connection_ptr(&self) -> *mut sqlite3
Auto Trait Implementations§
impl<'c> Freeze for Statement<'c>
impl<'c> RefUnwindSafe for Statement<'c>
impl<'c> Send for Statement<'c>
impl<'c> Sync for Statement<'c>
impl<'c> Unpin for Statement<'c>
impl<'c> UnwindSafe for Statement<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more