mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Rename transaction mode
to behavior
to match SQLite docs
This commit is contained in:
parent
c8af7e4eb5
commit
68e9d81283
@ -15,7 +15,7 @@ use libc::{c_int, c_void, c_char};
|
||||
use types::{ToSql, FromSql};
|
||||
|
||||
pub use transaction::{SqliteTransaction};
|
||||
pub use transaction::{SqliteTransactionMode,
|
||||
pub use transaction::{SqliteTransactionBehavior,
|
||||
SqliteTransactionDeferred,
|
||||
SqliteTransactionImmediate,
|
||||
SqliteTransactionExclusive};
|
||||
@ -68,9 +68,9 @@ impl SqliteConnection {
|
||||
SqliteTransaction::new(self, SqliteTransactionDeferred)
|
||||
}
|
||||
|
||||
pub fn transaction_with_mode<'a>(&'a self, mode: SqliteTransactionMode)
|
||||
pub fn transaction_with_behavior<'a>(&'a self, behavior: SqliteTransactionBehavior)
|
||||
-> SqliteResult<SqliteTransaction<'a>> {
|
||||
SqliteTransaction::new(self, mode)
|
||||
SqliteTransaction::new(self, behavior)
|
||||
}
|
||||
|
||||
pub fn execute_batch(&self, sql: &str) -> SqliteResult<()> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use {SqliteResult, SqliteConnection};
|
||||
|
||||
pub enum SqliteTransactionMode {
|
||||
pub enum SqliteTransactionBehavior {
|
||||
SqliteTransactionDeferred,
|
||||
SqliteTransactionImmediate,
|
||||
SqliteTransactionExclusive,
|
||||
@ -15,8 +15,8 @@ pub struct SqliteTransaction<'conn> {
|
||||
|
||||
impl<'conn> SqliteTransaction<'conn> {
|
||||
pub fn new(conn: &SqliteConnection,
|
||||
mode: SqliteTransactionMode) -> SqliteResult<SqliteTransaction> {
|
||||
let query = match mode {
|
||||
behavior: SqliteTransactionBehavior) -> SqliteResult<SqliteTransaction> {
|
||||
let query = match behavior {
|
||||
SqliteTransactionDeferred => "BEGIN DEFERRED",
|
||||
SqliteTransactionImmediate => "BEGIN IMMEDIATE",
|
||||
SqliteTransactionExclusive => "BEGIN EXCLUSIVE",
|
||||
|
Loading…
Reference in New Issue
Block a user