This commit is contained in:
2025-11-18 00:36:23 +00:00
parent 8f538ab9c0
commit 1fe3cd7f14
3 changed files with 115 additions and 73 deletions

View File

@@ -120,6 +120,7 @@ export class OneboxDatabase {
type TEXT NOT NULL,
value TEXT NOT NULL,
cloudflare_id TEXT,
zone_id TEXT,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
)
@@ -437,7 +438,11 @@ export class OneboxDatabase {
if (!this.db) throw new Error('Database not initialized');
const rows = this.query('SELECT value FROM settings WHERE key = ?', [key]);
return rows.length > 0 ? String(rows[0][0]) : null;
if (rows.length === 0) return null;
// @db/sqlite returns rows as objects with column names as keys
const value = (rows[0] as any).value || rows[0][0];
return value ? String(value) : null;
}
setSetting(key: string, value: string): void {