Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TODO
- var db = new class Database{
- connection = null;
- constructor(){
- this.connection = mysql.createConnection(config.mysql).promise();
- }
- getSelect(table,id){
- var where = "WHERE";
- switch (table){
- case listdb.User:
- where = 'id = ?'
- }
- return this.connection.query("SELECT * FROM "+table+where,[id]).then(result =>{
- return result;
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement