Enum libsql_client::client::GenericClient
source · pub enum GenericClient {
Local(Client),
Reqwest(Client),
Hrana(Client),
Workers(Client),
Spin(Client),
}
Expand description
A generic client struct, wrapping possible backends. It’s a convenience struct which allows implementing connect() with backends being passed as env parameters.
Variants§
Trait Implementations§
source§impl DatabaseClient for GenericClient
impl DatabaseClient for GenericClient
source§fn raw_batch<'life0, 'async_trait>(
&'life0 self,
stmts: impl 'async_trait + IntoIterator<Item = impl 'async_trait + Into<Statement>>
) -> Pin<Box<dyn Future<Output = Result<BatchResult>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn raw_batch<'life0, 'async_trait>( &'life0 self, stmts: impl 'async_trait + IntoIterator<Item = impl 'async_trait + Into<Statement>> ) -> Pin<Box<dyn Future<Output = Result<BatchResult>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Executes a batch of SQL statements.
Each statement is going to run in its own transaction,
unless they’re wrapped in BEGIN and END Read more
source§fn execute<'life0, 'async_trait>(
&'life0 self,
stmt: impl 'async_trait + Into<Statement>
) -> Pin<Box<dyn Future<Output = Result<ResultSet>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>( &'life0 self, stmt: impl 'async_trait + Into<Statement> ) -> Pin<Box<dyn Future<Output = Result<ResultSet>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Executes a single SQL statement Read more
source§fn transaction<'a, 'async_trait>(
&'a self
) -> Pin<Box<dyn Future<Output = Result<Transaction<'a, Self>>> + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn transaction<'a, 'async_trait>( &'a self ) -> Pin<Box<dyn Future<Output = Result<Transaction<'a, Self>>> + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait,
Starts an interactive transaction and returns a
Transaction
object.
The object can be later used to execute()
, commit()
or rollback()
the interactive transaction.fn execute_in_transaction<'life0, 'async_trait>( &'life0 self, tx_id: u64, stmt: Statement ) -> Pin<Box<dyn Future<Output = Result<ResultSet>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn commit_transaction<'life0, 'async_trait>( &'life0 self, tx_id: u64 ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn rollback_transaction<'life0, 'async_trait>( &'life0 self, tx_id: u64 ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn batch<'life0, 'async_trait>(
&'life0 self,
stmts: impl 'async_trait + IntoIterator<Item = impl 'async_trait + Into<Statement>>
) -> Pin<Box<dyn Future<Output = Result<Vec<ResultSet>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch<'life0, 'async_trait>( &'life0 self, stmts: impl 'async_trait + IntoIterator<Item = impl 'async_trait + Into<Statement>> ) -> Pin<Box<dyn Future<Output = Result<Vec<ResultSet>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Executes a batch of SQL statements, wrapped in “BEGIN”, “END”, transaction-style.
Each statement is going to run in its own transaction,
unless they’re wrapped in BEGIN and END Read more
Auto Trait Implementations§
impl !RefUnwindSafe for GenericClient
impl !Send for GenericClient
impl !Sync for GenericClient
impl Unpin for GenericClient
impl !UnwindSafe for GenericClient
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