Parent Directory
|
Revision Log
Added base commands
1 | rakin | 5 | const { Database: DB } = require('sqlite3'); |
2 | |||
3 | class Database { | ||
4 | constructor(dbpath) { | ||
5 | this.dbpath = dbpath; | ||
6 | this.db = new DB(dbpath, (err) => { | ||
7 | if (err) { | ||
8 | console.log(err); | ||
9 | } | ||
10 | }); | ||
11 | } | ||
12 | |||
13 | get(sql, callback1, callback2) { | ||
14 | return this.db.get(sql, callback1, callback2); | ||
15 | } | ||
16 | |||
17 | all(sql, callback1, callback2) { | ||
18 | return this.db.all(sql, callback1, callback2); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | module.exports = Database; |
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |