Skip to content

Add ability to use BEGIN IMMEDIATE and BEGIN EXCLUSIVE database transactions (SQLite backend) #2487

@ksdhans

Description

@ksdhans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions