Struct libsql::statement::Statement

source ·
pub struct Statement { /* private fields */ }
Expand description

A prepared statement.

Implementations§

source§

impl Statement

source

pub fn query_map<F, T>(&self, params: &Params, f: F) -> Result<MappedRows<F>>where F: FnMut(Row) -> Result<T>,

source

pub fn query(&self, params: &Params) -> Result<Rows>

source

pub fn query_row(&self, params: &Params) -> Result<Row>

source

pub fn bind(&self, params: &Params)

source

pub fn parameter_count(&self) -> usize

source

pub fn parameter_name(&self, index: i32) -> Option<&str>

source

pub fn is_explain(&self) -> i32

source

pub fn readonly(&self) -> bool

source

pub fn execute(&self, params: &Params) -> Result<u64>

source

pub fn reset(&self)

Reset the prepared statement to initial state for reuse.

source

pub fn bind_value(&self, i: i32, param: ValueRef<'_>)

source

pub fn get_status(&self, status: i32) -> i32

source

pub fn value_ref(inner: &Statement, col: usize) -> ValueRef<'_>

source§

impl Statement

source

pub fn column_names(&self) -> Vec<&str>

Get all the column names in the result set of the prepared statement.

If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.

source

pub fn column_count(&self) -> usize

Return the number of columns in the result set returned by the prepared statement.

If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.

source

pub fn column_name(&self, col: usize) -> Option<&str>

Returns the name assigned to a particular column in the result set returned by the prepared statement.

If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.

Returns None if there is no column at the provided index.

source

pub fn column_origin_name(&self, col: usize) -> Option<&str>

source

pub fn column_table_name(&self, col: usize) -> Option<&str>

source

pub fn column_database_name(&self, col: usize) -> Option<&str>

source

pub fn column_decltype(&self, col: usize) -> Option<&str>

source

pub fn column_index(&self, name: &str) -> Result<usize>

Returns the column index in the result set for a given column name.

If there is no AS clause then the name of the column is unspecified and may change from one release of SQLite to the next.

If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.

Failure

Will return an Error::InvalidColumnName when there is no column with the specified name.

source

pub fn columns(&self) -> Vec<Column<'_>>

Returns a slice describing the columns of the result of the query.

If associated DB schema can be altered concurrently, you should make sure that current statement has already been stepped once before calling this method.

Trait Implementations§

source§

impl AsRef<Statement> for Row

source§

fn as_ref(&self) -> &Statement

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<Statement> for Rows

source§

fn as_ref(&self) -> &Statement

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Statement

source§

fn clone(&self) -> Statement

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Statement

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more