Added episodic layer with FTS5 triggers and search
This commit is contained in:
@@ -13,6 +13,11 @@ function getDB() {
|
||||
db.pragma('foreign_keys = ON');
|
||||
|
||||
db.exec(schema);
|
||||
|
||||
// Sync FTS index with any existing episodes data
|
||||
db.exec(`INSERT OR REPLACE INTO episodes_fts(rowid, user_message, ai_response)
|
||||
SELECT id, user_message, ai_response FROM episodes`);
|
||||
|
||||
console.log(`Connected to SQLite database at ${path}`);
|
||||
}
|
||||
return db;
|
||||
|
||||
Reference in New Issue
Block a user