jayralencar / sqlite-sync.js

Node module to sqlite sync and async
MIT License
78 stars 30 forks source link

not worked with node 7 with classes and object #8

Open bawasaab opened 7 years ago

bawasaab commented 7 years ago

this module is not working with Classes and objects node version : v7.5.0

below code is not working

var db = require('sqlite-sync'); //requiring

class Connection {

constructor() {

    open_conn();
}

open_conn() {

    db.connect('test.db'); 
}

insert() {
    db.insert("employee_master",{name:"Deepak", status: "ACTIVE"}, function(res){
        if(res.error)
            throw res.error;
        console.log(res);
    });
}

close_conn() {

    db.close();
}

}

var obj = new Connection(); obj.insert();