Struct diesel::pg::PgConnection
[−]
[src]
pub struct PgConnection { /* fields omitted */ }
The connection string expected by PgConnection::establish
should be a PostgreSQL connection string, as documented at
http://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNSTRING
Trait Implementations
impl Send for PgConnection
[src]
impl SimpleConnection for PgConnection
[src]
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
Execute multiple SQL statements within the same string. Read more
impl Connection for PgConnection
[src]
type Backend = Pg
The backend this connection represents.
type TransactionManager = AnsiTransactionManager
fn establish(database_url: &str) -> ConnectionResult<PgConnection>
[src]
Establishes a new connection to the database at the given URL. The URL should be a valid connection string for a given backend. See the documentation for the specific backend for specifics. Read more
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Executes the given function inside of a database transaction. When a transaction is already occurring, savepoints will be used to emulate a nested transaction. Read more
fn begin_test_transaction(&self) -> QueryResult<()>
[src]
Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
[src]
F: FnOnce() -> Result<T, E>,
Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an Err
. Read more