/// Begin a new transaction. Cannot be nested; see `savepoint` for nested transactions.
Begin a new transaction. Cannot be nested; see `savepoint` for nested transactions.
Begin a new transaction . Cannot be nested ; see ` savepoint ` for nested transactions .
pub fn new(conn: &Connection, behavior: TransactionBehavior) -> Result<Transaction> {
        let query = match behavior {
            TransactionBehavior::Deferred => "BEGIN DEFERRED",
            TransactionBehavior::Immediate => "BEGIN IMMEDIATE",
            TransactionBehavior::Exclusive => "BEGIN EXCLUSIVE",
            _ => ""
        };
        conn.execute_batch(query)
            .map(move |_| {
                Transaction {
                    conn,
                    drop_behavior: DropBehavior::Rollback,
                    committed: false,
                }
            })
    }
pub fn new ( conn : & Connection , behavior : TransactionBehavior ) -> Result < Transaction > { let query = match behavior { TransactionBehavior :: Deferred => " " , TransactionBehavior :: Immediate => " " , TransactionBehavior :: Exclusive => " " , _ => " " } ; conn . execute_batch ( query ) . map ( move | _ | { Transaction { conn , drop_behavior : DropBehavior :: Rollback , committed : false , } } ) }
Begin a new transaction.
Begin a new transaction .
conn
&Connection
behavior
TransactionBehavior