pg-promise 12.0.0 → 12.1.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/lib/task.js CHANGED
@@ -116,7 +116,6 @@ function Task(ctx, tag, isTX, config) {
116
116
  };
117
117
 
118
118
  /**
119
- * @deprecated
120
119
  * Consider using <b>async/await</b> syntax instead, or if you must have
121
120
  * pre-generated promises, then $[Promise.allSettled].
122
121
  *
@@ -124,7 +123,9 @@ function Task(ctx, tag, isTX, config) {
124
123
  * @description
125
124
  * Settles a predefined array of mixed values by redirecting to method $[spex.batch].
126
125
  *
127
- * For complete method documentation see $[spex.batch].
126
+ * **NOTE:**
127
+ * Consider using `async/await` syntax instead, or if you must have
128
+ * pre-generated promises, then $[Promise.allSettled].
128
129
  *
129
130
  * @param {array} values
130
131
  * @param {Object} [options]
@@ -332,7 +333,7 @@ module.exports = config => {
332
333
  // we keep 'npm.query' initialization here, even though it is always
333
334
  // pre-initialized by the 'database' module, for integrity purpose.
334
335
  npmLocal.query = npmLocal.query || npm.query();
335
- npmLocal.spex = npmLocal.spex || npm.spex(Promise);
336
+ npmLocal.spex = npmLocal.spex || npm.spex;
336
337
 
337
338
  return {
338
339
  Task, execute, callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-promise",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "PostgreSQL interface for Node.js",
5
5
  "main": "lib/index.js",
6
6
  "typings": "typescript/pg-promise.d.ts",
@@ -44,7 +44,7 @@
44
44
  "assert-options": "0.8.3",
45
45
  "pg": "8.16.3",
46
46
  "pg-minify": "1.8.0",
47
- "spex": "3.4.1"
47
+ "spex": "4.0.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "pg-query-stream": "4.10.3"
@@ -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: spexLib.ISpex
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>, spexLib.ISpexBase {
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>, spexLib.ISpexBase {
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`