[][src]Trait sqlx_core::connection::Connection

pub trait Connection where
    Self: Send + 'static,
    Self: Executor
{ fn close(self) -> BoxFuture<'static, Result<()>>;
fn ping(&mut self) -> BoxFuture<Result<()>>; fn begin(self) -> BoxFuture<'static, Result<Transaction<Self>>>
    where
        Self: Sized
, { ... } }

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) -> BoxFuture<'static, Result<()>>

Close this database connection.

fn ping(&mut self) -> BoxFuture<Result<()>>

Verifies a connection to the database is still alive.

Loading content...

Provided methods

fn begin(self) -> BoxFuture<'static, Result<Transaction<Self>>> where
    Self: Sized

Starts a transaction.

Returns Transaction.

Loading content...

Implementors

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

fn close(self) -> BoxFuture<'static, Result<()>>[src]

Detach the connection from the pool and close it nicely.

Loading content...