Queue native collection launches before async placement
This commit is contained in:
@@ -3,6 +3,11 @@ import type Database from 'better-sqlite3';
|
||||
const initialized = new WeakSet<Database.Database>();
|
||||
export function ensureGameFileSchema(handle: Database.Database): void {
|
||||
if (initialized.has(handle)) return;
|
||||
// Worker readers open only after the controller has initialized the schema.
|
||||
if (handle.readonly) {
|
||||
initialized.add(handle);
|
||||
return;
|
||||
}
|
||||
handle.exec(`
|
||||
CREATE TABLE IF NOT EXISTS game_file_libraries (
|
||||
id TEXT PRIMARY KEY, name TEXT NOT NULL COLLATE NOCASE UNIQUE,
|
||||
|
||||
Reference in New Issue
Block a user