[php-src] Issue #8967: Allow the programmer to set sqlite transaction mode when using PDO
| From: | harrison3000 | Date: | Sun, 10 Jul 2022 15:28:56 +0000 |
| Subject: | [php-src] Issue #8967: Allow the programmer to set sqlite transaction mode when using PDO | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241894@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8967
Author: harrison3000
### 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