fix(sqlite): match reserved object names literally

This commit is contained in:
Hypatia May
2026-07-24 11:11:45 +08:00
parent 352934b9ec
commit e54a4ad986
4 changed files with 39 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ export async function openSearchDatabase(path: string, journalMode: JournalMode)
function listUserTables(db: DatabaseSync): string[] {
const rows = db.prepare(
"SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' ORDER BY name",
"SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT GLOB 'sqlite_*' ORDER BY name",
).all() as Array<{ name: string }>
return rows.map(row => row.name)
}