Make js work agian
This commit is contained in:
parent
63a761bbc0
commit
3f929f9607
16 changed files with 4258 additions and 130 deletions
|
|
@ -5,8 +5,8 @@ module.exports = {
|
|||
loadModule: function(key,dbModule) {
|
||||
tcrudSetup.pluginLoad(new DatabasePlugin(key,dbModule));
|
||||
},
|
||||
loadPostgres: function(key,dbUri,pgDB,pgDBNamed) {
|
||||
tcrudSetup.pluginLoad(new DatabasePlugin(key,new PostgresModule(dbUri,pgDB,pgDBNamed)));
|
||||
loadPostgres: function(key,dbPool,pgDBNamed) {
|
||||
tcrudSetup.pluginLoad(new DatabasePlugin(key,new PostgresModule(dbPool,pgDBNamed)));
|
||||
},
|
||||
loadMysql2: function(key,pool) {
|
||||
tcrudSetup.pluginLoad(new DatabasePlugin(key,new Mysql2Module(pool)));
|
||||
|
|
@ -18,14 +18,13 @@ module.exports = {
|
|||
|
||||
//------- PostgresModule Object
|
||||
|
||||
function PostgresModule(dbUri,pgDB,pgDBNamed) {
|
||||
this.dbUri = dbUri;
|
||||
this.pgDB = pgDB;
|
||||
function PostgresModule(dbPool,pgDBNamed) {
|
||||
this.dbPool = dbPool;
|
||||
this.pgDBNamed = pgDBNamed;
|
||||
}
|
||||
PostgresModule.prototype.query = function(sqlQuery,params, cb) {
|
||||
var self = this;
|
||||
self.pgDB.connect(self.dbUri, function(err, client, done) {
|
||||
self.dbPool.connect(function(err, client, done) {
|
||||
self.pgDBNamed.patch(client);
|
||||
client.query(sqlQuery, params, function(err, result) {
|
||||
done(); // release client from pool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue