Skip to main content

LibsqlSession

Struct LibsqlSession 

Source
pub struct LibsqlSession { /* private fields */ }
Expand description

One exclusive remote libSQL session.

Dropping a session releases its concurrency permit. A session that was interrupted or whose remote statement failed is poisoned and refuses further calls; acquire a new session instead.

Trait Implementations§

Source§

impl Debug for LibsqlSession

Source§

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

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

impl ImmediateTransaction for LibsqlSession

Source§

fn begin_immediate_async<'a>( &'a mut self, ) -> DbFuture<'a, Box<dyn Transaction<'a> + 'a>>

Begins an immediate transaction on the same session or returns Unsupported before beginning.
Source§

impl Session for LibsqlSession

Source§

fn execute_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> DbFuture<'a, u64>

Executes one positional-parameter statement; parameters follow placeholder order, with no SQL rewriting. Providers must reject an explicit fetch limit before dispatch, e.g. via QueryOptions::prepare_execute_provider. An inherited limit is permitted. Providers reject placeholder/parameter count mismatches. SQLite uses ?; PostgreSQL uses $1, $2.
Source§

fn fetch_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> DbFuture<'a, Box<dyn Reader + 'a>>

Fetches one bounded batch as a reader. Read more
Source§

fn execute_trusted_script_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> DbFuture<'a, ()>

Executes a multi-statement unparameterized script. Input must be trusted; scripts must not manage transactions. An interrupted operation requires provider cleanup before session reuse.
Source§

fn begin_async<'a>( &'a mut self, options: TxOptions, ) -> DbFuture<'a, Box<dyn Transaction<'a> + 'a>>

Begins an interactive transaction on this same session; unsupported requested options fail before dispatch. If dropped after begin dispatch, the provider must roll back or discard the connection before reuse.
Source§

fn defaults(&self) -> PoolDefaults

Defaults inherited by operations on this session.
Source§

fn fetch_all_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, DbError>> + Send + 'a>>

Fetches and drains the whole bounded batch. Read more
Source§

fn fetch_first_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> Pin<Box<dyn Future<Output = Result<Option<Row>, DbError>> + Send + 'a>>

Fetches at most the first row of the first result set, then drains the full batch. Read more
Source§

fn fetch_one_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> Pin<Box<dyn Future<Output = Result<Row, DbError>> + Send + 'a>>

Fetches a statement whose first result set must contain exactly one row. Read more
Source§

fn fetch_scalar_async<'a>( &'a mut self, sql: &'a str, options: QueryOptions, ) -> Pin<Box<dyn Future<Output = Result<Value, DbError>> + Send + 'a>>

Fetches exactly one row and returns its first column. Read more

Auto Trait Implementations§

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 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> MaybeSendSync for T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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