codeceptjs-postgre
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -5,2 +5,3 @@ | ||
const camelcaseKeys = require('camelcase-keys'); | ||
const pgNamed = require('node-postgres-named'); | ||
@@ -99,2 +100,3 @@ let PGClient; | ||
}); | ||
pgNamed.patch(this.connections[dbName]); | ||
return this.connections[dbName].connect(); | ||
@@ -110,8 +112,9 @@ } | ||
* @param {string} query | ||
* @param [object] params | ||
* @param {string} dbName | ||
* @returns {Promise<*>} | ||
*/ | ||
query(query, dbName) { | ||
query(query, params = {}, dbName) { | ||
if (this.connections[dbName]) { | ||
return this.connections[dbName].query(query) | ||
return this.connections[dbName].query(query, params) | ||
.then((res) => { | ||
@@ -126,3 +129,3 @@ if (res.command === 'SELECT') { | ||
return this._openConnect(dbName) | ||
.then(() => this.connections[dbName].query(query) | ||
.then(() => this.connections[dbName].query(query, params) | ||
.then((res) => { | ||
@@ -129,0 +132,0 @@ if (res.command === 'SELECT') { |
{ | ||
"name": "codeceptjs-postgre", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "CodeceptJS helper for PostgreSQL", | ||
@@ -8,2 +8,3 @@ "dependencies": { | ||
"pg": "^7.4.3", | ||
"node-postgres-named": "^2.4.1", | ||
"requireg": "^0.1.8" | ||
@@ -10,0 +11,0 @@ }, |
4414
135
4
+ Addednode-postgres-named@^2.4.1
+ Addedlodash@4.17.21(transitive)
+ Addednode-postgres-named@2.4.1(transitive)