forked from NatSR4/Exalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase_tools.js
27 lines (22 loc) · 963 Bytes
/
database_tools.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const initModels = require('./models/init-models.js');
const user_tools = require('./user_tools.js');
const class_tools = require('./class_tools.js');
const setting_tools = require('./setting_tools.js');
class Database_Tools {
/* This class holds instances for each of the tools classes. This is so their
members can be called from one instance of this class
In order to call functions from these classes use the following syntax:
database_tool.classes.create_class(parameters...)
.then(result => { console.log(result); }) // prints true
.catch((err) => { console.log(err); }); // prints error if thrown
*/
constructor(sequelize) {
this.sequelize = sequelize;
this.sequelize.authenticate();
initModels(this.sequelize);
this.users = new user_tools(sequelize);
this.classes = new class_tools(sequelize);
this.settings = new setting_tools(sequelize);
}
}
module.exports = Database_Tools;