Trait rbdc::db::Connection
source · [−]pub trait Connection: Send {
fn get_rows(
&mut self,
sql: &str,
params: Vec<Value>
) -> BoxFuture<'_, Result<Vec<Box<dyn Row>>, Error>>;
fn exec(
&mut self,
sql: &str,
params: Vec<Value>
) -> BoxFuture<'_, Result<ExecResult, Error>>;
fn close(&mut self) -> BoxFuture<'_, Result<(), Error>>;
fn ping(&mut self) -> BoxFuture<'_, Result<(), Error>>;
fn get_values(
&mut self,
sql: &str,
params: Vec<Value>
) -> BoxFuture<'_, Result<Vec<Value>, Error>> { ... }
}
Expand description
Represents a connection to a database
Required Methods
Execute a query that is expected to return a result set, such as a SELECT
statement
Execute a query that is expected to update some rows.