@m2k-5f/pgtx 2.5.4 → 2.6.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 +65 -81
- package/dist/batch.d.ts +14 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/batch.js +34 -0
- package/dist/clauses/abstract.clause.d.ts.map +1 -1
- package/dist/connection.d.ts +10 -34
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +162 -215
- package/dist/error.d.ts +8 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/pool.d.ts +7 -12
- package/dist/pool.d.ts.map +1 -1
- package/dist/pool.js +23 -24
- package/dist/protocol/connection-request-writer.d.ts.map +1 -1
- package/dist/protocol/connection-request-writer.js +1 -0
- package/dist/protocol/connection-response-reader.d.ts +2 -4
- package/dist/protocol/connection-response-reader.d.ts.map +1 -1
- package/dist/protocol/connection-response-reader.js +1 -2
- package/dist/protocol/socket-authorization.d.ts +1 -10
- package/dist/protocol/socket-authorization.d.ts.map +1 -1
- package/dist/protocol/socket-authorization.js +1 -4
- package/dist/protocol/socket-connector.d.ts.map +1 -1
- package/dist/protocol/socket-connector.js +0 -2
- package/dist/query.d.ts +25 -27
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +36 -35
- package/dist/transaction.d.ts +3 -4
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +13 -11
- package/dist/types.d.ts +52 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/template-compiler.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/pool.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Connection } from "./connection";
|
|
2
|
-
import { Queue } from "./queue";
|
|
2
|
+
import { Queue, RingQueue } from "./queue";
|
|
3
3
|
import { Begin, Future, Ok } from "fluent-future";
|
|
4
|
-
import {
|
|
5
|
-
const ErrPoolClosed = new PostgresError('Pool closed');
|
|
4
|
+
import { ErrPoolClosed } from "./error";
|
|
6
5
|
/**
|
|
7
6
|
* The main entry point for Pgtx.
|
|
8
7
|
* Manages a connection pool and provides high-level API for queries and transactions.
|
|
@@ -39,17 +38,13 @@ const ErrPoolClosed = new PostgresError('Pool closed');
|
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
40
|
export class Pool {
|
|
42
|
-
|
|
43
|
-
if (this._isClosed)
|
|
44
|
-
throw new Error('Pool closed');
|
|
45
|
-
}
|
|
46
|
-
constructor(params) {
|
|
47
|
-
this._available = new Queue();
|
|
41
|
+
constructor(config) {
|
|
48
42
|
this._total = 0;
|
|
49
43
|
this._waiting = new Queue();
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
this.
|
|
44
|
+
this._isOpened = true;
|
|
45
|
+
const conf = { ...config, max: config.max || 20 };
|
|
46
|
+
this.config = conf;
|
|
47
|
+
this._available = new RingQueue(this.config.max);
|
|
53
48
|
}
|
|
54
49
|
/**
|
|
55
50
|
* Acquires a dedicated connection from the pool.
|
|
@@ -70,7 +65,8 @@ export class Pool {
|
|
|
70
65
|
* ```
|
|
71
66
|
*/
|
|
72
67
|
acquire() {
|
|
73
|
-
this.
|
|
68
|
+
if (!this._isOpened)
|
|
69
|
+
return Future.reject(ErrPoolClosed);
|
|
74
70
|
while (this._available.hasMore) {
|
|
75
71
|
const conn = this._available.shift;
|
|
76
72
|
if (conn.isOpened) {
|
|
@@ -78,9 +74,9 @@ export class Pool {
|
|
|
78
74
|
}
|
|
79
75
|
this._total--;
|
|
80
76
|
}
|
|
81
|
-
if (this._total < this.
|
|
77
|
+
if (this._total < this.config.max) {
|
|
82
78
|
this._total++;
|
|
83
|
-
return Connection.new(this.
|
|
79
|
+
return Connection.new(this.config)
|
|
84
80
|
.tapErr(() => this._total--);
|
|
85
81
|
}
|
|
86
82
|
const { future, reject, resolve } = Future.withResolvers();
|
|
@@ -130,7 +126,8 @@ export class Pool {
|
|
|
130
126
|
* ```
|
|
131
127
|
*/
|
|
132
128
|
release(conn) {
|
|
133
|
-
this.
|
|
129
|
+
if (!this._isOpened)
|
|
130
|
+
throw ErrPoolClosed;
|
|
134
131
|
if (!conn.isOpened) {
|
|
135
132
|
this._total--;
|
|
136
133
|
return;
|
|
@@ -160,7 +157,6 @@ export class Pool {
|
|
|
160
157
|
* ```
|
|
161
158
|
*/
|
|
162
159
|
begin(txCallback) {
|
|
163
|
-
this._checkClosed();
|
|
164
160
|
return Begin()
|
|
165
161
|
.andThen(() => this.acquire())
|
|
166
162
|
.andThen(conn => conn.begin(txCallback)
|
|
@@ -190,7 +186,8 @@ export class Pool {
|
|
|
190
186
|
* ```
|
|
191
187
|
*/
|
|
192
188
|
query(templates, ...args) {
|
|
193
|
-
this.
|
|
189
|
+
if (!this._isOpened)
|
|
190
|
+
return Future.reject(ErrPoolClosed);
|
|
194
191
|
while (this._available.hasMore) {
|
|
195
192
|
const conn = this._available.shift;
|
|
196
193
|
if (!conn.isOpened) {
|
|
@@ -232,7 +229,8 @@ export class Pool {
|
|
|
232
229
|
* }
|
|
233
230
|
*/
|
|
234
231
|
stream(templates, ...args) {
|
|
235
|
-
this.
|
|
232
|
+
if (!this._isOpened)
|
|
233
|
+
throw ErrPoolClosed;
|
|
236
234
|
while (this._available.hasMore) {
|
|
237
235
|
const conn = this._available.shift;
|
|
238
236
|
if (!conn.isOpened) {
|
|
@@ -270,7 +268,9 @@ export class Pool {
|
|
|
270
268
|
* ```
|
|
271
269
|
*/
|
|
272
270
|
notify(channelName, payload = "") {
|
|
273
|
-
return this.
|
|
271
|
+
return this.acquire()
|
|
272
|
+
.andThen(conn => conn.notify(channelName, payload)
|
|
273
|
+
.finally(() => this.release(conn)));
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* Asynchronously subscribes to pub/sub events on a specific PostgreSQL channel (LISTEN).
|
|
@@ -299,10 +299,8 @@ export class Pool {
|
|
|
299
299
|
listen(channel, callback) {
|
|
300
300
|
return this.acquire()
|
|
301
301
|
.andThen(conn => conn.listen(channel, callback)
|
|
302
|
-
.map(() =>
|
|
303
|
-
|
|
304
|
-
this.release(conn);
|
|
305
|
-
}));
|
|
302
|
+
.map(() => () => conn.unlisten(channel, callback)
|
|
303
|
+
.tap(() => this.release(conn))));
|
|
306
304
|
}
|
|
307
305
|
/**
|
|
308
306
|
* Number of available (idle) connections in the pool.
|
|
@@ -329,6 +327,7 @@ export class Pool {
|
|
|
329
327
|
* ```
|
|
330
328
|
*/
|
|
331
329
|
close() {
|
|
330
|
+
this._isOpened = false;
|
|
332
331
|
while (this._available.hasMore) {
|
|
333
332
|
this._available.shift.close();
|
|
334
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-request-writer.d.ts","sourceRoot":"","sources":["../../src/protocol/connection-request-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAA;AAGvD,qBAAa,uBAAuB;IAE5B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,wBAAwB;IAHpC,OAAO;IAOP,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM;IAK3B,OAAO,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"connection-request-writer.d.ts","sourceRoot":"","sources":["../../src/protocol/connection-request-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAA;AAGvD,qBAAa,uBAAuB;IAE5B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,wBAAwB;IAHpC,OAAO;IAOP,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM;IAK3B,OAAO,CAAC,cAAc;IAoBtB,YAAY,CAAC,MAAM,EAAE,MAAM;IAY3B,WAAW,CAAC,MAAM,EAAE,MAAM;IAS1B,UAAU,CAAC,MAAM,EAAE,MAAM;IAUzB,UAAU,CAAC,MAAM,EAAE,MAAM;IAUzB,SAAS,CAAC,IAAI,EAAE,MAAM;IAStB,YAAY,CAAC,WAAW,EAAE,WAAW;IAQrC,YAAY;IAMZ,UAAU;IAYV,QAAQ;IAKR,KAAK;CAIR;AAGD,qBAAa,uBAAuB;IAE5B,OAAO,CAAC,MAAM;IADlB,OAAO;IAIP,MAAM,CAAC,GAAG;IAMV,UAAU,CAAC,IAAI,EAAE,MAAM;IASvB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM;IAW1C,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,EAAE;IAUxC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;IAmBtF,UAAU,CAAC,IAAI,EAAE,MAAM;IAUvB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAY3C,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE;IAUlC,SAAS;IAOT,aAAa,CAAC,QAAQ,EAAE,MAAM;IAS9B,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM;IAW9D,iBAAiB,CAAC,kBAAkB,EAAE,MAAM;IAS5C,QAAQ;IAKR,KAAK;CAKR"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AuthenticationCode, ResponseType, TransactionStatus } from "./constants";
|
|
2
|
-
import { ColumnDescription } from "../types";
|
|
2
|
+
import { ChannelName, ColumnDescription } from "../types";
|
|
3
3
|
import { PostgresError } from "../error";
|
|
4
|
-
import { ChannelName } from "../connection";
|
|
5
4
|
export declare class ConnectionResponseBuffer {
|
|
6
5
|
private buffer;
|
|
7
6
|
private caret;
|
|
@@ -31,7 +30,6 @@ export declare class ConnectionResponseBuffer {
|
|
|
31
30
|
}
|
|
32
31
|
export declare class ConnectionResponseReader {
|
|
33
32
|
private buffer;
|
|
34
|
-
private currentPacketLength;
|
|
35
33
|
private constructor();
|
|
36
34
|
static from(buffer: Buffer): ConnectionResponseReader;
|
|
37
35
|
readType(): {
|
|
@@ -53,7 +51,7 @@ export declare class ConnectionResponseReader {
|
|
|
53
51
|
readSaslMechanisms(): string[];
|
|
54
52
|
readSaslMessage(length: number): string;
|
|
55
53
|
readRowDescription(): ColumnDescription[];
|
|
56
|
-
readDataRow(descriptions: ColumnDescription[], int8toBigint
|
|
54
|
+
readDataRow(descriptions: ColumnDescription[], int8toBigint: boolean): Record<string, any>;
|
|
57
55
|
readNotificationResponse(): {
|
|
58
56
|
name: ChannelName;
|
|
59
57
|
payload: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-response-reader.d.ts","sourceRoot":"","sources":["../../src/protocol/connection-response-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA6B,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"connection-response-reader.d.ts","sourceRoot":"","sources":["../../src/protocol/connection-response-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA6B,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC5G,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAOxC,qBAAa,wBAAwB;IAI7B,OAAO,CAAC,MAAM;IAHlB,OAAO,CAAC,KAAK,CAAI;IAEjB,OAAO;IAKP,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM;IAK1B,QAAQ,IAAI,MAAM;IAOlB,SAAS,IAAI,MAAM;IAOnB,SAAS,IAAI,MAAM;IAOnB,WAA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buffer = buffer;
|
|
134
|
-
this.currentPacketLength = 0;
|
|
135
134
|
}
|
|
136
135
|
static from(buffer) {
|
|
137
136
|
return new ConnectionResponseReader(ConnectionResponseBuffer.from(buffer));
|
|
@@ -236,7 +235,7 @@ export class ConnectionResponseReader {
|
|
|
236
235
|
}
|
|
237
236
|
return columns;
|
|
238
237
|
}
|
|
239
|
-
readDataRow(descriptions, int8toBigint
|
|
238
|
+
readDataRow(descriptions, int8toBigint) {
|
|
240
239
|
const fieldsCount = this.buffer.readInt16();
|
|
241
240
|
const row = {};
|
|
242
241
|
for (let i = 0; i < fieldsCount; i++) {
|
|
@@ -2,15 +2,6 @@ import { Socket } from "node:net";
|
|
|
2
2
|
import { ConnectionRequestWriter } from "./connection-request-writer";
|
|
3
3
|
import { PostgresError } from "../error";
|
|
4
4
|
import { Future } from "fluent-future";
|
|
5
|
-
|
|
6
|
-
host: string;
|
|
7
|
-
port: number;
|
|
8
|
-
user: string;
|
|
9
|
-
database: string;
|
|
10
|
-
password?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const ErrNonceMismatch: PostgresError;
|
|
13
|
-
export declare const ErrPasswordRequired: PostgresError;
|
|
14
|
-
export declare const ErrSocketFailedDuringAuth: PostgresError;
|
|
5
|
+
import { AuthorizationParams } from "../types";
|
|
15
6
|
export declare const createAuthorizedSocket: (writer: ConnectionRequestWriter, params: AuthorizationParams) => Future<Socket, PostgresError>;
|
|
16
7
|
//# sourceMappingURL=socket-authorization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-authorization.d.ts","sourceRoot":"","sources":["../../src/protocol/socket-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAKrE,OAAO,
|
|
1
|
+
{"version":3,"file":"socket-authorization.d.ts","sourceRoot":"","sources":["../../src/protocol/socket-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAKrE,OAAO,EAAoE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC1G,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAG9C,eAAO,MAAM,sBAAsB,GAAI,QAAQ,uBAAuB,EAAE,QAAQ,mBAAmB,kCAoHlG,CAAA"}
|
|
@@ -3,11 +3,8 @@ import { calculateScramAuth, generateNonce } from "../security/sasl";
|
|
|
3
3
|
import { SocketConnector } from "./socket-connector";
|
|
4
4
|
import { AuthenticationCodes, ResponseTypes } from "./constants";
|
|
5
5
|
import { encryptMd5 } from "../security/md5";
|
|
6
|
-
import {
|
|
6
|
+
import { ErrNonceMismatch, ErrPasswordRequired, ErrSocketFailedDuringAuth } from "../error";
|
|
7
7
|
import { Future } from "fluent-future";
|
|
8
|
-
export const ErrNonceMismatch = new PostgresError("Protocol violation: server nonce doesn't match client nonce");
|
|
9
|
-
export const ErrPasswordRequired = new PostgresError('The authorization method requires a password.');
|
|
10
|
-
export const ErrSocketFailedDuringAuth = new PostgresError("Socket failed during auth");
|
|
11
8
|
export const createAuthorizedSocket = (writer, params) => {
|
|
12
9
|
const { future, reject, resolve } = Future.withResolvers();
|
|
13
10
|
const nonce = generateNonce();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-connector.d.ts","sourceRoot":"","sources":["../../src/protocol/socket-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AAE/E,qBAAa,eAAe;IAKpB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IANpB,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,YAAY,CAAQ;gBAGhB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,KAAK,IAAI,EACvF,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IA8B5C,KAAK,CAAC,MAAM,EAAE,uBAAuB;
|
|
1
|
+
{"version":3,"file":"socket-connector.d.ts","sourceRoot":"","sources":["../../src/protocol/socket-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AAE/E,qBAAa,eAAe;IAKpB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IANpB,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,YAAY,CAAQ;gBAGhB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,KAAK,IAAI,EACvF,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IA8B5C,KAAK,CAAC,MAAM,EAAE,uBAAuB;IAMrC,YAAY;IAQZ,OAAO;IAMP,IAAI,WAAW,YAA6B;CAC/C"}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
import { Future } from "fluent-future";
|
|
2
|
-
import { QueryText, StatementName } from "./
|
|
3
|
-
import { ColumnDescription, ValueOF } from "./types";
|
|
2
|
+
import { ColumnDescription, QueryMeta, QueryText, StatementName } from "./types";
|
|
4
3
|
import { PostgresError } from "./error";
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export
|
|
13
|
-
export declare class Query<T> {
|
|
4
|
+
export declare abstract class Query {
|
|
5
|
+
statement: StatementName;
|
|
6
|
+
protected _timer?: NodeJS.Timeout;
|
|
7
|
+
constructor(statement: StatementName, timeout: number);
|
|
8
|
+
abstract reject(cause: PostgresError): void;
|
|
9
|
+
abstract resolve(...args: any[]): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class SimpleQuery<T> extends Query {
|
|
14
12
|
text: QueryText;
|
|
15
13
|
args: (string | null)[];
|
|
16
|
-
|
|
17
|
-
statementName: StatementName;
|
|
18
|
-
columns?: ColumnDescription[] | undefined;
|
|
14
|
+
columns: ColumnDescription[];
|
|
19
15
|
future: Future<T[], PostgresError>;
|
|
20
16
|
private _resolve;
|
|
21
17
|
private _reject;
|
|
22
18
|
private _rows;
|
|
23
|
-
|
|
24
|
-
constructor(text: QueryText, args: (string | null)[], state: State, statementName: StatementName, columns?: ColumnDescription[] | undefined);
|
|
25
|
-
startTimeout(timeout: number): void;
|
|
26
|
-
setState(state: State): void;
|
|
19
|
+
constructor(statement: StatementName, text: QueryText, args: (string | null)[], columns: ColumnDescription[], timeout: number);
|
|
27
20
|
push(value: T): void;
|
|
28
21
|
reject(cause: PostgresError): void;
|
|
29
22
|
resolve(): void;
|
|
30
23
|
}
|
|
31
|
-
export declare class
|
|
24
|
+
export declare class ParseQuery extends Query {
|
|
25
|
+
text: QueryText;
|
|
26
|
+
future: Future<QueryMeta, PostgresError>;
|
|
27
|
+
private _resolve;
|
|
28
|
+
private _reject;
|
|
29
|
+
constructor(statement: StatementName, text: QueryText, timeout: number);
|
|
30
|
+
reject(cause: PostgresError): void;
|
|
31
|
+
resolve(meta: QueryMeta): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class StreamQuery<T> extends Query {
|
|
32
34
|
text: QueryText;
|
|
33
35
|
args: (string | null)[];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columns?: ColumnDescription[] | undefined;
|
|
38
|
-
private _timer?;
|
|
39
|
-
constructor(text: QueryText, args: (string | null)[], state: State, statementName: StatementName, _controller: ReadableStreamDefaultController<T>, columns?: ColumnDescription[] | undefined);
|
|
40
|
-
setState(state: State): void;
|
|
41
|
-
startTimeout(timeout: number): void;
|
|
36
|
+
controller: ReadableStreamDefaultController<T>;
|
|
37
|
+
columns: ColumnDescription[];
|
|
38
|
+
constructor(statement: StatementName, text: QueryText, args: (string | null)[], controller: ReadableStreamDefaultController<T>, columns: ColumnDescription[], timeout: number);
|
|
42
39
|
push(value: T): void;
|
|
43
40
|
reject(cause: PostgresError): void;
|
|
44
41
|
resolve(): void;
|
|
45
42
|
}
|
|
43
|
+
export type PostgresQuery = SimpleQuery<any> | ParseQuery | StreamQuery<any>;
|
|
46
44
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AAGzD,8BAAsB,KAAK;IAIZ,SAAS,EAAE,aAAa;IAHnC,SAAS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S;IACf,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;IACvB,UAAU,EAAE,+BAA+B,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,iBAAiB,EAAE;gBAJnC,SAAS,EAAE,aAAa,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EACvB,UAAU,EAAE,+BAA+B,CAAC,CAAC,CAAC,EAC9C,OAAO,EAAE,iBAAiB,EAAE,EACnC,OAAO,EAAE,MAAM;IAMnB,IAAI,CAAC,KAAK,EAAE,CAAC;IAKb,MAAM,CAAC,KAAK,EAAE,aAAa;IAM3B,OAAO;CAIV;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA"}
|
package/dist/query.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Future } from "fluent-future";
|
|
2
|
-
import {
|
|
3
|
-
export const QueryState = {
|
|
4
|
-
Parsing: 0,
|
|
5
|
-
Describing: 1,
|
|
6
|
-
Executing: 2,
|
|
7
|
-
Completed: 3,
|
|
8
|
-
Failed: 4
|
|
9
|
-
};
|
|
2
|
+
import { ErrQueryTimeout } from "./error";
|
|
10
3
|
export class Query {
|
|
11
|
-
constructor(
|
|
4
|
+
constructor(statement, timeout) {
|
|
5
|
+
this.statement = statement;
|
|
6
|
+
this._timer = setTimeout(() => {
|
|
7
|
+
this.reject(ErrQueryTimeout);
|
|
8
|
+
}, timeout);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export class SimpleQuery extends Query {
|
|
12
|
+
constructor(statement, text, args, columns, timeout) {
|
|
13
|
+
super(statement, timeout);
|
|
12
14
|
this.text = text;
|
|
13
15
|
this.args = args;
|
|
14
|
-
this.state = state;
|
|
15
|
-
this.statementName = statementName;
|
|
16
16
|
this.columns = columns;
|
|
17
17
|
this._rows = [];
|
|
18
18
|
const { future, reject, resolve } = Future.withResolvers();
|
|
@@ -20,14 +20,6 @@ export class Query {
|
|
|
20
20
|
this._resolve = resolve;
|
|
21
21
|
this._reject = reject;
|
|
22
22
|
}
|
|
23
|
-
startTimeout(timeout) {
|
|
24
|
-
this._timer = setTimeout(() => {
|
|
25
|
-
this.reject(new PostgresError('Query timeout', '57014'));
|
|
26
|
-
}, timeout);
|
|
27
|
-
}
|
|
28
|
-
setState(state) {
|
|
29
|
-
this.state = state;
|
|
30
|
-
}
|
|
31
23
|
push(value) {
|
|
32
24
|
this._rows.push(value);
|
|
33
25
|
}
|
|
@@ -40,32 +32,41 @@ export class Query {
|
|
|
40
32
|
this._resolve(this._rows);
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
|
-
export class
|
|
44
|
-
constructor(
|
|
35
|
+
export class ParseQuery extends Query {
|
|
36
|
+
constructor(statement, text, timeout) {
|
|
37
|
+
super(statement, timeout);
|
|
45
38
|
this.text = text;
|
|
46
|
-
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.columns = columns;
|
|
39
|
+
const { future, reject, resolve } = Future.withResolvers();
|
|
40
|
+
this.future = future;
|
|
41
|
+
this._resolve = resolve;
|
|
42
|
+
this._reject = reject;
|
|
51
43
|
}
|
|
52
|
-
|
|
53
|
-
this.
|
|
44
|
+
reject(cause) {
|
|
45
|
+
clearTimeout(this._timer);
|
|
46
|
+
this._reject(cause);
|
|
54
47
|
}
|
|
55
|
-
|
|
56
|
-
this._timer
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
resolve(meta) {
|
|
49
|
+
clearTimeout(this._timer);
|
|
50
|
+
this._resolve(meta);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export class StreamQuery extends Query {
|
|
54
|
+
constructor(statement, text, args, controller, columns, timeout) {
|
|
55
|
+
super(statement, timeout);
|
|
56
|
+
this.text = text;
|
|
57
|
+
this.args = args;
|
|
58
|
+
this.controller = controller;
|
|
59
|
+
this.columns = columns;
|
|
59
60
|
}
|
|
60
61
|
push(value) {
|
|
61
|
-
this.
|
|
62
|
+
this.controller.enqueue(value);
|
|
62
63
|
}
|
|
63
64
|
reject(cause) {
|
|
64
65
|
clearTimeout(this._timer);
|
|
65
|
-
this.
|
|
66
|
+
this.controller.error(cause);
|
|
66
67
|
}
|
|
67
68
|
resolve() {
|
|
68
69
|
clearTimeout(this._timer);
|
|
69
|
-
this.
|
|
70
|
+
this.controller.close();
|
|
70
71
|
}
|
|
71
72
|
}
|
package/dist/transaction.d.ts
CHANGED
|
@@ -13,15 +13,14 @@ export declare class Transaction {
|
|
|
13
13
|
* Returns true if the transaction is still open (not committed or rolled back).
|
|
14
14
|
*/
|
|
15
15
|
get isActive(): boolean;
|
|
16
|
-
private checkActive;
|
|
17
16
|
/**
|
|
18
17
|
* Commits the current transaction.
|
|
19
18
|
*/
|
|
20
|
-
commit(): Future<
|
|
19
|
+
commit(): Future<void, PostgresError>;
|
|
21
20
|
/**
|
|
22
21
|
* Rolls back the current transaction.
|
|
23
22
|
*/
|
|
24
|
-
rollback(): Future<
|
|
23
|
+
rollback(): Future<void, PostgresError>;
|
|
25
24
|
/**
|
|
26
25
|
* Executes a query within the current transaction.
|
|
27
26
|
*/
|
|
@@ -36,6 +35,6 @@ export declare class Transaction {
|
|
|
36
35
|
* if (error) throw new Error() // Only this insert rolls back
|
|
37
36
|
* });
|
|
38
37
|
*/
|
|
39
|
-
savepoint<T>(name: string, callback: (tx: Transaction) => Promise<T>): Future<T,
|
|
38
|
+
savepoint<T>(name: string, callback: (tx: Transaction) => Promise<T>): Future<T, unknown>;
|
|
40
39
|
}
|
|
41
40
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAwB,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7D;;;GAGG;AACH,qBAAa,WAAW;IAIhB,QAAQ,CAAC,IAAI,EAAE,UAAU;IAH7B,OAAO,CAAC,UAAU,CAAiB;gBAGtB,IAAI,EAAE,UAAU;IAG7B;;OAEG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;OAEG;IACI,MAAM;IAQb;;OAEG;IACI,QAAQ;IAQf;;OAEG;IACI,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;IAM3F;;;;;;;;;OASG;IACI,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC;CAW9E"}
|
package/dist/transaction.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Begin, Future } from "fluent-future";
|
|
2
2
|
import { IdentifierClause } from "./clauses";
|
|
3
|
+
import { ErrTransactionClosed } from "./error";
|
|
3
4
|
/**
|
|
4
5
|
* Represents an active SQL transaction.
|
|
5
6
|
* All queries are executed on a single dedicated connection.
|
|
@@ -15,32 +16,32 @@ export class Transaction {
|
|
|
15
16
|
get isActive() {
|
|
16
17
|
return !this.isFinished;
|
|
17
18
|
}
|
|
18
|
-
checkActive() {
|
|
19
|
-
if (this.isFinished) {
|
|
20
|
-
throw new Error("Transaction is finished");
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
19
|
/**
|
|
24
20
|
* Commits the current transaction.
|
|
25
21
|
*/
|
|
26
22
|
commit() {
|
|
27
|
-
this.
|
|
23
|
+
if (this.isFinished)
|
|
24
|
+
return Future.reject(ErrTransactionClosed);
|
|
28
25
|
return this.conn.query `COMMIT`
|
|
29
|
-
.tap(() => this.isFinished = true)
|
|
26
|
+
.tap(() => this.isFinished = true)
|
|
27
|
+
.map(() => { });
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
32
30
|
* Rolls back the current transaction.
|
|
33
31
|
*/
|
|
34
32
|
rollback() {
|
|
35
|
-
this.
|
|
33
|
+
if (this.isFinished)
|
|
34
|
+
return Future.reject(ErrTransactionClosed);
|
|
36
35
|
return this.conn.query `ROLLBACK`
|
|
37
|
-
.tap(() => this.isFinished = true)
|
|
36
|
+
.tap(() => this.isFinished = true)
|
|
37
|
+
.map(() => { });
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Executes a query within the current transaction.
|
|
41
41
|
*/
|
|
42
42
|
query(strings, ...values) {
|
|
43
|
-
this.
|
|
43
|
+
if (this.isFinished)
|
|
44
|
+
return Future.reject(ErrTransactionClosed);
|
|
44
45
|
return this.conn.query(strings, ...values);
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
@@ -54,7 +55,8 @@ export class Transaction {
|
|
|
54
55
|
* });
|
|
55
56
|
*/
|
|
56
57
|
savepoint(name, callback) {
|
|
57
|
-
this.
|
|
58
|
+
if (this.isFinished)
|
|
59
|
+
return Future.reject(ErrTransactionClosed);
|
|
58
60
|
return Begin()
|
|
59
61
|
.andThen(() => this.conn.query `SAVEPOINT ${IdentifierClause.create(name)}`)
|
|
60
62
|
.andThen(() => Future.of(callback(this))
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Connection } from "./connection";
|
|
2
|
+
import { PostgresError } from "./error";
|
|
1
3
|
import { DataTypeOid } from "./protocol/constants";
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
execute: (...args: Tparams) => Promise<TResult[]>;
|
|
4
|
+
export type Branded<T, Brand> = T & {
|
|
5
|
+
__brand: Brand;
|
|
6
6
|
};
|
|
7
|
+
export type ValueOF<T extends Record<string, unknown>> = T[keyof T];
|
|
7
8
|
export type CompiledSqlQuery = {
|
|
8
9
|
text: string;
|
|
9
10
|
args: (string | null)[];
|
|
@@ -12,16 +13,56 @@ export type ClauseStrategyParams = {
|
|
|
12
13
|
text: string;
|
|
13
14
|
args: any[];
|
|
14
15
|
};
|
|
15
|
-
export type CompileSQLParams = {
|
|
16
|
-
templates: TemplateStringsArray;
|
|
17
|
-
args: any[];
|
|
18
|
-
};
|
|
19
16
|
export type ColumnDescription = {
|
|
20
17
|
name: string;
|
|
21
18
|
typeOID: DataTypeOid;
|
|
22
19
|
};
|
|
23
|
-
export type
|
|
24
|
-
|
|
20
|
+
export type AuthorizationParams = {
|
|
21
|
+
host: string;
|
|
22
|
+
port: number;
|
|
23
|
+
user: string;
|
|
24
|
+
database: string;
|
|
25
|
+
password?: string;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
type LogLevel = "none" | "error" | "notice" | "query";
|
|
28
|
+
export type ConnectionPartialConfig = {
|
|
29
|
+
user: string;
|
|
30
|
+
password?: string;
|
|
31
|
+
host: string;
|
|
32
|
+
port: number;
|
|
33
|
+
database: string;
|
|
34
|
+
logLevel?: LogLevel;
|
|
35
|
+
int8toBigint?: boolean;
|
|
36
|
+
queryTimeout?: number;
|
|
37
|
+
syncShedule?: "Tick" | "Immediate";
|
|
38
|
+
};
|
|
39
|
+
export type ConnectionConfig = {
|
|
40
|
+
user: string;
|
|
41
|
+
password?: string;
|
|
42
|
+
host: string;
|
|
43
|
+
port: number;
|
|
44
|
+
database: string;
|
|
45
|
+
logLevel: LogLevel;
|
|
46
|
+
int8toBigint: boolean;
|
|
47
|
+
queryTimeout: number;
|
|
48
|
+
syncShedule: "Tick" | "Immediate";
|
|
49
|
+
};
|
|
50
|
+
export type StatementName = Branded<string, 'StatementName'>;
|
|
51
|
+
export type QueryText = Branded<string, 'QueryText'>;
|
|
52
|
+
export type ChannelName = Branded<string, "ChannelName">;
|
|
53
|
+
export type QueryMeta = {
|
|
54
|
+
statement: StatementName;
|
|
55
|
+
columns: ColumnDescription[];
|
|
56
|
+
};
|
|
57
|
+
export type PoolPartialConfig = ConnectionPartialConfig & {
|
|
58
|
+
max?: number;
|
|
59
|
+
};
|
|
60
|
+
export type PoolConfig = ConnectionPartialConfig & {
|
|
61
|
+
max: number;
|
|
62
|
+
};
|
|
63
|
+
export type Waiter = {
|
|
64
|
+
resolve: (conn: Connection) => void;
|
|
65
|
+
reject: (err: PostgresError) => void;
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
27
68
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAA;CAAC,CAAA;AAEpD,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAC3B,CAAA;AAED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AAM,EAAE,eAAe,CAAC,CAAA;AAE5D,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAExD,MAAM,MAAM,SAAS,GAAG;IACpB,SAAS,EAAE,aAAa,CAAA;IACxB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC/B,CAAA;AAGD,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACtD,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,uBAAuB,GAAG;IAC/C,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAGD,MAAM,MAAM,MAAM,GAAG;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;IACnC,MAAM,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAA;CACvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-compiler.d.ts","sourceRoot":"","sources":["../../src/utils/template-compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"template-compiler.d.ts","sourceRoot":"","sources":["../../src/utils/template-compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIjE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS,SAAI,GAAG,gBAAgB,CAqCpH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m2k-5f/pgtx",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Blazing-fast PostgreSQL driver with pipeline support.",
|
|
6
6
|
"files": [
|
|
@@ -52,6 +52,6 @@
|
|
|
52
52
|
"typescript": "^5.9.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"fluent-future": "^1.
|
|
55
|
+
"fluent-future": "^1.5.0"
|
|
56
56
|
}
|
|
57
57
|
}
|