On Friday, October 19, 2012 4:36:45 PM UTC-7, Eric Wong wrote:
>
> SQLite supports IMMEDIATE and EXCLUSIVE transactions which 
> prevents SQLITE_BUSY errors at the expense of concurrent 
> performance. 
>
> DEFERRED transactions remain the default, but may be 
> explicitly specified in case this default behavior changes. 
>
> ref: 
> http://search.cpan.org/dist/DBD-SQLite/lib/DBD/SQLite.pm#Transaction_and_Database_Locking
>  
> ref: https://www.sqlite.org/lang_transaction.html 
> --- 
>
>  I chose ":mode" for the name of this parameter to be consistent 
>  with what appears in the SQLite3::Database#transaction 
>  code/rdoc. 
>
>  Perhaps being able to force a transaction mode on connect like 
>  the Perl DBD::SQLite module allows would be a good feature: 
>
>          my $dbh = DBI->connect("dbi:SQLite::memory:", "", "", { 
>            sqlite_use_immediate_transaction => 1, 
>          }); 
>
>  A Sequel equivalent could be: 
>
>    Sequel.connect("sqlite:///path/to/db", :transaction_mode => :immediate) 
>
>  This would make it easier to write database-independent code. 
>
>
First, thanks for sending in a patch. :)

Your approach looks like it will work fine.  Sequel already has support for 
per-transaction transaction isolation levels, which SQLite doesn't support. 
 At the time I implemented the transaction isolation level support, I 
thought about abusing it to support these transaction modes for SQLite, but 
rejected it because they don't represent the same thing.  Having a separate 
option for SQLite's transaction mode is fine, though.

In terms of having a default transaction mode for the Database, I'm fine 
with adding that ability, since a similar setting already exists for 
transaction isolation levels.

I'll merge and test this on Monday, and assuming no problems in the test 
suite (I would expect none), it should be pushed to the master branch on 
GitHub at that time.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/RdkXZDkA5nQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to