Spaces:
Sleeping
Sleeping
| const sqlite3 = require('sqlite3'); | |
| const path = require('path'); | |
| const dbPath = path.resolve(__dirname, 'database.sqlite'); | |
| const db = new sqlite3.Database(dbPath, (err) => { | |
| if (err) { | |
| console.error(err); | |
| return; | |
| } | |
| db.run("DELETE FROM wallets WHERE name='Cash' OR name='RMB' OR id > 12", function(err) { | |
| if (err) { | |
| console.error(err); | |
| } else { | |
| console.log(`Deleted ${this.changes} rows from wallets.`); | |
| } | |
| db.close(); | |
| }); | |
| }); | |