[add] lib:node:pg

This commit is contained in:
roydfalk 2024-08-28 07:51:53 +02:00
parent 8ecd0bd63e
commit a990286cbd
6 changed files with 19 additions and 11 deletions

View file

@ -1017,9 +1017,9 @@
}
},
"node_modules/pg": {
"version": "8.11.5",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.11.5.tgz",
"integrity": "sha512-jqgNHSKL5cbDjFlHyYsCXmQDrfIX/3RsNwYqpd4N0Kt8niLuNoRNH+aazv6cOd43gPh9Y4DjQCtb+X0MH0Hvnw==",
"version": "8.12.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.12.0.tgz",
"integrity": "sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==",
"dependencies": {
"pg-connection-string": "^2.6.4",
"pg-pool": "^3.6.2",

View file

@ -10,6 +10,7 @@ var NativeQuery = (module.exports = function (config, values, callback) {
this.text = config.text
this.values = config.values
this.name = config.name
this.queryMode = config.queryMode
this.callback = config.callback
this.state = 'new'
this._arrayMode = config.rowMode === 'array'
@ -159,6 +160,8 @@ NativeQuery.prototype.submit = function (client) {
}
var vals = this.values.map(utils.prepareValue)
client.native.query(this.text, vals, after)
} else if (this.queryMode === 'extended') {
client.native.query(this.text, [], after)
} else {
client.native.query(this.text, after)
}

View file

@ -16,6 +16,7 @@ class Query extends EventEmitter {
this.rows = config.rows
this.types = config.types
this.name = config.name
this.queryMode = config.queryMode
this.binary = config.binary
// use unique portal name each time
this.portal = config.portal || ''
@ -32,6 +33,10 @@ class Query extends EventEmitter {
}
requiresPreparation() {
if (this.queryMode === 'extended') {
return true
}
// named queries must always be prepared
if (this.name) {
return true

View file

@ -1,6 +1,6 @@
{
"name": "pg",
"version": "8.11.5",
"version": "8.12.0",
"description": "PostgreSQL client - pure javascript & libpq with the same API",
"keywords": [
"database",
@ -34,7 +34,7 @@
"pg-copy-streams": "0.3.0",
"typescript": "^4.0.3",
"workerd": "^1.20230419.0",
"wrangler": "^2.16.0"
"wrangler": "3.58.0"
},
"optionalDependencies": {
"pg-cloudflare": "^1.1.1"
@ -58,5 +58,5 @@
"engines": {
"node": ">= 8.0.0"
},
"gitHead": "a37a93bf7990220517a40cf16b8e72d4c3e6cef5"
"gitHead": "0f42880861951970e193d31359508d460a67d25a"
}

View file

@ -5,7 +5,7 @@
"packages": {
"": {
"dependencies": {
"pg": "^8.11.5",
"pg": "^8.12.0",
"sqlite3": "^5.1.7"
},
"devDependencies": {
@ -1029,9 +1029,9 @@
}
},
"node_modules/pg": {
"version": "8.11.5",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.11.5.tgz",
"integrity": "sha512-jqgNHSKL5cbDjFlHyYsCXmQDrfIX/3RsNwYqpd4N0Kt8niLuNoRNH+aazv6cOd43gPh9Y4DjQCtb+X0MH0Hvnw==",
"version": "8.12.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.12.0.tgz",
"integrity": "sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==",
"dependencies": {
"pg-connection-string": "^2.6.4",
"pg-pool": "^3.6.2",

View file

@ -6,7 +6,7 @@
"yaml": "^2.4.1"
},
"dependencies": {
"pg": "^8.11.5",
"pg": "^8.12.0",
"sqlite3": "^5.1.7"
}
}