[][src]Trait sqlx::Connection

pub trait Connection: 'static + Executor + Send {
    fn close(
        self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>; fn ping(
        &mut self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> { ... } }

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>>

Close this database connection.

Loading content...

Provided methods

fn ping(&mut self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>

Verifies a connection to the database is still alive.

Loading content...

Implementations on Foreign Types

impl<T> Connection for Transaction<T> where
    T: Connection
[src]

Loading content...

Implementors

impl Connection for MySqlConnection[src]

impl Connection for PgConnection[src]

impl<C> Connection for PoolConnection<C> where
    C: Connection + Connect<Connection = C>, 
[src]

fn close(
    self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send>>
[src]

Detach the connection from the pool and close it nicely.

Loading content...