pg-promise 10.14.0 → 10.14.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/package.json +2 -2
- package/typescript/pg-promise.d.ts +26 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-promise",
|
|
3
|
-
"version": "10.14.
|
|
3
|
+
"version": "10.14.1",
|
|
4
4
|
"description": "PostgreSQL interface for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "typescript/pg-promise.d.ts",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"JSONStream": "1.3.5",
|
|
56
56
|
"pg-query-stream": "4.2.4",
|
|
57
57
|
"tslint": "6.1.3",
|
|
58
|
-
"typescript": "4.
|
|
58
|
+
"typescript": "4.9.3"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -21,6 +21,26 @@ import * as pg from './pg-subset';
|
|
|
21
21
|
import * as pgMinify from 'pg-minify';
|
|
22
22
|
import * as spexLib from 'spex';
|
|
23
23
|
|
|
24
|
+
// internal namespace for "txMode" property:
|
|
25
|
+
declare namespace _txMode {
|
|
26
|
+
// Transaction Isolation Level;
|
|
27
|
+
// API: http://vitaly-t.github.io/pg-promise/txMode.html#.isolationLevel
|
|
28
|
+
enum isolationLevel {
|
|
29
|
+
none = 0,
|
|
30
|
+
serializable = 1,
|
|
31
|
+
repeatableRead = 2,
|
|
32
|
+
readCommitted = 3
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// TransactionMode class;
|
|
36
|
+
// API: http://vitaly-t.github.io/pg-promise/txMode.TransactionMode.html
|
|
37
|
+
class TransactionMode {
|
|
38
|
+
constructor(options?: { tiLevel?: isolationLevel, readOnly?: boolean, deferrable?: boolean })
|
|
39
|
+
|
|
40
|
+
begin(cap?: boolean): string
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
// Main protocol of the library;
|
|
25
45
|
// API: http://vitaly-t.github.io/pg-promise/module-pg-promise.html
|
|
26
46
|
declare namespace pgPromise {
|
|
@@ -269,7 +289,7 @@ declare namespace pgPromise {
|
|
|
269
289
|
constructor(api: IPromiseConfig)
|
|
270
290
|
}
|
|
271
291
|
|
|
272
|
-
const txMode:
|
|
292
|
+
const txMode: typeof _txMode;
|
|
273
293
|
const utils: IUtils;
|
|
274
294
|
const as: IFormatting;
|
|
275
295
|
|
|
@@ -311,7 +331,7 @@ declare namespace pgPromise {
|
|
|
311
331
|
readonly spex: spexLib.ISpex
|
|
312
332
|
readonly errors: typeof errors
|
|
313
333
|
readonly utils: IUtils
|
|
314
|
-
readonly txMode:
|
|
334
|
+
readonly txMode: typeof txMode
|
|
315
335
|
readonly helpers: IHelpers
|
|
316
336
|
readonly as: IFormatting
|
|
317
337
|
readonly pg: typeof pg
|
|
@@ -353,7 +373,7 @@ declare namespace pgPromise {
|
|
|
353
373
|
any<T = any>(query: QueryParam, values?: any): XPromise<T[]>
|
|
354
374
|
|
|
355
375
|
// API: http://vitaly-t.github.io/pg-promise/Database.html#result
|
|
356
|
-
result<T = IResultExt
|
|
376
|
+
result<T, R = IResultExt<T>>(query: QueryParam, values?: any, cb?: (value: IResultExt<T>) => R, thisArg?: any): XPromise<R>
|
|
357
377
|
|
|
358
378
|
// API: http://vitaly-t.github.io/pg-promise/Database.html#multiResult
|
|
359
379
|
multiResult(query: QueryParam, values?: any): XPromise<pg.IResult[]>
|
|
@@ -398,7 +418,7 @@ declare namespace pgPromise {
|
|
|
398
418
|
|
|
399
419
|
tx<T = any>(tag: string | number, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
400
420
|
|
|
401
|
-
tx<T = any>(options: { tag?: any, mode?: TransactionMode | null }, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
421
|
+
tx<T = any>(options: { tag?: any, mode?: _txMode.TransactionMode | null }, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
402
422
|
|
|
403
423
|
// Conditional Transactions;
|
|
404
424
|
// API: http://vitaly-t.github.io/pg-promise/Database.html#txIf
|
|
@@ -406,7 +426,7 @@ declare namespace pgPromise {
|
|
|
406
426
|
|
|
407
427
|
txIf<T = any>(tag: string | number, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
408
428
|
|
|
409
|
-
txIf<T = any>(options: { tag?: any, mode?: TransactionMode | null, reusable?: boolean | ((t: ITask<Ext> & Ext) => boolean), cnd?: boolean | ((t: ITask<Ext> & Ext) => boolean) }, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
429
|
+
txIf<T = any>(options: { tag?: any, mode?: _txMode.TransactionMode | null, reusable?: boolean | ((t: ITask<Ext> & Ext) => boolean), cnd?: boolean | ((t: ITask<Ext> & Ext) => boolean) }, cb: (t: ITask<Ext> & Ext) => T | XPromise<T>): XPromise<T>
|
|
410
430
|
}
|
|
411
431
|
|
|
412
432
|
// Database object in connected state;
|
|
@@ -546,23 +566,6 @@ declare namespace pgPromise {
|
|
|
546
566
|
}
|
|
547
567
|
}
|
|
548
568
|
|
|
549
|
-
// Transaction Isolation Level;
|
|
550
|
-
// API: http://vitaly-t.github.io/pg-promise/txMode.html#.isolationLevel
|
|
551
|
-
enum isolationLevel {
|
|
552
|
-
none = 0,
|
|
553
|
-
serializable = 1,
|
|
554
|
-
repeatableRead = 2,
|
|
555
|
-
readCommitted = 3
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
// TransactionMode class;
|
|
559
|
-
// API: http://vitaly-t.github.io/pg-promise/txMode.TransactionMode.html
|
|
560
|
-
class TransactionMode {
|
|
561
|
-
constructor(options?: { tiLevel?: isolationLevel, readOnly?: boolean, deferrable?: boolean })
|
|
562
|
-
|
|
563
|
-
begin(cap?: boolean): string
|
|
564
|
-
}
|
|
565
|
-
|
|
566
569
|
// Library's Initialization Options
|
|
567
570
|
// API: http://vitaly-t.github.io/pg-promise/module-pg-promise.html
|
|
568
571
|
interface IInitOptions<Ext = {}, C extends pg.IClient = pg.IClient> {
|
|
@@ -641,15 +644,8 @@ declare namespace pgPromise {
|
|
|
641
644
|
value(value: any | (() => any)): string
|
|
642
645
|
}
|
|
643
646
|
|
|
644
|
-
// Transaction Mode namespace;
|
|
645
|
-
// API: http://vitaly-t.github.io/pg-promise/txMode.html
|
|
646
|
-
interface ITXMode {
|
|
647
|
-
isolationLevel: typeof isolationLevel
|
|
648
|
-
TransactionMode: typeof TransactionMode
|
|
649
|
-
}
|
|
650
|
-
|
|
651
647
|
interface ITaskArguments<T> extends IArguments {
|
|
652
|
-
options: { tag?: any, cnd?: any, mode?: TransactionMode | null } & T
|
|
648
|
+
options: { tag?: any, cnd?: any, mode?: _txMode.TransactionMode | null } & T
|
|
653
649
|
|
|
654
650
|
cb(): any
|
|
655
651
|
}
|