Merge vl-sqlite-02: unknown commit outcome after WAL I/O error (VL-SQLITE-02)

This commit is contained in:
faumaray committed 2026-12-03 18:25:05 +03:00
commit 103523f04a
4 files changed
+165 -11

No files matched your search

+7 -1
View File
@@ -182,7 +182,9 @@ namespace Void::Sqlite
/// RAII transaction retaining shared ConnectionState. Never marks Committed
/// before COMMIT succeeds; inspects sqlite3_get_autocommit on error and after
/// statements so an automatic rollback is reported as RolledBack.
/// statements so an automatic rollback is reported as RolledBack. A failed
/// COMMIT whose outcome cannot be proven (WAL I/O error) is reported as
/// Unknown, never as RolledBack.
class Transaction
{
public:
@@ -199,6 +201,10 @@ namespace Void::Sqlite
[[nodiscard]] TransactionState state() const noexcept;
[[nodiscard]] bool is_active() const noexcept;
/// Commits the transaction. On failure state() is Active (SQLite kept
/// the transaction open; retry or roll back), RolledBack (SQLite ended
/// it and it was not committed), or Unknown (SQLite ended it but a WAL
/// I/O error means the commit may have taken effect).
Result<void> commit();
[[nodiscard]] Result<void> rollback_checked();
void rollback() noexcept;