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
https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNSTRING
Methods
impl PgConnection
[src]
impl PgConnection
pub fn build_transaction(&self) -> TransactionBuilder
[src]
pub fn build_transaction(&self) -> TransactionBuilder
Build a transaction, specifying additional details such as isolation level
See TransactionBuilder
for more examples.
conn.build_transaction() .read_only() .serializable() .deferrable() .run(|| Ok(()))
Trait Implementations
impl Send for PgConnection
[src]
impl Send for PgConnection
impl SimpleConnection for PgConnection
[src]
impl SimpleConnection for PgConnection
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
fn batch_execute(&self, query: &str) -> QueryResult<()>
Execute multiple SQL statements within the same string. Read more
impl Connection for PgConnection
[src]
impl Connection for PgConnection
type Backend = Pg
The backend this type connects to
type TransactionManager = AnsiTransactionManager
fn establish(database_url: &str) -> ConnectionResult<PgConnection>
[src]
fn establish(database_url: &str) -> ConnectionResult<PgConnection>
Establishes a new connection to the database Read more
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Executes the given function inside of a database transaction Read more
fn begin_test_transaction(&self) -> QueryResult<()>
[src]
fn begin_test_transaction(&self) -> QueryResult<()>
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>,
E: Debug,
[src]
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
E: Debug,
Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. Read more
Auto Trait Implementations
impl !Sync for PgConnection
impl !Sync for PgConnection