1
0

Disable FTS

This commit is contained in:
Zef Hemel 2022-10-17 16:28:23 +02:00
parent c2ccd2a6a1
commit e7a240127c

View File

@ -11,18 +11,18 @@ export function ensureFTSTable(
db: SQLite, db: SQLite,
tableName: string, tableName: string,
) { ) {
const stmt = db.prepare( // const stmt = db.prepare(
`SELECT name FROM sqlite_master WHERE type='table' AND name=?`, // `SELECT name FROM sqlite_master WHERE type='table' AND name=?`,
); // );
const result = stmt.all(tableName); // const result = stmt.all(tableName);
if (result.length === 0) { // if (result.length === 0) {
asyncExecute( // asyncExecute(
db, // db,
`CREATE VIRTUAL TABLE ${tableName} USING fts5(key, value);`, // `CREATE VIRTUAL TABLE ${tableName} USING fts5(key, value);`,
); // );
console.log(`Created fts5 table ${tableName}`); // console.log(`Created fts5 table ${tableName}`);
} // }
return Promise.resolve(); return Promise.resolve();
} }