Add read only mode that doesn't use locking. Useful for inspection while the database is in use or when no changes are intended (except in RAM).

This commit is contained in:
2026-06-14 19:35:06 +00:00
parent b501fcca86
commit c04a245366
10 changed files with 330 additions and 63 deletions
+6
View File
@@ -118,6 +118,12 @@ reloads, while system operations such as migrations leave it unchanged.
- `await kanta.open()` (default) creates the database file if missing.
- `await kanta.open(create=False)` fails when the file is missing or empty.
- `await kanta.open(readonly=True)` opens an existing database read-only.
- The file is opened without acquiring a lock and without a background flush
task.
- Existing records are replayed and migrations are still applied in memory.
- Transactions and explicit flushes are rejected.
- The file is never created if missing.
### Callbacks