Skip to content

Allow the programmer to set sqlite transaction mode when using PDO #8967

@harrison3000

Description

@harrison3000

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions