Add function to export database snapshot

This commit is contained in:
2026-03-13 21:55:45 +01:00
parent 14e1f40ecf
commit b40c8eae06

View File

@@ -434,3 +434,9 @@ export async function deleteTextVersion(promptId: string, versionId: string) {
[nextId, promptId]
);
}
export async function exportDatabaseSnapshot(destinationPath: string) {
const db = await getDb();
const escapedPath = destinationPath.replace(/'/g, "''");
await db.execute(`VACUUM INTO '${escapedPath}'`);
}