gd-utils/clear-db.js

9 lines
209 B
JavaScript
Raw Normal View History

2020-07-30 17:43:16 +08:00
const { db } = require('./db')
const record = db.prepare('select count(*) as c from gd').get()
db.prepare('delete from gd').run()
console.log('已刪除', record.c, '項資料')
db.exec('vacuum')
db.close()