pub trait Queryablewhere
Self: Sync,{
// Required methods
fn execute<'a>(&'a self, q: Query<'a>) -> DBIO<'a, Option<Id>> ⓘ;
fn query<'a>(&'a self, q: Query<'a>) -> DBIO<'a, ResultSet> ⓘ;
fn query_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue<'a>],
) -> DBIO<'a, ResultSet> ⓘ;
fn execute_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue<'a>],
) -> DBIO<'a, u64> ⓘ;
fn raw_cmd<'a>(&'a self, cmd: &'a str) -> DBIO<'a, ()> ⓘ;
// Provided methods
fn select<'a>(&'a self, q: Select<'a>) -> DBIO<'a, ResultSet> ⓘ { ... }
fn insert<'a>(&'a self, q: Insert<'a>) -> DBIO<'a, Option<Id>> ⓘ { ... }
fn update<'a>(&'a self, q: Update<'a>) -> DBIO<'a, ()> ⓘ { ... }
fn delete<'a>(&'a self, q: Delete<'a>) -> DBIO<'a, ()> ⓘ { ... }
}
Expand description
Represents a connection or a transaction that can be queried.
Required Methods§
Sourcefn execute<'a>(&'a self, q: Query<'a>) -> DBIO<'a, Option<Id>> ⓘ
fn execute<'a>(&'a self, q: Query<'a>) -> DBIO<'a, Option<Id>> ⓘ
Executes the given query and returns the ID of the last inserted row.
Sourcefn query<'a>(&'a self, q: Query<'a>) -> DBIO<'a, ResultSet> ⓘ
fn query<'a>(&'a self, q: Query<'a>) -> DBIO<'a, ResultSet> ⓘ
Executes the given query and returns the result set.
Sourcefn query_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue<'a>],
) -> DBIO<'a, ResultSet> ⓘ
fn query_raw<'a>( &'a self, sql: &'a str, params: &'a [ParameterizedValue<'a>], ) -> DBIO<'a, ResultSet> ⓘ
Executes a query given as SQL, interpolating the given parameters and returning a set of results.
Sourcefn execute_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue<'a>],
) -> DBIO<'a, u64> ⓘ
fn execute_raw<'a>( &'a self, sql: &'a str, params: &'a [ParameterizedValue<'a>], ) -> DBIO<'a, u64> ⓘ
Executes a query given as SQL, interpolating the given parameters and returning the number of affected rows.