Repository navigation
Enable WAL - #25
Enable WAL#25glguida wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables SQLite's Write-Ahead Logging (WAL) mode for the vector database to improve concurrency and performance. WAL mode allows multiple readers to access the database while a writer is making changes, which is beneficial for concurrent access scenarios.
Key Changes:
- Adds
PRAGMA journal_mode = WALstatement during database connection initialization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Enable foreign keys for the ON DELETE CASCADE behavior | ||
| conn.execute("PRAGMA foreign_keys = ON", ()).await?; | ||
| // Enable WAL mode for better concurrency and performance | ||
| conn.query("PRAGMA journal_mode = WAL", ()).await?; |
There was a problem hiding this comment.
The query method is used here, but it should be execute for consistency with the PRAGMA statement on line 116. The query method is typically used when you expect to read results from the database, while execute is for statements that don't return a result set. PRAGMA statements that set values should use execute.
| conn.query("PRAGMA journal_mode = WAL", ()).await?; | |
| conn.execute("PRAGMA journal_mode = WAL", ()).await?; |
There was a problem hiding this comment.
this actually returns this error:
Error: Database error: Database operation failed: Execute returned rows
Caused by:
0: Database operation failed: Execute returned rows
1: Execute returned rows
Which caused me to use query.
No description provided.