Commit Graph

14 Commits

Author SHA1 Message Date
Pekka Enberg
433b60555f Add BEGIN CONCURRENT support for MVCC mode
Currently, when MVCC is enabled, every transaction mode supports
concurrent reads and writes, which makes it hard to adopt for existing
applications that use `BEGIN DEFERRED` or `BEGIN IMMEDIATE`.

Therefore, add support for `BEGIN CONCURRENT` transactions when MVCC is
enabled. The transaction mode allows multiple concurrent read/write
transactions that don't block each other, with conflicts resolved at
commit time. Furthermore, implement the correct semantics for `BEGIN
DEFERRED` and `BEGIN IMMEDIATE` by taking advantage of the pager level
write lock when transaction upgrades to write. This means that now
concurrent MVCC transactions are serialized against the legacy ones when
needed.

The implementation includes:

- Parser support for CONCURRENT keyword in BEGIN statements

- New Concurrent variant in TransactionMode to distinguish from regular
  read/write transactions

- MVCC store tracking of exclusive transactions to support IMMEDIATE and
  EXCLUSIVE modes alongside CONCURRENT

- Proper transaction state management for all transaction types in MVCC

This enables better concurrency for applications that can handle
optimistic concurrency control, while still supporting traditional
SQLite transaction semantics via IMMEDIATE and EXCLUSIVE modes.
2025-09-11 16:05:52 +03:00
TcMits
33a04fbaf7 resolve conflict 2025-09-02 17:30:10 +07:00
Levy A.
678ca8d33b feat(parser): add ALTER COLUMN 2025-08-30 03:10:39 -03:00
TcMits
1b048b2628 clippy+fmt 2025-08-27 15:08:32 +07:00
TcMits
4ddfdb2a62 finish 2025-08-27 14:58:35 +07:00
TcMits
50bdaec6d0 merge main 2025-08-27 13:36:54 +07:00
TcMits
3cd43b9374 no need to return error in fmt 2025-08-27 13:22:40 +07:00
Pekka Enberg
8eab179a53 parser/ast: Add Register AST node 2025-08-25 17:48:17 +03:00
TcMits
9e4f3b41ef correctly implement get_column_name 2025-08-24 14:07:46 +07:00
TcMits
399f10fe9a refactor parser fmt 2025-08-23 19:16:26 +07:00
TcMits
14eb8a8ffe move check code into parser 2025-08-22 16:28:56 +07:00
Levy A.
8a610a776f refactor: Result type alias 2025-08-21 15:24:01 -03:00
Levy A.
8f198a3086 fix create view columns length check 2025-08-21 15:24:01 -03:00
Levy A.
c6b032de63 feat: add AST formating and checking 2025-08-21 15:19:17 -03:00