/[sudobot]/trunk/src/Database.js
ViewVC logotype

Annotation of /trunk/src/Database.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (hide annotations)
Mon Jul 29 17:28:11 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 480 byte(s)
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