Use Write-Ahead Logging jorunaling mode for SQLite concurrency
This commit is contained in:
parent
d677dc8001
commit
0f2809cb8d
1 changed files with 5 additions and 0 deletions
|
|
@ -37,6 +37,11 @@ class Store:
|
||||||
db = sqlite3.connect(self.db_path)
|
db = sqlite3.connect(self.db_path)
|
||||||
db.enable_load_extension(True)
|
db.enable_load_extension(True)
|
||||||
sqlite_vec.load(db)
|
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
|
self._connection = db
|
||||||
existing_tables = [
|
existing_tables = [
|
||||||
row[0]
|
row[0]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue