refactored export functionality

This commit is contained in:
2026-05-22 14:17:02 +02:00
parent 52d4ef42dc
commit 2616238dc8
6 changed files with 206 additions and 157 deletions

View File

@ -78,6 +78,12 @@ function qdb_open(bool $writable = false): array {
}
$pdo->exec("PRAGMA user_version = " . QDB_VERSION . ";");
$pdo->exec("PRAGMA foreign_keys = ON;");
// Persist upgrade even when opened read-only (otherwise migration is lost on discard)
if (!$writable) {
qdb_save($tmpDb, $lockFp);
return qdb_open(false);
}
}
return [$pdo, $tmpDb, $lockFp];