Comparing version 7.2.0 to 7.3.0
@@ -7,2 +7,6 @@ All major and minor releases are briefly explained below. | ||
### 7.3.0 | ||
- Add support for [statement timeout](https://github.com/brianc/node-postgres/pull/1436). | ||
### 7.2.0 | ||
@@ -9,0 +13,0 @@ |
@@ -109,6 +109,3 @@ 'use strict' | ||
con.on('authenticationMD5Password', checkPgPass(function (msg) { | ||
var inner = utils.md5(self.password + self.user) | ||
var outer = utils.md5(Buffer.concat([Buffer.from(inner), msg.salt])) | ||
var md5password = 'md5' + outer | ||
con.password(md5password) | ||
con.password(utils.postgresMd5PasswordHash(self.user, self.password, msg.salt)) | ||
})) | ||
@@ -276,2 +273,5 @@ | ||
} | ||
if (params.statement_timeout) { | ||
data.statement_timeout = String(parseInt(params.statement_timeout, 10)) | ||
} | ||
@@ -278,0 +278,0 @@ return data |
@@ -67,2 +67,3 @@ 'use strict' | ||
this.fallback_application_name = val('fallback_application_name', config, false) | ||
this.statement_timeout = val('statement_timeout', config, false) | ||
} | ||
@@ -95,2 +96,3 @@ | ||
add(params, ssl, 'sslcert') | ||
add(params, ssl, 'sslrootcert') | ||
@@ -97,0 +99,0 @@ if (this.database) { |
@@ -38,20 +38,12 @@ 'use strict' | ||
// Connection pool options - see https://github.com/coopernurse/node-pool | ||
// Connection pool options - see https://github.com/brianc/node-pg-pool | ||
// number of connections to use in connection pool | ||
// 0 will disable connection pooling | ||
poolSize: 10, | ||
max: 10, | ||
// max milliseconds a client can go unused before it is removed | ||
// from the pool and destroyed | ||
poolIdleTimeout: 30000, | ||
idleTimeoutMillis: 30000, | ||
// frequency to check for idle clients within the client pool | ||
reapIntervalMillis: 1000, | ||
// if true the most recently released resources will be the first to be allocated | ||
returnToHead: false, | ||
// pool log function / boolean | ||
poolLog: false, | ||
client_encoding: '', | ||
@@ -64,3 +56,6 @@ | ||
parseInputDatesAsUTC: false | ||
parseInputDatesAsUTC: false, | ||
// max milliseconds any query using this connection will execute for before timing out in error. false=unlimited | ||
statement_timeout: false | ||
} | ||
@@ -67,0 +62,0 @@ |
@@ -30,3 +30,3 @@ 'use strict' | ||
var matchRegexp = /([A-Za-z]+) ?(\d+ )?(\d+)?/ | ||
var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/ | ||
@@ -45,8 +45,8 @@ // adds a command complete message | ||
this.command = match[1] | ||
// match 3 will only be existing on insert commands | ||
if (match[3]) { | ||
// msg.value is from native bindings | ||
this.rowCount = parseInt(match[3] || msg.value, 10) | ||
// COMMMAND OID ROWS | ||
this.oid = parseInt(match[2], 10) | ||
} else { | ||
this.rowCount = parseInt(match[3], 10) | ||
} else if (match[2]) { | ||
// COMMAND ROWS | ||
this.rowCount = parseInt(match[2], 10) | ||
@@ -53,0 +53,0 @@ } |
@@ -141,2 +141,9 @@ 'use strict' | ||
// See AuthenticationMD5Password at https://www.postgresql.org/docs/current/static/protocol-flow.html | ||
const postgresMd5PasswordHash = function (user, password, salt) { | ||
var inner = md5(password + user) | ||
var outer = md5(Buffer.concat([Buffer.from(inner), salt])) | ||
return 'md5' + outer | ||
} | ||
module.exports = { | ||
@@ -148,4 +155,5 @@ prepareValue: function prepareValueWrapper (value) { | ||
}, | ||
normalizeQueryConfig: normalizeQueryConfig, | ||
md5: md5 | ||
normalizeQueryConfig, | ||
postgresMd5PasswordHash, | ||
md5 | ||
} |
{ | ||
"name": "pg", | ||
"version": "7.2.0", | ||
"version": "7.3.0", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -22,4 +22,4 @@ "keywords": [ | ||
"buffer-writer": "1.0.1", | ||
"js-string-escape": "1.0.1", | ||
"packet-reader": "0.3.1", | ||
"js-string-escape": "1.0.1", | ||
"pg-connection-string": "0.1.3", | ||
@@ -26,0 +26,0 @@ "pg-pool": "~2.0.3", |
@@ -22,10 +22,10 @@ # node-postgres | ||
* pure JavaScript client and native libpq bindings share _the same api_ | ||
* connection pooling | ||
* extensible js<->postgresql data-type coercion | ||
* supported PostgreSQL features | ||
* parameterized queries | ||
* named statements with query plan caching | ||
* async notifications with `LISTEN/NOTIFY` | ||
* bulk import & export with `COPY TO/COPY FROM` | ||
* Pure JavaScript client and native libpq bindings share _the same api_ | ||
* Connection pooling | ||
* Extensible js<->postgresql data-type coercion | ||
* Supported PostgreSQL features | ||
* Parameterized queries | ||
* Named statements with query plan caching | ||
* Async notifications with `LISTEN/NOTIFY` | ||
* Bulk import & export with `COPY TO/COPY FROM` | ||
@@ -35,3 +35,3 @@ ### Extras | ||
node-postgres is by design pretty light on abstractions. These are some handy modules we've been using over the years to complete the picture. | ||
Entire list can be found on [wiki](https://github.com/brianc/node-postgres/wiki/Extras) | ||
The entire list can be found on our [wiki](https://github.com/brianc/node-postgres/wiki/Extras). | ||
@@ -47,3 +47,3 @@ ## Support | ||
You can also follow me [@briancarlson](https://twitter.com/briancarlson) if that's your thing. I try to always announce noteworthy changes & developments with node-postgres on twitter. | ||
You can also follow me [@briancarlson](https://twitter.com/briancarlson) if that's your thing. I try to always announce noteworthy changes & developments with node-postgres on Twitter. | ||
@@ -50,0 +50,0 @@ ### Professional Support |
@@ -11,2 +11,2 @@ node-postgres is made possible by the helpful contributors from the community well as the following generous supporters on [Patreon](https://www.patreon.com/node_postgres). | ||
- Rein Petersen | ||
- Arnaud Benhamdine | ||
- Arnaud Benhamdine [@abenhamdine](https://twitter.com/abenhamdine) |
Sorry, the diff of this file is not supported yet
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
84469
1942