[−][src]Trait sqlx::prelude::Connection
Represents a single database connection rather than a pool of database connections.
Prefer running queries from [Pool] unless there is a specific need for a single, continuous connection.
Required methods
fn close(
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
Close this database connection.
fn ping(&mut self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>
Verifies a connection to the database is still alive.
Provided methods
fn begin(
self
) -> Pin<Box<dyn Future<Output = Result<Transaction<Self>, Error>> + 'static + Send>>
self
) -> Pin<Box<dyn Future<Output = Result<Transaction<Self>, Error>> + 'static + Send>>
Starts a transaction.
Returns Transaction
.
Implementors
impl Connection for MySqlConnection
[src]
fn close(
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
fn ping(&mut self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>
[src]
impl Connection for PgConnection
[src]
fn close(
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
fn ping(&mut self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>
[src]
impl<C> Connection for PoolConnection<C> where
C: Connect,
[src]
C: Connect,