[][src]Struct elephantry::transaction::Transaction

pub struct Transaction<'c> { /* fields omitted */ }

This struct is created by the Connection::transaction method.

Implementations

impl<'c> Transaction<'c>[src]

pub fn start(&self) -> Result<()>[src]

Start a new transaction.

pub fn commit(&self) -> Result<()>[src]

Commit a transaction.

pub fn roolback(&self, name: Option<&str>) -> Result<()>[src]

Rollback a transaction. If a name is specified, the transaction is rollback to the given savepoint. Otherwise, the whole transaction is rollback.

pub fn set_save_point(&self, name: &str) -> Result<()>[src]

Set a savepoint in a transaction.

pub fn release_savepoint(&self, name: &str) -> Result<()>[src]

Drop a savepoint.

pub fn is_in_transaction(&self) -> bool[src]

Tell if a transaction is open or not.

pub fn is_transaction_ok(&self) -> Option<bool>[src]

In PostgreSQL, an error during a transaction cancels all the queries and rollback the transaction on commit. This method returns the current transaction's status. If no transactions are open, it returns None.

pub fn set_deferrable(
    &self,
    keys: Option<Vec<&str>>,
    constraints: Constraints
) -> Result<()>
[src]

Set given constraints to deferred/immediate in the current transaction. This applies to constraints being deferrable or deferred by default. If the keys is None, ALL keys will be set at the given state.

See http://www.postgresql.org/docs/current/sql-set-constraints.html

pub fn set_isolation_level(&self, level: IsolationLevel) -> Result<()>[src]

Transaction isolation level tells PostgreSQL how to manage with the current transaction. The default is "READ COMMITTED".

See http://www.postgresql.org/docs/current/sql-set-transaction.html

pub fn set_access_mode(&self, mode: AccessMode) -> Result<()>[src]

Transaction access modes tell PostgreSQL if transaction are able to write or read only.

See http://www.postgresql.org/docs/current/sql-set-transaction.html

Auto Trait Implementations

impl<'c> RefUnwindSafe for Transaction<'c>

impl<'c> Send for Transaction<'c>

impl<'c> Sync for Transaction<'c>

impl<'c> Unpin for Transaction<'c>

impl<'c> UnwindSafe for Transaction<'c>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.