pub struct TursoExecutor { /* private fields */ }Expand description
An async Turso/libSQL executor.
Provides async database operations via the QueryExecutor trait.
Implementations§
Source§impl TursoExecutor
impl TursoExecutor
Sourcepub async fn new<F, Fut>(connector: F) -> Result<Self, DBError>
pub async fn new<F, Fut>(connector: F) -> Result<Self, DBError>
Creates a new Turso executor using the given connector function.
Sourcepub fn conn(&self) -> &Connection
pub fn conn(&self) -> &Connection
Returns a reference to the underlying Turso connection.
Sourcepub fn transaction(
&self,
) -> impl Future<Output = Result<TursoTransaction<'_>, DBError>>
pub fn transaction( &self, ) -> impl Future<Output = Result<TursoTransaction<'_>, DBError>>
Starts a new transaction using Turso’s default behavior.
The returned handle supports query_void, query_one, query_list,
commit, and rollback.
Trait Implementations§
Source§impl Debug for TursoExecutor
impl Debug for TursoExecutor
Source§impl QueryExecutor for TursoExecutor
impl QueryExecutor for TursoExecutor
Source§fn query_void(&self, query: Query) -> impl Future<Output = Result<(), DBError>>
fn query_void(&self, query: Query) -> impl Future<Output = Result<(), DBError>>
Executes a query, discarding results.
Source§fn query_one<T: FromRow + Send + 'static>(
&self,
query: Query,
) -> impl Future<Output = Result<Option<T>, DBError>>
fn query_one<T: FromRow + Send + 'static>( &self, query: Query, ) -> impl Future<Output = Result<Option<T>, DBError>>
Executes a query, returning at most one row.
Auto Trait Implementations§
impl Freeze for TursoExecutor
impl !RefUnwindSafe for TursoExecutor
impl Send for TursoExecutor
impl Sync for TursoExecutor
impl Unpin for TursoExecutor
impl UnsafeUnpin for TursoExecutor
impl !UnwindSafe for TursoExecutor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more