Statement

Struct Statement 

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

Source

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.

Source

pub fn binding(&mut self) -> Binding<'c, '_>

Source

pub fn bind<'s, P>(&'s mut self, parameters: P) -> Result<Binding<'c, 's>>
where P: Parameters<'s>,

Source

pub fn query<'s, P>(&'s mut self, parameters: P) -> Result<Execution<'c, 's>>
where P: Parameters<'s>,

Source

pub fn execute<P>(&mut self, parameters: P) -> Result<isize>
where P: for<'a> Parameters<'a>,

Source

pub fn insert<P>(&mut self, parameters: P) -> Result<Option<RowId>>
where P: for<'a> Parameters<'a>,

Source

pub fn columns<'s>(&'s self) -> StatementColumns<'c, 's>

Inspect the columns returned by this statement.

Source

pub fn parameters<'s>(&'s self) -> StatementParameters<'c, 's>

Inspect the parameters declared by this statement.

Source

pub fn finalize(self) -> Result<(), ()>

Finalize (i.e., destroy) the prepared statement.

Trait Implementations§

Source§

impl<'c, 's> Connected for &'s mut Statement<'c>

Source§

impl<'c> Connected for Statement<'c>

Source§

impl<'c> Debug for Statement<'c>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'c> Drop for Statement<'c>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,