Skip to main content

LibsqlPoolProvider

Struct LibsqlPoolProvider 

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

Remote libSQL/Turso pool implementing the driver-neutral neotales_dbapi traits.

Implementations§

Source§

impl LibsqlPoolProvider

Source

pub async fn connect(config: LibsqlConfig) -> Result<Self, DbError>

Builds the remote client and verifies connectivity with one sanitized SELECT 1.

The probe establishes that TLS, the endpoint, and authentication accept a request. It does not create or migrate any schema.

§Errors

Returns InvalidArgument for invalid configuration, Timeout when the connectivity budget elapses, or a sanitized Connection error. No driver text is retained.

Source

pub async fn acquire_libsql_session(&self) -> Result<LibsqlSession, DbError>

Acquires one exclusive session. Drop the session to release its permit.

libSQL remote sessions are independent HTTP clients, not reused sockets. The configured maximum is a concurrency bound; dropping a session does not preserve server-side state.

§Errors

Returns Timeout when no permit becomes available within the configured budget, or a sanitized Connection error.

Source

pub async fn acquire_libsql( &self, ) -> Result<Box<dyn ImmediateTransaction>, DbError>

Acquires one exclusive session as an ImmediateTransaction trait object.

§Errors

Returns Timeout when no permit becomes available within the configured budget, or a sanitized Connection error.

Trait Implementations§

Source§

impl Clone for LibsqlPoolProvider

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for LibsqlPoolProvider

Source§

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

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

impl Pool for LibsqlPoolProvider

Source§

fn capabilities(&self) -> Capabilities

Returns capabilities for this provider/configuration.
Source§

fn acquire_async(&self) -> DbFuture<'_, Box<dyn Session>>

Acquires one exclusive session; the caller must drop it to release it.
Source§

fn defaults(&self) -> PoolDefaults

Returns defaults used for options inherited by this pool.
Source§

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

Executes one statement through a newly acquired session with per-query policy overrides. Overrides must reject an explicit fetch limit before dispatch. Read more
Source§

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

Fetches one bounded batch through a newly acquired session with per-query overrides. Read more
Source§

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

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

fn fetch_first_async<'a>( &'a 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 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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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