-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Description
I would be nice to have a attribute to set the transaction mode when using PDO_SQLITE (maybe PDO::ATTR_SQLITE_TRANSACTION_MODE
, idk)
SQLite has multiple transaction modes, however the PDO::beginTransaction method always uses the default (deferred)
Why
Different use cases would benefit from different transaction modes, for example the immediate
transaction mode is very useful when used in conjunction with the WAL journaling mode, as it allows multiple write transactions to happen at the same time (the second transaction waits instead of just failing at the first write with SQLITE_BUSY)
One can easily override the beginTransaction method to use the other transaction modes if they are needed, but it would be nice to have this as an PDO attribute and documented, instead of relying on the programmer overriding a method
PHP Version
PHP 8.1, Ubuntu 22.04