Merge pull request #25 from ggozad/feat/sqlite_wal

Use Write-Ahead Logging jorunaling mode for SQLite concurrency
This commit is contained in:
Yiorgis Gozadinos 2025-08-01 16:10:13 +02:00 committed by GitHub
commit 4bfd54b2ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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]