drogonframework / drogonframework/drogon
Add ability to use BEGIN IMMEDIATE and BEGIN EXCLUSIVE database transactions (SQLite backend)
Open
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
SQLite's method of setting the transaction mode, is to add IMMEDIATE/EXCLUSIVE to the BEGIN command. Drogon currently hard-codes BEGIN.
The down side of this is potential transaction failures of the read and then write (or read and maybe write) pattern.
I suggest adding a newTransaction() variant that takes the following enum:
```
enum class TransactionType {
Default, // current behavior
Immediate, // SQLite: BEGIN IMMEDIATE
Exclusive // SQLite: BEGIN EXCLUSIVE
};
```
This would allow BEGIN IMMEDIATE and BEGIN EXCLUSIVE. Other databases could safely ignore this.
Contributor guide
Assessment
This issue has not been assessed yet.