Major version update. Major bugfixes. Security vulnerabilites fixed
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
/**
|
||||
* # Write a consistent copy of the database to `dst`
|
||||
* @description Uses `VACUUM INTO`, which includes changes still in the WAL
|
||||
* file (a plain file copy misses them).
|
||||
*/
|
||||
export default function snapshotDb({ db, dst }) {
|
||||
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
||||
fs.rmSync(dst, { force: true });
|
||||
db.run("VACUUM INTO ?", [dst]);
|
||||
}
|
||||
Reference in New Issue
Block a user