[][src]Trait sqlx_core::Connection

pub trait Connection: Executor + Send + 'static {
    fn open<T>(url: T) -> BoxFuture<'static, Result<Self>>
    where
        T: TryInto<Url, Error = Error>,
        Self: Sized
;
fn close(self) -> BoxFuture<'static, Result<()>>; fn ping(&mut self) -> BoxFuture<Result<()>> { ... } }

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 open<T>(url: T) -> BoxFuture<'static, Result<Self>> where
    T: TryInto<Url, Error = Error>,
    Self: Sized

Establish a new database connection.

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

Close this database connection.

Loading content...

Provided methods

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

Verifies a connection to the database is still alive.

Loading content...

Implementors

Loading content...