@brainsights/postgres-wrapper
Advanced tools
Comparing version 1.0.2 to 1.1.0
29
index.js
const pg = require("pg"); | ||
const SQL = require("sql-template-strings"); | ||
const squel = require("squel"); | ||
const debug = require("debug")("postgres-wrapper"); | ||
@@ -15,2 +16,18 @@ const uuid = require("@brainsights/brainlab-uuid"); | ||
pool.on("error", (error) => { | ||
debug(`pg-pool error: ${error.message}`); | ||
}); | ||
pool.on("connect", (client) => { | ||
debug(`pg-pool: client connected: ${client.processID}`); | ||
}); | ||
pool.on("acquire", (client) => { | ||
debug(`pg-pool: client acquired`); | ||
}); | ||
let end = async () => { | ||
await pool.end(); | ||
}; | ||
class Client | ||
@@ -57,3 +74,3 @@ { | ||
debug(`${__.get(this).id} release client`); | ||
__.get(this).client.end(); | ||
__.get(this).client.release(); | ||
} | ||
@@ -109,8 +126,18 @@ __.get(this).revoke(); | ||
class Query | ||
{ | ||
constructor() | ||
{ | ||
return squel; | ||
} | ||
}; | ||
return { | ||
end: end, | ||
Client: Client, | ||
Transaction: Transaction, | ||
Range: require("./range"), | ||
Query: Query, | ||
} | ||
}; |
{ | ||
"name": "@brainsights/postgres-wrapper", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -17,4 +17,5 @@ "main": "index.js", | ||
"sql-template-strings": "^2.2.2", | ||
"squel": "^5.9.1", | ||
"uuid": "^3.0.1" | ||
} | ||
} |
@@ -62,2 +62,7 @@ const _ = require("lodash"); | ||
} | ||
inspect() | ||
{ | ||
return this.toString(); | ||
} | ||
} | ||
@@ -64,0 +69,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5906
227
7
+ Addedsquel@^5.9.1
+ Addedsquel@5.13.0(transitive)