pg-promise 11.12.1 → 11.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -8
- package/lib/events.js +8 -0
- package/lib/main.js +1 -1
- package/lib/query.js +3 -2
- package/lib/utils/index.js +1 -1
- package/package.json +11 -11
- package/typescript/pg-promise.d.ts +3 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@ pg-promise
|
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
4
|
[](https://github.com/vitaly-t/pg-promise/actions/workflows/ci.yml)
|
|
5
|
-
[](https://nodejs.org)
|
|
6
6
|
[](https://www.postgresql.org)
|
|
7
7
|
|
|
8
8
|
---
|
|
@@ -12,7 +12,6 @@ PostgreSQL interface for Node.js
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
* [About](#about)
|
|
15
|
-
* [Support & Sponsorship](#support--sponsorship)
|
|
16
15
|
* [Documentation](#documentation)
|
|
17
16
|
* [Contributing](#contributing)
|
|
18
17
|
* [Usage]
|
|
@@ -59,12 +58,6 @@ At its inception in 2015, this library was only adding promises to the base driv
|
|
|
59
58
|
And while the original name was kept, the library's functionality was vastly extended, with promises now being
|
|
60
59
|
only its tiny part.
|
|
61
60
|
|
|
62
|
-
# Support & Sponsorship
|
|
63
|
-
|
|
64
|
-
I do free support here and on [StackOverflow](https://stackoverflow.com/questions/tagged/pg-promise).
|
|
65
|
-
|
|
66
|
-
And if you want to help this project, I can accept Bitcoin: `1yki7MXMkuDw8qqe5icVdh1GJZSQSzKZp`
|
|
67
|
-
|
|
68
61
|
# Documentation
|
|
69
62
|
|
|
70
63
|
Chapter [Usage] below explains the basics you need to know, while the [Official Documentation]
|
package/lib/events.js
CHANGED
|
@@ -527,6 +527,14 @@ module.exports = {Events};
|
|
|
527
527
|
* - there were no parameters passed into the query method;
|
|
528
528
|
* - property `query` of this object already contains all the formatting values in it, so logging only the query is sufficient.
|
|
529
529
|
*
|
|
530
|
+
* @property {*} values - The original parameter values passed into the query method.
|
|
531
|
+
* It is set for all events.
|
|
532
|
+
*
|
|
533
|
+
* @property {string|undefined} queryFilePath
|
|
534
|
+
* **Added in v11.14**<br/>
|
|
535
|
+
* File path of a {@link QueryFile}, if the query comes from an external SQL file.
|
|
536
|
+
* This is set only when the query originates from a {@link QueryFile} and only for events {@link event:query query} and {@link event:error error}.
|
|
537
|
+
*
|
|
530
538
|
* @property {TaskContext} ctx
|
|
531
539
|
* _Task/Transaction Context_ object.
|
|
532
540
|
*
|
package/lib/main.js
CHANGED
package/lib/query.js
CHANGED
|
@@ -42,7 +42,7 @@ function $query(ctx, query, values, qrm, config) {
|
|
|
42
42
|
const opt = ctx.options,
|
|
43
43
|
capSQL = opt.capSQL;
|
|
44
44
|
|
|
45
|
-
let error, entityType,
|
|
45
|
+
let error, entityType, queryFilePath,
|
|
46
46
|
pgFormatting = opt.pgFormatting,
|
|
47
47
|
params = pgFormatting ? values : undefined;
|
|
48
48
|
|
|
@@ -67,6 +67,7 @@ function $query(ctx, query, values, qrm, config) {
|
|
|
67
67
|
error = query.error;
|
|
68
68
|
query = query.file;
|
|
69
69
|
} else {
|
|
70
|
+
queryFilePath = query.file;
|
|
70
71
|
query = query[QueryFile.$query];
|
|
71
72
|
}
|
|
72
73
|
} else {
|
|
@@ -240,7 +241,7 @@ function $query(ctx, query, values, qrm, config) {
|
|
|
240
241
|
error = new Error(npm.text.looseQuery);
|
|
241
242
|
}
|
|
242
243
|
return {
|
|
243
|
-
client, query, params,
|
|
244
|
+
client, query, params, queryFilePath, values,
|
|
244
245
|
dc: ctx.dc,
|
|
245
246
|
ctx: ctx.ctx
|
|
246
247
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -31,7 +31,7 @@ function isText(txt) {
|
|
|
31
31
|
// Proper configuration is having NODE_ENV = 'development', but this
|
|
32
32
|
// method only checks for 'dev' being present, and regardless of the case.
|
|
33
33
|
function isDev() {
|
|
34
|
-
const env =
|
|
34
|
+
const env = process.env.NODE_ENV || '';
|
|
35
35
|
return env.toLowerCase().indexOf('dev') !== -1;
|
|
36
36
|
}
|
|
37
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-promise",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.14.0",
|
|
4
4
|
"description": "PostgreSQL interface for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "typescript/pg-promise.d.ts",
|
|
@@ -41,27 +41,27 @@
|
|
|
41
41
|
"node": ">=14.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"assert-options": "0.8.
|
|
45
|
-
"pg": "8.14.
|
|
44
|
+
"assert-options": "0.8.3",
|
|
45
|
+
"pg": "8.14.1",
|
|
46
46
|
"pg-minify": "1.7.0",
|
|
47
|
-
"spex": "3.4.
|
|
47
|
+
"spex": "3.4.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"pg-query-stream": "4.8.
|
|
50
|
+
"pg-query-stream": "4.8.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@eslint/js": "9.
|
|
54
|
-
"@types/node": "22.
|
|
53
|
+
"@eslint/js": "9.28.0",
|
|
54
|
+
"@types/node": "22.15.29",
|
|
55
55
|
"bluebird": "3.7.2",
|
|
56
56
|
"coveralls": "3.1.1",
|
|
57
|
-
"cspell": "
|
|
58
|
-
"eslint": "9.
|
|
59
|
-
"globals": "16.
|
|
57
|
+
"cspell": "9.0.2",
|
|
58
|
+
"eslint": "9.28.0",
|
|
59
|
+
"globals": "16.2.0",
|
|
60
60
|
"istanbul": "0.4.5",
|
|
61
61
|
"jasmine-node": "3.0.0",
|
|
62
62
|
"jsdoc": "4.0.4",
|
|
63
63
|
"JSONStream": "1.3.5",
|
|
64
64
|
"tslint": "6.1.3",
|
|
65
|
-
"typescript": "5.8.
|
|
65
|
+
"typescript": "5.8.3"
|
|
66
66
|
}
|
|
67
67
|
}
|