backup / restoreslop

This commit is contained in:
legop3
2026-09-14 19:09:02 -04:00
parent edc1b825f2
commit 1c34849bd0
32 changed files with 1220 additions and 70 deletions
+10
View File
@@ -372,6 +372,15 @@ function createConfigurationDatabase({ databasePath = DEFAULT_DATABASE_PATH } =
return importConfigurationFileTransaction(payload);
}
function backupDatabase(destinationPath) {
/*
SQLite's online backup API produces one coherent database file while the
live WAL-backed connection remains open. The backup service receives only
this narrow operation, never the private database handle.
*/
return db.backup(destinationPath);
}
return {
databasePath,
getActiveConfigurationRecord,
@@ -389,6 +398,7 @@ function createConfigurationDatabase({ databasePath = DEFAULT_DATABASE_PATH } =
listAuditEvents,
recordAuditEvent,
importConfigurationFile,
backupDatabase,
close: () => db.close(),
};
}