pub trait RawConnection: Send + Debug {
// Required methods
fn family(&self) -> Family;
fn fetch<'a>(
&'a mut self,
sql: &'a str,
args: Vec<Value>,
) -> ExecFuture<'a, Result<Vec<Row>, ExecError>>;
fn execute<'a>(
&'a mut self,
sql: &'a str,
args: Vec<Value>,
) -> ExecFuture<'a, Result<ExecResult, ExecError>>;
fn abandon(self: Box<Self>);
}Expand description
One raw connection, exclusively held. The seam a backend implements.
keelson-sqlx implements this once per driver; a future backend implements
it once. Everything else — Transaction, the transaction SQL, the verb
layer — is written once in this crate against it, which is what keeps
transaction semantics identical across backends.
Required Methods§
Sourcefn fetch<'a>(
&'a mut self,
sql: &'a str,
args: Vec<Value>,
) -> ExecFuture<'a, Result<Vec<Row>, ExecError>>
fn fetch<'a>( &'a mut self, sql: &'a str, args: Vec<Value>, ) -> ExecFuture<'a, Result<Vec<Row>, ExecError>>
Run a statement and collect every row.
Sourcefn execute<'a>(
&'a mut self,
sql: &'a str,
args: Vec<Value>,
) -> ExecFuture<'a, Result<ExecResult, ExecError>>
fn execute<'a>( &'a mut self, sql: &'a str, args: Vec<Value>, ) -> ExecFuture<'a, Result<ExecResult, ExecError>>
Run a statement for its side effect.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".