Use Write-Ahead Logging jorunaling mode for SQLite concurrency

This commit is contained in:
Yiorgis Gozadinos 2025-08-01 09:07:31 +02:00
parent d677dc8001
commit 0f2809cb8d
No known key found for this signature in database

View file

@ -37,6 +37,11 @@ class Store:
db = sqlite3.connect(self.db_path)
db.enable_load_extension(True)
sqlite_vec.load(db)
# Enable WAL mode for better concurrency (skip for in-memory databases)
if self.db_path != ":memory:":
db.execute("PRAGMA journal_mode=WAL")
self._connection = db
existing_tables = [
row[0]