pg-promise 12.0.0 → 12.1.1
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 -1
- package/lib/task.js +4 -6
- package/package.json +4 -6
- package/typescript/pg-promise.d.ts +14 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ pg-promise
|
|
|
3
3
|
|
|
4
4
|
[](https://github.com/vitaly-t/pg-promise/actions/workflows/ci.yml)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
|
-
[](https://www.postgresql.org)
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
package/lib/task.js
CHANGED
|
@@ -116,15 +116,13 @@ function Task(ctx, tag, isTX, config) {
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* @deprecated
|
|
120
|
-
* Consider using <b>async/await</b> syntax instead, or if you must have
|
|
121
|
-
* pre-generated promises, then $[Promise.allSettled].
|
|
122
|
-
*
|
|
123
119
|
* @method Task#batch
|
|
124
120
|
* @description
|
|
125
121
|
* Settles a predefined array of mixed values by redirecting to method $[spex.batch].
|
|
126
122
|
*
|
|
127
|
-
*
|
|
123
|
+
* **NOTE:**
|
|
124
|
+
* Consider using `async/await` syntax instead, or if you must have
|
|
125
|
+
* pre-generated promises, then $[Promise.allSettled].
|
|
128
126
|
*
|
|
129
127
|
* @param {array} values
|
|
130
128
|
* @param {Object} [options]
|
|
@@ -332,7 +330,7 @@ module.exports = config => {
|
|
|
332
330
|
// we keep 'npm.query' initialization here, even though it is always
|
|
333
331
|
// pre-initialized by the 'database' module, for integrity purpose.
|
|
334
332
|
npmLocal.query = npmLocal.query || npm.query();
|
|
335
|
-
npmLocal.spex = npmLocal.spex || npm.spex
|
|
333
|
+
npmLocal.spex = npmLocal.spex || npm.spex;
|
|
336
334
|
|
|
337
335
|
return {
|
|
338
336
|
Task, execute, callback
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-promise",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.1",
|
|
4
4
|
"description": "PostgreSQL interface for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "typescript/pg-promise.d.ts",
|
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
"spelling": "cspell --config=.cspell.json \"**/*.{md,ts,js}\" --no-progress",
|
|
9
9
|
"coverage": "istanbul cover ./node_modules/jasmine-node/bin/jasmine-node --captureExceptions test",
|
|
10
10
|
"doc": "jsdoc -c ./jsdoc/jsdoc.js ./jsdoc/README.md -t ./jsdoc/templates/custom",
|
|
11
|
-
"lint": "eslint ./lib ./test/*.js ./test/db
|
|
11
|
+
"lint": "eslint ./lib ./test/*.js ./test/db",
|
|
12
12
|
"test": "jasmine-node --captureExceptions test",
|
|
13
13
|
"test:init": "node test/db/init.js",
|
|
14
|
-
"test:native": "jasmine-node test --config PG_NATIVE true"
|
|
15
|
-
"tslint": "tslint ./typescript/*.ts"
|
|
14
|
+
"test:native": "jasmine-node test --config PG_NATIVE true"
|
|
16
15
|
},
|
|
17
16
|
"files": [
|
|
18
17
|
"lib",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"assert-options": "0.8.3",
|
|
45
44
|
"pg": "8.16.3",
|
|
46
45
|
"pg-minify": "1.8.0",
|
|
47
|
-
"spex": "
|
|
46
|
+
"spex": "4.0.1"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"pg-query-stream": "4.10.3"
|
|
@@ -60,7 +59,6 @@
|
|
|
60
59
|
"jasmine-node": "3.0.0",
|
|
61
60
|
"jsdoc": "4.0.4",
|
|
62
61
|
"JSONStream": "1.3.5",
|
|
63
|
-
"tslint": "6.1.3",
|
|
64
62
|
"typescript": "5.9.2"
|
|
65
63
|
}
|
|
66
64
|
}
|
|
@@ -35,6 +35,17 @@ declare namespace _txMode {
|
|
|
35
35
|
// API: https://vitaly-t.github.io/pg-promise/module-pg-promise.html
|
|
36
36
|
declare namespace pgPromise {
|
|
37
37
|
|
|
38
|
+
interface ISpex {
|
|
39
|
+
batch: typeof spexLib.batch
|
|
40
|
+
page: typeof spexLib.page
|
|
41
|
+
sequence: typeof spexLib.sequence
|
|
42
|
+
errors: {
|
|
43
|
+
BatchError: spexLib.errors.BatchError,
|
|
44
|
+
PageError: spexLib.errors.PageError,
|
|
45
|
+
SequenceError: spexLib.errors.SequenceError
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
interface IQueryFileOptions {
|
|
39
50
|
debug?: boolean
|
|
40
51
|
minify?: boolean | 'after'
|
|
@@ -309,7 +320,7 @@ declare namespace pgPromise {
|
|
|
309
320
|
readonly QueryFile: typeof QueryFile
|
|
310
321
|
readonly queryResult: typeof queryResult
|
|
311
322
|
readonly minify: typeof pgMinify
|
|
312
|
-
readonly spex:
|
|
323
|
+
readonly spex: ISpex
|
|
313
324
|
readonly errors: typeof errors
|
|
314
325
|
readonly utils: IUtils
|
|
315
326
|
readonly txMode: typeof txMode
|
|
@@ -322,7 +333,7 @@ declare namespace pgPromise {
|
|
|
322
333
|
|
|
323
334
|
// Additional methods available inside tasks + transactions;
|
|
324
335
|
// API: https://vitaly-t.github.io/pg-promise/Task.html
|
|
325
|
-
interface ITask<Ext> extends IBaseProtocol<Ext>,
|
|
336
|
+
interface ITask<Ext> extends IBaseProtocol<Ext>, ISpex {
|
|
326
337
|
readonly ctx: ITaskContext
|
|
327
338
|
}
|
|
328
339
|
|
|
@@ -428,7 +439,7 @@ declare namespace pgPromise {
|
|
|
428
439
|
|
|
429
440
|
// Database object in connected state;
|
|
430
441
|
// API: https://vitaly-t.github.io/pg-promise/Database.html#connect
|
|
431
|
-
interface IConnected<Ext, C extends pg.IClient> extends IBaseProtocol<Ext>,
|
|
442
|
+
interface IConnected<Ext, C extends pg.IClient> extends IBaseProtocol<Ext>, ISpex {
|
|
432
443
|
readonly client: C
|
|
433
444
|
|
|
434
445
|
// Note that for normal connections (working with the pool), method `done` accepts `kill`
|