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
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,
[src]fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]Like insert_returning_pk
but with no return value
Insert unless there’s a conflict on the primary key column, in which case update
Provided methods
Implementations on Foreign Types
pub 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,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn query<'a, 'c>(
&'c self,
table: &'static str,
columns: &'b [Column],
expr: Option<BoolExpr>,
limit: Option<i32>,
order: Option<&[Order]>
) -> Result<Box<dyn BackendRows + 'a, Global>, Error> where
'c: 'a,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
_pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]Implementors
pub 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,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub 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,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub 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,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn query<'a, 'c>(
&'c self,
table: &'static str,
columns: &'b [Column],
expr: Option<BoolExpr>,
limit: Option<i32>,
order: Option<&[Order]>
) -> Result<Box<dyn BackendRows + 'a, Global>, Error> where
'c: 'a,
[src]pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'_>]
) -> Result<SqlVal, Error>
[src]pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlValRef<'_>]
) -> Result<(), Error>
[src]pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlValRef<'a>]
) -> Result<(), Error>
[src]