Skip to main content

ConnExt

Trait ConnExt 

Source
pub trait ConnExt: Sync {
    // Required methods
    fn query_raw(
        &self,
        sql: &str,
        params: impl IntoParams + Send,
    ) -> impl Future<Output = Result<Rows, Error>> + Send;
    fn execute_raw(
        &self,
        sql: &str,
        params: impl IntoParams + Send,
    ) -> impl Future<Output = Result<u64, Error>> + Send;

    // Provided method
    fn select<'a>(&'a self, sql: &str) -> SelectBuilder<'a, Self>
       where Self: Sized { ... }
}
Expand description

Low-level query trait implemented for libsql::Connection and libsql::Transaction.

Provides query_raw, execute_raw, and the select builder entry point. Higher-level helpers are on ConnQueryExt, which is blanket-implemented for all ConnExt types.

Required Methods§

Source

fn query_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<Rows, Error>> + Send

Execute a query and return raw rows.

Source

fn execute_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<u64, Error>> + Send

Execute a statement and return the number of affected rows.

Provided Methods§

Source

fn select<'a>(&'a self, sql: &str) -> SelectBuilder<'a, Self>
where Self: Sized,

Start a composable SelectBuilder from a base SQL query.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ConnExt for Connection

Source§

fn query_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<Rows, Error>> + Send

Source§

fn execute_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<u64, Error>> + Send

Source§

impl ConnExt for Transaction

Source§

fn query_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<Rows, Error>> + Send

Source§

fn execute_raw( &self, sql: &str, params: impl IntoParams + Send, ) -> impl Future<Output = Result<u64, Error>> + Send

Implementors§