Merge pull request #487 from andrewnguonly/sqlite-wal

This commit is contained in:
Nuno Campos
2024-05-17 11:41:42 -07:00
committed by GitHub
3 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -54,7 +54,9 @@ class EphemeralValue(Generic[Value], BaseChannel[Value, Value, Value]):
finally:
return
if len(values) != 1 and self.guard:
raise InvalidUpdateError("LastValue can only receive one value per step.")
raise InvalidUpdateError(
"EphemeralValue can only receive one value per step."
)
self.value = values[-1]
+1
View File
@@ -191,6 +191,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver, AbstractAsyncContextManager):
await self.conn
async with self.conn.executescript(
"""
PRAGMA journal_mode=WAL;
CREATE TABLE IF NOT EXISTS checkpoints (
thread_id TEXT NOT NULL,
thread_ts TEXT NOT NULL,
+1
View File
@@ -159,6 +159,7 @@ class SqliteSaver(BaseCheckpointSaver, AbstractContextManager):
self.conn.executescript(
"""
PRAGMA journal_mode=WAL;
CREATE TABLE IF NOT EXISTS checkpoints (
thread_id TEXT NOT NULL,
thread_ts TEXT NOT NULL,