Trait butane::db::ConnectionMethods[][src]

pub trait ConnectionMethods {
    fn execute(&self, sql: &str) -> Result<(), Error>;
fn query<'a, 'c>(
        &'c self,
        table: &'static str,
        columns: &'b [Column],
        expr: Option<BoolExpr>,
        limit: Option<i32>,
        sort: Option<&[Order]>
    ) -> Result<Box<dyn BackendRows + 'a, Global>, Error>
    where
        'c: 'a
;
fn insert_returning_pk(
        &self,
        table: &'static str,
        columns: &[Column],
        pkcol: &Column,
        values: &[SqlValRef<'_>]
    ) -> Result<SqlVal, Error>;
fn insert_only(
        &self,
        table: &'static str,
        columns: &[Column],
        values: &[SqlValRef<'_>]
    ) -> Result<(), Error>;
fn insert_or_replace(
        &self,
        table: &'static str,
        columns: &[Column],
        pkcol: &Column,
        values: &[SqlValRef<'_>]
    ) -> Result<(), Error>;
fn update(
        &self,
        table: &'static str,
        pkcol: Column,
        pk: SqlValRef<'_>,
        columns: &[Column],
        values: &[SqlValRef<'_>]
    ) -> Result<(), Error>;
fn delete_where(
        &self,
        table: &'static str,
        expr: BoolExpr
    ) -> Result<usize, Error>;
fn has_table(&self, table: &'static str) -> Result<bool, Error>; fn delete(
        &self,
        table: &'static str,
        pkcol: &'static str,
        pk: SqlVal
    ) -> Result<(), Error> { ... } }
Expand description

Methods available on a database connection. Most users do not need to call these methods directly and will instead use methods on DataObject or the query! macro. This trait is implemented by both database connections and transactions.

Required methods

Like insert_returning_pk but with no return value

Insert unless there’s a conflict on the primary key column, in which case update

Tests if a table exists in the database.

Provided methods

Implementations on Foreign Types

Implementors