the-forest/server/db_scripts/dump_24-10-10.js
2024-10-10 22:54:22 -04:00

11 lines
361 B
JavaScript

const sqlite = require("better-sqlite3");
const db = new sqlite('the_big_db.db', { verbose: console.log });
const fs = require('node:fs');
const dump = {
pages: db.prepare('select * from pages').all(),
users: db.prepare('select * from users').all()
};
fs.writeFile(`dump_${new Date().toISOString()}.json`, JSON.stringify(dump), (err) => console.log(err) );