Add function to export database snapshot
This commit is contained in:
@@ -434,3 +434,9 @@ export async function deleteTextVersion(promptId: string, versionId: string) {
|
|||||||
[nextId, promptId]
|
[nextId, promptId]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function exportDatabaseSnapshot(destinationPath: string) {
|
||||||
|
const db = await getDb();
|
||||||
|
const escapedPath = destinationPath.replace(/'/g, "''");
|
||||||
|
await db.execute(`VACUUM INTO '${escapedPath}'`);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user