@event-driven-io/dumbo 0.13.0-beta.4 → 0.13.0-beta.41
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/dist/cloudflare.cjs +397 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +99 -0
- package/dist/cloudflare.d.ts +99 -0
- package/dist/cloudflare.js +361 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/core-BMeDuqBQ.js +2265 -0
- package/dist/core-BMeDuqBQ.js.map +1 -0
- package/dist/core-BPNgo5b6.js +379 -0
- package/dist/core-BPNgo5b6.js.map +1 -0
- package/dist/core-CIVu4cNp.cjs +588 -0
- package/dist/core-CIVu4cNp.cjs.map +1 -0
- package/dist/core-D5W_5J8k.cjs +3246 -0
- package/dist/core-D5W_5J8k.cjs.map +1 -0
- package/dist/core-DqUjje4u.cjs +450 -0
- package/dist/core-DqUjje4u.cjs.map +1 -0
- package/dist/core-gu5fi784.js +451 -0
- package/dist/core-gu5fi784.js.map +1 -0
- package/dist/{index-C2z_XBn6.d.ts → index-B-q2er0S.d.cts} +122 -75
- package/dist/{index-C0h0c380.d.cts → index-B5qbt5nP.d.ts} +122 -75
- package/dist/index-BJJAkyuJ.d.ts +68 -0
- package/dist/index-CRbkvVjT.d.ts +1587 -0
- package/dist/index-Cmdlb0KP.d.cts +1587 -0
- package/dist/index-D7qxqMf9.d.cts +67 -0
- package/dist/index-DtRCGhFP.d.cts +68 -0
- package/dist/index-m5LDyNNF.d.ts +67 -0
- package/dist/index.cjs +219 -270
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -127
- package/dist/index.d.ts +3 -127
- package/dist/index.js +56 -269
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +373 -659
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +140 -153
- package/dist/pg.d.ts +140 -153
- package/dist/pg.js +326 -658
- package/dist/pg.js.map +1 -1
- package/dist/postgreSQLMetadata-Khf1e9CT.js +65 -0
- package/dist/postgreSQLMetadata-Khf1e9CT.js.map +1 -0
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs +118 -0
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs.map +1 -0
- package/dist/postgresql.cjs +25 -0
- package/dist/postgresql.d.cts +3 -0
- package/dist/postgresql.d.ts +3 -0
- package/dist/postgresql.js +4 -0
- package/dist/sqlite.cjs +30 -0
- package/dist/sqlite.d.cts +3 -0
- package/dist/sqlite.d.ts +3 -0
- package/dist/sqlite.js +4 -0
- package/dist/sqlite3.cjs +437 -273
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +92 -70
- package/dist/sqlite3.d.ts +92 -70
- package/dist/sqlite3.js +402 -272
- package/dist/sqlite3.js.map +1 -1
- package/dist/sqliteMetadata-CpmoZxqb.cjs +46 -0
- package/dist/sqliteMetadata-CpmoZxqb.cjs.map +1 -0
- package/dist/sqliteMetadata-viYmVwA5.js +29 -0
- package/dist/sqliteMetadata-viYmVwA5.js.map +1 -0
- package/package.json +60 -37
- package/dist/chunk-32AL3EAS.cjs +0 -47
- package/dist/chunk-32AL3EAS.cjs.map +0 -1
- package/dist/chunk-6IHCIJ7S.js +0 -47
- package/dist/chunk-6IHCIJ7S.js.map +0 -1
- package/dist/chunk-IYEHOE4S.cjs +0 -405
- package/dist/chunk-IYEHOE4S.cjs.map +0 -1
- package/dist/chunk-N7RWT46K.js +0 -2011
- package/dist/chunk-N7RWT46K.js.map +0 -1
- package/dist/chunk-OJ34O3Q2.cjs +0 -2011
- package/dist/chunk-OJ34O3Q2.cjs.map +0 -1
- package/dist/chunk-XVV3OOQX.js +0 -405
- package/dist/chunk-XVV3OOQX.js.map +0 -1
- package/dist/columnProcessors-BX-sH7ah.d.cts +0 -8
- package/dist/columnProcessors-DMPpTPqM.d.ts +0 -8
- package/dist/connectionString-B1wm0TFc.d.cts +0 -1271
- package/dist/connectionString-B1wm0TFc.d.ts +0 -1271
- package/dist/d1.cjs +0 -277
- package/dist/d1.cjs.map +0 -1
- package/dist/d1.d.cts +0 -72
- package/dist/d1.d.ts +0 -72
- package/dist/d1.js +0 -277
- package/dist/d1.js.map +0 -1
package/dist/pg.cjs
CHANGED
|
@@ -1,688 +1,402 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunkOJ34O3Q2cjs = require('./chunk-OJ34O3Q2.cjs');
|
|
22
|
-
|
|
23
|
-
// src/storage/postgresql/core/connections/connectionString.ts
|
|
24
|
-
var _pgconnectionstring = require('pg-connection-string'); var _pgconnectionstring2 = _interopRequireDefault(_pgconnectionstring);
|
|
25
|
-
|
|
26
|
-
// src/storage/postgresql/core/locks/advisoryLocks.ts
|
|
27
|
-
var tryAcquireAdvisoryLock = async (execute, options) => {
|
|
28
|
-
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( _chunkOJ34O3Q2cjs.defaultDatabaseLockOptions.timeoutMs));
|
|
29
|
-
const advisoryLock2 = options.mode === "Permanent" ? "pg_advisory_lock" : "pg_advisory_xact_lock";
|
|
30
|
-
try {
|
|
31
|
-
await _chunkOJ34O3Q2cjs.single.call(void 0,
|
|
32
|
-
execute.query(
|
|
33
|
-
_chunkOJ34O3Q2cjs.SQL`SELECT ${_chunkOJ34O3Q2cjs.SQL.plain(advisoryLock2)}(${options.lockId}) AS locked`,
|
|
34
|
-
{ timeoutMs }
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
return true;
|
|
38
|
-
} catch (error) {
|
|
39
|
-
if (error instanceof Error && "code" in error && error.code === "57014")
|
|
40
|
-
return false;
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var releaseAdvisoryLock = async (execute, options) => {
|
|
45
|
-
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( _chunkOJ34O3Q2cjs.defaultDatabaseLockOptions.timeoutMs));
|
|
46
|
-
try {
|
|
47
|
-
await _chunkOJ34O3Q2cjs.single.call(void 0,
|
|
48
|
-
execute.query(
|
|
49
|
-
_chunkOJ34O3Q2cjs.SQL`SELECT pg_advisory_unlock(${options.lockId}) AS locked`,
|
|
50
|
-
{ timeoutMs }
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
return true;
|
|
54
|
-
} catch (error) {
|
|
55
|
-
if (error instanceof Error && "code" in error && error.code === "57014")
|
|
56
|
-
return false;
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var acquireAdvisoryLock = async (execute, options) => {
|
|
61
|
-
const lockAcquired = await tryAcquireAdvisoryLock(execute, options);
|
|
62
|
-
if (!lockAcquired) {
|
|
63
|
-
throw new Error(
|
|
64
|
-
"Failed to acquire advisory lock within the specified timeout. Migration aborted."
|
|
65
|
-
);
|
|
66
|
-
}
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core = require('./core-D5W_5J8k.cjs');
|
|
3
|
+
const require_postgreSQLMetadata = require('./postgreSQLMetadata-Ri_p5u6i.cjs');
|
|
4
|
+
const require_core$1 = require('./core-DqUjje4u.cjs');
|
|
5
|
+
let pg = require("pg");
|
|
6
|
+
pg = require_core.__toESM(pg, 1);
|
|
7
|
+
|
|
8
|
+
//#region src/storage/postgresql/pg/execute/execute.ts
|
|
9
|
+
const isPgNativePool = (poolOrClient) => {
|
|
10
|
+
return poolOrClient instanceof pg.default.Pool;
|
|
67
11
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (options.mode === "Permanent")
|
|
78
|
-
await releaseAdvisoryLock(execute, options);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
12
|
+
const isPgClient = (poolOrClient) => poolOrClient instanceof pg.default.Client;
|
|
13
|
+
const isPgPoolClient = (poolOrClient) => "release" in poolOrClient && typeof poolOrClient.release === "function";
|
|
14
|
+
const pgExecute = async (poolOrClient, handle) => {
|
|
15
|
+
const client = isPgNativePool(poolOrClient) ? await poolOrClient.connect() : poolOrClient;
|
|
16
|
+
try {
|
|
17
|
+
return await handle(client);
|
|
18
|
+
} finally {
|
|
19
|
+
if (isPgNativePool(poolOrClient) && isPgPoolClient(client)) client.release();
|
|
20
|
+
}
|
|
81
21
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
await acquireAdvisoryLock(execute, {
|
|
94
|
-
...options,
|
|
95
|
-
..._nullishCoalesce(acquireOptions, () => ( {}))
|
|
96
|
-
});
|
|
97
|
-
try {
|
|
98
|
-
return await handle();
|
|
99
|
-
} finally {
|
|
100
|
-
await releaseAdvisoryLock(execute, options);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
22
|
+
const pgSQLExecutor = ({ serializer }) => ({
|
|
23
|
+
driverType: PgDriverType,
|
|
24
|
+
query: async (client, sql, options) => {
|
|
25
|
+
return (await batchQuery(client, [sql], serializer, options))[0];
|
|
26
|
+
},
|
|
27
|
+
batchQuery: (client, sqls, options) => batchQuery(client, sqls, serializer, options),
|
|
28
|
+
command: async (client, sql, options) => {
|
|
29
|
+
return (await batchCommand(client, [sql], serializer, options))[0];
|
|
30
|
+
},
|
|
31
|
+
batchCommand: (client, sqls, options) => batchCommand(client, sqls, serializer, options),
|
|
32
|
+
formatter: require_core$1.pgFormatter
|
|
103
33
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
case "SQL_COLUMN_JSONB":
|
|
159
|
-
columnSQL = "JSONB";
|
|
160
|
-
break;
|
|
161
|
-
case "SQL_COLUMN_BIGSERIAL":
|
|
162
|
-
columnSQL = "BIGSERIAL";
|
|
163
|
-
break;
|
|
164
|
-
case "SQL_COLUMN_TIMESTAMP":
|
|
165
|
-
columnSQL = "TIMESTAMP";
|
|
166
|
-
break;
|
|
167
|
-
case "SQL_COLUMN_TIMESTAMPTZ":
|
|
168
|
-
columnSQL = "TIMESTAMPTZ";
|
|
169
|
-
break;
|
|
170
|
-
case "SQL_COLUMN_VARCHAR":
|
|
171
|
-
columnSQL = `VARCHAR ${Number.isNaN(token.length) ? "" : `(${token.length})`}`;
|
|
172
|
-
break;
|
|
173
|
-
default: {
|
|
174
|
-
const exhaustiveCheck = sqlTokenType;
|
|
175
|
-
throw new Error(`Unknown column type: ${exhaustiveCheck}`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
builder.addSQL(columnSQL);
|
|
179
|
-
};
|
|
180
|
-
var postgreSQLColumnProcessors = _chunkOJ34O3Q2cjs.mapDefaultSQLColumnProcessors.call(void 0, mapColumnType);
|
|
181
|
-
|
|
182
|
-
// src/storage/postgresql/core/sql/formatter/reserved.ts
|
|
183
|
-
var reservedMap = {
|
|
184
|
-
AES128: true,
|
|
185
|
-
AES256: true,
|
|
186
|
-
ALL: true,
|
|
187
|
-
ALLOWOVERWRITE: true,
|
|
188
|
-
ANALYSE: true,
|
|
189
|
-
ANALYZE: true,
|
|
190
|
-
AND: true,
|
|
191
|
-
ANY: true,
|
|
192
|
-
ARRAY: true,
|
|
193
|
-
AS: true,
|
|
194
|
-
ASC: true,
|
|
195
|
-
AUTHORIZATION: true,
|
|
196
|
-
BACKUP: true,
|
|
197
|
-
BETWEEN: true,
|
|
198
|
-
BINARY: true,
|
|
199
|
-
BLANKSASNULL: true,
|
|
200
|
-
BOTH: true,
|
|
201
|
-
BYTEDICT: true,
|
|
202
|
-
CASE: true,
|
|
203
|
-
CAST: true,
|
|
204
|
-
CHECK: true,
|
|
205
|
-
COLLATE: true,
|
|
206
|
-
COLUMN: true,
|
|
207
|
-
CONSTRAINT: true,
|
|
208
|
-
CREATE: true,
|
|
209
|
-
CREDENTIALS: true,
|
|
210
|
-
CROSS: true,
|
|
211
|
-
CURRENT_DATE: true,
|
|
212
|
-
CURRENT_TIME: true,
|
|
213
|
-
CURRENT_TIMESTAMP: true,
|
|
214
|
-
CURRENT_USER: true,
|
|
215
|
-
CURRENT_USER_ID: true,
|
|
216
|
-
DEFAULT: true,
|
|
217
|
-
DEFERRABLE: true,
|
|
218
|
-
DEFLATE: true,
|
|
219
|
-
DEFRAG: true,
|
|
220
|
-
DELTA: true,
|
|
221
|
-
DELTA32K: true,
|
|
222
|
-
DESC: true,
|
|
223
|
-
DISABLE: true,
|
|
224
|
-
DISTINCT: true,
|
|
225
|
-
DO: true,
|
|
226
|
-
ELSE: true,
|
|
227
|
-
EMPTYASNULL: true,
|
|
228
|
-
ENABLE: true,
|
|
229
|
-
ENCODE: true,
|
|
230
|
-
ENCRYPT: true,
|
|
231
|
-
ENCRYPTION: true,
|
|
232
|
-
END: true,
|
|
233
|
-
EXCEPT: true,
|
|
234
|
-
EXPLICIT: true,
|
|
235
|
-
FALSE: true,
|
|
236
|
-
FOR: true,
|
|
237
|
-
FOREIGN: true,
|
|
238
|
-
FREEZE: true,
|
|
239
|
-
FROM: true,
|
|
240
|
-
FULL: true,
|
|
241
|
-
GLOBALDICT256: true,
|
|
242
|
-
GLOBALDICT64K: true,
|
|
243
|
-
GRANT: true,
|
|
244
|
-
GROUP: true,
|
|
245
|
-
GZIP: true,
|
|
246
|
-
HAVING: true,
|
|
247
|
-
IDENTITY: true,
|
|
248
|
-
IGNORE: true,
|
|
249
|
-
ILIKE: true,
|
|
250
|
-
IN: true,
|
|
251
|
-
INITIALLY: true,
|
|
252
|
-
INNER: true,
|
|
253
|
-
INTERSECT: true,
|
|
254
|
-
INTO: true,
|
|
255
|
-
IS: true,
|
|
256
|
-
ISNULL: true,
|
|
257
|
-
JOIN: true,
|
|
258
|
-
LEADING: true,
|
|
259
|
-
LEFT: true,
|
|
260
|
-
LIKE: true,
|
|
261
|
-
LIMIT: true,
|
|
262
|
-
LOCALTIME: true,
|
|
263
|
-
LOCALTIMESTAMP: true,
|
|
264
|
-
LUN: true,
|
|
265
|
-
LUNS: true,
|
|
266
|
-
LZO: true,
|
|
267
|
-
LZOP: true,
|
|
268
|
-
MINUS: true,
|
|
269
|
-
MOSTLY13: true,
|
|
270
|
-
MOSTLY32: true,
|
|
271
|
-
MOSTLY8: true,
|
|
272
|
-
NATURAL: true,
|
|
273
|
-
NEW: true,
|
|
274
|
-
NOT: true,
|
|
275
|
-
NOTNULL: true,
|
|
276
|
-
NULL: true,
|
|
277
|
-
NULLS: true,
|
|
278
|
-
OFF: true,
|
|
279
|
-
OFFLINE: true,
|
|
280
|
-
OFFSET: true,
|
|
281
|
-
OLD: true,
|
|
282
|
-
ON: true,
|
|
283
|
-
ONLY: true,
|
|
284
|
-
OPEN: true,
|
|
285
|
-
OR: true,
|
|
286
|
-
ORDER: true,
|
|
287
|
-
OUTER: true,
|
|
288
|
-
OVERLAPS: true,
|
|
289
|
-
PARALLEL: true,
|
|
290
|
-
PARTITION: true,
|
|
291
|
-
PERCENT: true,
|
|
292
|
-
PLACING: true,
|
|
293
|
-
PRIMARY: true,
|
|
294
|
-
RAW: true,
|
|
295
|
-
READRATIO: true,
|
|
296
|
-
RECOVER: true,
|
|
297
|
-
REFERENCES: true,
|
|
298
|
-
REJECTLOG: true,
|
|
299
|
-
RESORT: true,
|
|
300
|
-
RESTORE: true,
|
|
301
|
-
RIGHT: true,
|
|
302
|
-
SELECT: true,
|
|
303
|
-
SESSION_USER: true,
|
|
304
|
-
SIMILAR: true,
|
|
305
|
-
SOME: true,
|
|
306
|
-
SYSDATE: true,
|
|
307
|
-
SYSTEM: true,
|
|
308
|
-
TABLE: true,
|
|
309
|
-
TAG: true,
|
|
310
|
-
TDES: true,
|
|
311
|
-
TEXT255: true,
|
|
312
|
-
TEXT32K: true,
|
|
313
|
-
THEN: true,
|
|
314
|
-
TO: true,
|
|
315
|
-
TOP: true,
|
|
316
|
-
TRAILING: true,
|
|
317
|
-
TRUE: true,
|
|
318
|
-
TRUNCATECOLUMNS: true,
|
|
319
|
-
UNION: true,
|
|
320
|
-
UNIQUE: true,
|
|
321
|
-
USER: true,
|
|
322
|
-
USING: true,
|
|
323
|
-
VERBOSE: true,
|
|
324
|
-
WALLET: true,
|
|
325
|
-
WHEN: true,
|
|
326
|
-
WHERE: true,
|
|
327
|
-
WITH: true,
|
|
328
|
-
WITHOUT: true
|
|
329
|
-
};
|
|
330
|
-
var reserved_default = reservedMap;
|
|
331
|
-
|
|
332
|
-
// src/storage/postgresql/core/sql/formatter/index.ts
|
|
333
|
-
var postgreSQLProcessorsRegistry = _chunkOJ34O3Q2cjs.SQLProcessorsRegistry.call(void 0, {
|
|
334
|
-
from: _chunkOJ34O3Q2cjs.defaultProcessorsRegistry
|
|
335
|
-
}).register(postgreSQLColumnProcessors);
|
|
336
|
-
var pgFormatter = _chunkOJ34O3Q2cjs.SQLFormatter.call(void 0, {
|
|
337
|
-
processorsRegistry: postgreSQLProcessorsRegistry,
|
|
338
|
-
valueMapper: {
|
|
339
|
-
mapDate: (value) => value.toISOString().replace("T", " ").replace("Z", "+00"),
|
|
340
|
-
mapPlaceholder: (index) => `$${index + 1}`,
|
|
341
|
-
mapIdentifier: (value) => _chunkOJ34O3Q2cjs.mapSQLIdentifier.call(void 0, value, { reservedWords: reserved_default })
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
_chunkOJ34O3Q2cjs.registerFormatter.call(void 0, "PostgreSQL", pgFormatter);
|
|
345
|
-
|
|
346
|
-
// src/storage/postgresql/core/index.ts
|
|
347
|
-
var PostgreSQLDatabaseName = "PostgreSQL";
|
|
348
|
-
|
|
349
|
-
// src/storage/postgresql/pg/connections/connection.ts
|
|
350
|
-
var _pg = require('pg'); var _pg2 = _interopRequireDefault(_pg);
|
|
351
|
-
|
|
352
|
-
// src/storage/postgresql/pg/execute/execute.ts
|
|
353
|
-
|
|
354
|
-
var isNodePostgresNativePool = (poolOrClient) => {
|
|
355
|
-
return poolOrClient instanceof _pg2.default.Pool;
|
|
356
|
-
};
|
|
357
|
-
var isNodePostgresClient = (poolOrClient) => poolOrClient instanceof _pg2.default.Client;
|
|
358
|
-
var isNodePostgresPoolClient = (poolOrClient) => "release" in poolOrClient && typeof poolOrClient.release === "function";
|
|
359
|
-
var nodePostgresExecute = async (poolOrClient, handle) => {
|
|
360
|
-
const client = isNodePostgresNativePool(poolOrClient) ? await poolOrClient.connect() : poolOrClient;
|
|
361
|
-
try {
|
|
362
|
-
return await handle(client);
|
|
363
|
-
} finally {
|
|
364
|
-
if (isNodePostgresNativePool(poolOrClient) && isNodePostgresPoolClient(client))
|
|
365
|
-
client.release();
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
var nodePostgresSQLExecutor = () => ({
|
|
369
|
-
driverType: NodePostgresDriverType,
|
|
370
|
-
query: batch,
|
|
371
|
-
batchQuery: batch,
|
|
372
|
-
command: batch,
|
|
373
|
-
batchCommand: batch,
|
|
374
|
-
formatter: pgFormatter
|
|
375
|
-
});
|
|
376
|
-
async function batch(client, sqlOrSqls, options) {
|
|
377
|
-
const sqls = Array.isArray(sqlOrSqls) ? sqlOrSqls : [sqlOrSqls];
|
|
378
|
-
const results = Array(
|
|
379
|
-
sqls.length
|
|
380
|
-
);
|
|
381
|
-
if (_optionalChain([options, 'optionalAccess', _ => _.timeoutMs])) {
|
|
382
|
-
await client.query(`SET statement_timeout = ${_optionalChain([options, 'optionalAccess', _2 => _2.timeoutMs])}`);
|
|
383
|
-
}
|
|
384
|
-
for (let i = 0; i < sqls.length; i++) {
|
|
385
|
-
const { query, params } = pgFormatter.format(sqls[i]);
|
|
386
|
-
_chunkOJ34O3Q2cjs.tracer.info("db:sql:query", {
|
|
387
|
-
query,
|
|
388
|
-
params,
|
|
389
|
-
debugSQL: pgFormatter.describe(sqls[i])
|
|
390
|
-
});
|
|
391
|
-
const result = await client.query(query, params);
|
|
392
|
-
results[i] = { rowCount: result.rowCount, rows: result.rows };
|
|
393
|
-
}
|
|
394
|
-
return Array.isArray(sqlOrSqls) ? results : results[0];
|
|
34
|
+
async function batchQuery(client, sqls, serializer, options) {
|
|
35
|
+
const results = Array(sqls.length);
|
|
36
|
+
if (options?.timeoutMs) await client.query(`SET statement_timeout = ${options.timeoutMs}`);
|
|
37
|
+
for (let i = 0; i < sqls.length; i++) {
|
|
38
|
+
const { query, params } = require_core$1.pgFormatter.format(sqls[i], { serializer });
|
|
39
|
+
require_core.tracer.info("db:sql:query", {
|
|
40
|
+
query,
|
|
41
|
+
params,
|
|
42
|
+
debugSQL: require_core$1.pgFormatter.describe(sqls[i], { serializer })
|
|
43
|
+
});
|
|
44
|
+
try {
|
|
45
|
+
let result = params.length > 0 ? await client.query(query, params) : await client.query(query);
|
|
46
|
+
if (options?.mapping) result = {
|
|
47
|
+
...result,
|
|
48
|
+
rows: result.rows.map((row) => require_core.mapSQLQueryResult(row, options.mapping))
|
|
49
|
+
};
|
|
50
|
+
results[i] = {
|
|
51
|
+
rowCount: result.rowCount,
|
|
52
|
+
rows: result.rows
|
|
53
|
+
};
|
|
54
|
+
} catch (error) {
|
|
55
|
+
require_core.tracer.error("db:sql:batch_query:execute:error", { error });
|
|
56
|
+
throw require_core$1.mapPostgresError(error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
61
|
+
async function batchCommand(client, sqls, serializer, options) {
|
|
62
|
+
const results = Array(sqls.length);
|
|
63
|
+
if (options?.timeoutMs) await client.query(`SET statement_timeout = ${options.timeoutMs}`);
|
|
64
|
+
for (let i = 0; i < sqls.length; i++) {
|
|
65
|
+
const { query, params } = require_core$1.pgFormatter.format(sqls[i], { serializer });
|
|
66
|
+
require_core.tracer.info("db:sql:command", {
|
|
67
|
+
query,
|
|
68
|
+
params,
|
|
69
|
+
debugSQL: require_core$1.pgFormatter.describe(sqls[i], { serializer })
|
|
70
|
+
});
|
|
71
|
+
try {
|
|
72
|
+
let result = params.length > 0 ? await client.query(query, params) : await client.query(query);
|
|
73
|
+
if (options?.mapping) result = {
|
|
74
|
+
...result,
|
|
75
|
+
rows: result.rows.map((row) => require_core.mapSQLQueryResult(row, options.mapping))
|
|
76
|
+
};
|
|
77
|
+
results[i] = {
|
|
78
|
+
rowCount: result.rowCount,
|
|
79
|
+
rows: result.rows
|
|
80
|
+
};
|
|
81
|
+
if (options?.assertChanges && (results[i].rowCount ?? 0) === 0) throw new require_core.BatchCommandNoChangesError(i);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
require_core.tracer.error("db:sql:batch_command:execute:error", { error });
|
|
84
|
+
throw require_core$1.mapPostgresError(error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return results;
|
|
395
88
|
}
|
|
396
89
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/storage/postgresql/pg/connections/transaction.ts
|
|
92
|
+
const pgTransaction = (connection, serializer) => (getClient, options) => ({
|
|
93
|
+
connection: connection(),
|
|
94
|
+
driverType: PgDriverType,
|
|
95
|
+
begin: async () => {
|
|
96
|
+
const client = await getClient;
|
|
97
|
+
const parts = ["BEGIN"];
|
|
98
|
+
if (options?.isolationLevel) parts.push(`ISOLATION LEVEL ${options.isolationLevel}`);
|
|
99
|
+
if (options?.readonly) parts.push("READ ONLY");
|
|
100
|
+
await client.query(parts.join(" "));
|
|
101
|
+
},
|
|
102
|
+
commit: async () => {
|
|
103
|
+
const client = await getClient;
|
|
104
|
+
try {
|
|
105
|
+
await client.query("COMMIT");
|
|
106
|
+
} finally {
|
|
107
|
+
if (options?.close) await options?.close(client);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
rollback: async (error) => {
|
|
111
|
+
const client = await getClient;
|
|
112
|
+
try {
|
|
113
|
+
await client.query("ROLLBACK");
|
|
114
|
+
} finally {
|
|
115
|
+
if (options?.close) await options?.close(client, error);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
execute: require_core.sqlExecutor(pgSQLExecutor({ serializer }), { connect: () => getClient }),
|
|
119
|
+
_transactionOptions: options ?? {}
|
|
424
120
|
});
|
|
425
121
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/storage/postgresql/pg/connections/connection.ts
|
|
124
|
+
const PgDriverType = "PostgreSQL:pg";
|
|
125
|
+
const pgClientConnection = (options) => {
|
|
126
|
+
const { connect, close } = options;
|
|
127
|
+
return require_core.createConnection({
|
|
128
|
+
driverType: PgDriverType,
|
|
129
|
+
connect,
|
|
130
|
+
close,
|
|
131
|
+
initTransaction: (connection) => pgTransaction(connection, options.serializer),
|
|
132
|
+
executor: pgSQLExecutor,
|
|
133
|
+
serializer: options.serializer
|
|
134
|
+
});
|
|
437
135
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
136
|
+
const pgPoolClientConnection = (options) => {
|
|
137
|
+
const { connect, close } = options;
|
|
138
|
+
return require_core.createConnection({
|
|
139
|
+
driverType: PgDriverType,
|
|
140
|
+
connect,
|
|
141
|
+
close,
|
|
142
|
+
initTransaction: (connection) => pgTransaction(connection, options.serializer),
|
|
143
|
+
executor: pgSQLExecutor,
|
|
144
|
+
serializer: options.serializer
|
|
145
|
+
});
|
|
447
146
|
};
|
|
448
|
-
function
|
|
449
|
-
|
|
147
|
+
function pgConnection(options) {
|
|
148
|
+
return options.type === "Client" ? pgClientConnection(options) : pgPoolClientConnection(options);
|
|
450
149
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
await client.end();
|
|
468
|
-
}
|
|
150
|
+
const checkConnection = async (connectionString) => {
|
|
151
|
+
const client = new pg.default.Client({ connectionString });
|
|
152
|
+
try {
|
|
153
|
+
await client.connect();
|
|
154
|
+
return { successful: true };
|
|
155
|
+
} catch (error) {
|
|
156
|
+
const code = error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
157
|
+
return {
|
|
158
|
+
successful: false,
|
|
159
|
+
errorType: code === "ECONNREFUSED" ? "ConnectionRefused" : code === "28P01" ? "Authentication" : "Unknown",
|
|
160
|
+
code,
|
|
161
|
+
error
|
|
162
|
+
};
|
|
163
|
+
} finally {
|
|
164
|
+
await client.end();
|
|
165
|
+
}
|
|
469
166
|
};
|
|
470
167
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
_pg2.default.types.setTypeParser(114, (val) => jsonSerializer.deserialize(val));
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/storage/postgresql/pg/serialization/index.ts
|
|
170
|
+
const setPgTypeParser = (client, options) => {
|
|
171
|
+
if (options?.parseBigInts === true) client.setTypeParser(20, (val) => BigInt(val));
|
|
172
|
+
if (options?.serializer) {
|
|
173
|
+
client.setTypeParser(3802, (val) => options.serializer.deserialize(val));
|
|
174
|
+
client.setTypeParser(114, (val) => options.serializer.deserialize(val));
|
|
175
|
+
}
|
|
480
176
|
};
|
|
481
177
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/storage/postgresql/pg/connections/pool.ts
|
|
180
|
+
const pgNativePool = (options) => {
|
|
181
|
+
const { connectionString, database } = options;
|
|
182
|
+
const pool = getPgPool({
|
|
183
|
+
connectionString,
|
|
184
|
+
database
|
|
185
|
+
});
|
|
186
|
+
const getConnection = () => pgConnection({
|
|
187
|
+
type: "PoolClient",
|
|
188
|
+
connect: async () => {
|
|
189
|
+
const client = await pool.connect();
|
|
190
|
+
setPgTypeParser(client, {
|
|
191
|
+
parseBigInts: true,
|
|
192
|
+
serializer: options.serializer
|
|
193
|
+
});
|
|
194
|
+
return client;
|
|
195
|
+
},
|
|
196
|
+
close: (client) => Promise.resolve(client.release()),
|
|
197
|
+
serializer: options.serializer
|
|
198
|
+
});
|
|
199
|
+
const open = () => Promise.resolve(getConnection());
|
|
200
|
+
const close = () => endPgPool({
|
|
201
|
+
connectionString,
|
|
202
|
+
database
|
|
203
|
+
});
|
|
204
|
+
return require_core.createConnectionPool({
|
|
205
|
+
driverType: PgDriverType,
|
|
206
|
+
connection: open,
|
|
207
|
+
close,
|
|
208
|
+
getConnection
|
|
209
|
+
});
|
|
499
210
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
211
|
+
const pgAmbientNativePool = (options) => {
|
|
212
|
+
const { pool } = options;
|
|
213
|
+
return require_core.createConnectionPool({
|
|
214
|
+
driverType: PgDriverType,
|
|
215
|
+
getConnection: () => pgConnection({
|
|
216
|
+
type: "PoolClient",
|
|
217
|
+
connect: () => pool.connect(),
|
|
218
|
+
close: (client) => Promise.resolve(client.release()),
|
|
219
|
+
serializer: options.serializer
|
|
220
|
+
})
|
|
221
|
+
});
|
|
510
222
|
};
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
223
|
+
const pgAmbientConnectionPool = (options) => {
|
|
224
|
+
const { connection } = options;
|
|
225
|
+
return require_core.createAmbientConnectionPool({
|
|
226
|
+
driverType: PgDriverType,
|
|
227
|
+
connection
|
|
228
|
+
});
|
|
517
229
|
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
230
|
+
const pgClientPool = (options) => {
|
|
231
|
+
const { connectionString, database } = options;
|
|
232
|
+
return require_core.createConnectionPool({
|
|
233
|
+
driverType: PgDriverType,
|
|
234
|
+
getConnection: () => {
|
|
235
|
+
const connect = async () => {
|
|
236
|
+
const client = new pg.default.Client({
|
|
237
|
+
connectionString,
|
|
238
|
+
database
|
|
239
|
+
});
|
|
240
|
+
setPgTypeParser(client, {
|
|
241
|
+
parseBigInts: true,
|
|
242
|
+
serializer: options.serializer
|
|
243
|
+
});
|
|
244
|
+
await client.connect();
|
|
245
|
+
return client;
|
|
246
|
+
};
|
|
247
|
+
return pgConnection({
|
|
248
|
+
type: "Client",
|
|
249
|
+
connect,
|
|
250
|
+
close: (client) => client.end(),
|
|
251
|
+
serializer: options.serializer
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
});
|
|
535
255
|
};
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
256
|
+
const pgAmbientClientPool = (options) => {
|
|
257
|
+
const { client } = options;
|
|
258
|
+
const getConnection = () => {
|
|
259
|
+
const connect = () => Promise.resolve(client);
|
|
260
|
+
return pgConnection({
|
|
261
|
+
type: "Client",
|
|
262
|
+
connect,
|
|
263
|
+
close: () => Promise.resolve(),
|
|
264
|
+
serializer: options.serializer
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
const open = () => Promise.resolve(getConnection());
|
|
268
|
+
const close = () => Promise.resolve();
|
|
269
|
+
return require_core.createConnectionPool({
|
|
270
|
+
driverType: PgDriverType,
|
|
271
|
+
connection: open,
|
|
272
|
+
close,
|
|
273
|
+
getConnection
|
|
274
|
+
});
|
|
554
275
|
};
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
276
|
+
function pgPool(options) {
|
|
277
|
+
const { connectionString, database } = options;
|
|
278
|
+
const serializer = options.serialization?.serializer ?? require_core.JSONSerializer;
|
|
279
|
+
if ("client" in options && options.client) return pgAmbientClientPool({
|
|
280
|
+
client: options.client,
|
|
281
|
+
serializer
|
|
282
|
+
});
|
|
283
|
+
if ("connection" in options && options.connection) return pgAmbientConnectionPool({ connection: options.connection });
|
|
284
|
+
if ("pooled" in options && options.pooled === false) return pgClientPool({
|
|
285
|
+
connectionString,
|
|
286
|
+
database,
|
|
287
|
+
serializer
|
|
288
|
+
});
|
|
289
|
+
if ("pool" in options && options.pool) return pgAmbientNativePool({
|
|
290
|
+
pool: options.pool,
|
|
291
|
+
serializer
|
|
292
|
+
});
|
|
293
|
+
return pgNativePool({
|
|
294
|
+
connectionString,
|
|
295
|
+
database,
|
|
296
|
+
serializer
|
|
297
|
+
});
|
|
572
298
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return _nullishCoalesce(pools.get(lookupKey), () => ( pools.set(lookupKey, new _pg2.default.Pool(poolOptions)).get(lookupKey)));
|
|
299
|
+
const pools = /* @__PURE__ */ new Map();
|
|
300
|
+
const usageCounter = /* @__PURE__ */ new Map();
|
|
301
|
+
const getPgPool = (connectionStringOrOptions) => {
|
|
302
|
+
const connectionString = typeof connectionStringOrOptions === "string" ? connectionStringOrOptions : connectionStringOrOptions.connectionString;
|
|
303
|
+
const poolOptions = typeof connectionStringOrOptions === "string" ? { connectionString } : connectionStringOrOptions;
|
|
304
|
+
const lookupKey = key(connectionString, poolOptions.database ?? (poolOptions.connectionString ? require_postgreSQLMetadata.parseDatabaseName(poolOptions.connectionString) ?? "postgres" : void 0));
|
|
305
|
+
updatePoolUsageCounter(lookupKey, 1);
|
|
306
|
+
return pools.get(lookupKey) ?? pools.set(lookupKey, new pg.default.Pool(poolOptions)).get(lookupKey);
|
|
582
307
|
};
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
database = _nullishCoalesce(database, () => ( getDatabaseNameOrDefault(connectionString)));
|
|
589
|
-
const lookupKey = key(connectionString, database);
|
|
590
|
-
const pool = pools.get(lookupKey);
|
|
591
|
-
if (pool && (updatePoolUsageCounter(lookupKey, -1) <= 0 || force === true)) {
|
|
592
|
-
await onEndPool(lookupKey, pool);
|
|
593
|
-
}
|
|
308
|
+
const endPgPool = async ({ connectionString, database, force }) => {
|
|
309
|
+
database = database ?? require_postgreSQLMetadata.parseDatabaseName(connectionString) ?? void 0;
|
|
310
|
+
const lookupKey = key(connectionString, database);
|
|
311
|
+
const pool = pools.get(lookupKey);
|
|
312
|
+
if (pool && (updatePoolUsageCounter(lookupKey, -1) <= 0 || force === true)) await onEndPool(lookupKey, pool);
|
|
594
313
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
314
|
+
const onEndPool = async (lookupKey, pool) => {
|
|
315
|
+
try {
|
|
316
|
+
await pool.end();
|
|
317
|
+
} catch (error) {
|
|
318
|
+
require_core.tracer.error("connection-closing-error", {
|
|
319
|
+
lookupKey,
|
|
320
|
+
error
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
pools.delete(lookupKey);
|
|
602
324
|
};
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
)
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
usageCounter.set(lookupKey, currentCounter + by);
|
|
611
|
-
return newCounter;
|
|
325
|
+
const endAllPgPools = () => Promise.all([...pools.entries()].map(([lookupKey, pool]) => onEndPool(lookupKey, pool)));
|
|
326
|
+
const key = (connectionString, database) => `${connectionString}|${database ?? "postgres"}`;
|
|
327
|
+
const updatePoolUsageCounter = (lookupKey, by) => {
|
|
328
|
+
const currentCounter = usageCounter.get(lookupKey) ?? 0;
|
|
329
|
+
const newCounter = currentCounter + by;
|
|
330
|
+
usageCounter.set(lookupKey, currentCounter + by);
|
|
331
|
+
return newCounter;
|
|
612
332
|
};
|
|
613
333
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/storage/postgresql/pg/index.ts
|
|
336
|
+
const tryParseConnectionString = (connectionString) => {
|
|
337
|
+
try {
|
|
338
|
+
return require_postgreSQLMetadata.PostgreSQLConnectionString(connectionString);
|
|
339
|
+
} catch {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
621
342
|
};
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
NodePostgresDriverType,
|
|
630
|
-
tryParseConnectionString
|
|
631
|
-
)
|
|
343
|
+
const pgDumboDriver = {
|
|
344
|
+
driverType: PgDriverType,
|
|
345
|
+
createPool: (options) => pgPool(options),
|
|
346
|
+
sqlFormatter: require_core$1.pgFormatter,
|
|
347
|
+
defaultMigratorOptions: require_core$1.DefaultPostgreSQLMigratorOptions,
|
|
348
|
+
canHandle: require_core.canHandleDriverWithConnectionString(PgDriverType, tryParseConnectionString),
|
|
349
|
+
databaseMetadata: require_postgreSQLMetadata.postgreSQLMetadata
|
|
632
350
|
};
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
NodePostgresDriverType,
|
|
636
|
-
pgDatabaseDriver
|
|
637
|
-
);
|
|
351
|
+
const usePgDumboDriver = () => {
|
|
352
|
+
require_core.dumboDatabaseDriverRegistry.register(PgDriverType, pgDumboDriver);
|
|
638
353
|
};
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
exports.AdvisoryLock = AdvisoryLock; exports.DefaultPostgreSQLMigratorOptions = DefaultPostgreSQLMigratorOptions; exports.NodePostgresDriverType = NodePostgresDriverType; exports.PostgreSQLConnectionString = PostgreSQLConnectionString; exports.PostgreSQLDatabaseName = PostgreSQLDatabaseName; exports.acquireAdvisoryLock = acquireAdvisoryLock; exports.advisoryLock = advisoryLock; exports.checkConnection = checkConnection; exports.connectionPool = connectionPool; exports.databaseDriver = pgDatabaseDriver; exports.defaultPostgreSQLConnectionString = defaultPostgreSQLConnectionString; exports.defaultPostgreSqlDatabase = defaultPostgreSqlDatabase; exports.endAllPools = endAllPools; exports.endPool = endPool; exports.functionExists = functionExists; exports.functionExistsSQL = functionExistsSQL; exports.getDatabaseNameOrDefault = getDatabaseNameOrDefault; exports.getPool = getPool; exports.isNodePostgresClient = isNodePostgresClient; exports.isNodePostgresNativePool = isNodePostgresNativePool; exports.isNodePostgresPoolClient = isNodePostgresPoolClient; exports.nodePostgresAmbientClientPool = nodePostgresAmbientClientPool; exports.nodePostgresAmbientConnectionPool = nodePostgresAmbientConnectionPool; exports.nodePostgresAmbientNativePool = nodePostgresAmbientNativePool; exports.nodePostgresClientConnection = nodePostgresClientConnection; exports.nodePostgresClientPool = nodePostgresClientPool; exports.nodePostgresConnection = nodePostgresConnection; exports.nodePostgresExecute = nodePostgresExecute; exports.nodePostgresNativePool = nodePostgresNativePool; exports.nodePostgresPool = nodePostgresPool; exports.nodePostgresPoolClientConnection = nodePostgresPoolClientConnection; exports.nodePostgresSQLExecutor = nodePostgresSQLExecutor; exports.nodePostgresTransaction = nodePostgresTransaction; exports.onEndPool = onEndPool; exports.pgDatabaseDriver = pgDatabaseDriver; exports.pgFormatter = pgFormatter; exports.postgreSQLColumnProcessors = postgreSQLColumnProcessors; exports.postgresPool = postgresPool; exports.releaseAdvisoryLock = releaseAdvisoryLock; exports.setNodePostgresTypeParser = setNodePostgresTypeParser; exports.tableExists = tableExists; exports.tableExistsSQL = tableExistsSQL; exports.tryAcquireAdvisoryLock = tryAcquireAdvisoryLock; exports.usePgDatabaseDriver = usePgDatabaseDriver;
|
|
354
|
+
usePgDumboDriver();
|
|
355
|
+
|
|
356
|
+
//#endregion
|
|
357
|
+
exports.AdvisoryLock = require_core$1.AdvisoryLock;
|
|
358
|
+
exports.DefaultPostgreSQLMigratorOptions = require_core$1.DefaultPostgreSQLMigratorOptions;
|
|
359
|
+
exports.PgDriverType = PgDriverType;
|
|
360
|
+
exports.PostgreSQLArrayProcessor = require_core$1.PostgreSQLArrayProcessor;
|
|
361
|
+
exports.PostgreSQLConnectionString = require_postgreSQLMetadata.PostgreSQLConnectionString;
|
|
362
|
+
exports.PostgreSQLDatabaseName = require_core$1.PostgreSQLDatabaseName;
|
|
363
|
+
exports.PostgreSQLExpandSQLInProcessor = require_core$1.PostgreSQLExpandSQLInProcessor;
|
|
364
|
+
exports.acquireAdvisoryLock = require_core$1.acquireAdvisoryLock;
|
|
365
|
+
exports.advisoryLock = require_core$1.advisoryLock;
|
|
366
|
+
exports.checkConnection = checkConnection;
|
|
367
|
+
exports.defaultPostgreSQLConnectionString = require_postgreSQLMetadata.defaultPostgreSQLConnectionString;
|
|
368
|
+
exports.defaultPostgreSqlDatabase = require_postgreSQLMetadata.defaultPostgreSqlDatabase;
|
|
369
|
+
exports.endAllPgPools = endAllPgPools;
|
|
370
|
+
exports.endPgPool = endPgPool;
|
|
371
|
+
exports.functionExists = require_postgreSQLMetadata.functionExists;
|
|
372
|
+
exports.functionExistsSQL = require_postgreSQLMetadata.functionExistsSQL;
|
|
373
|
+
exports.getPgPool = getPgPool;
|
|
374
|
+
exports.isPgClient = isPgClient;
|
|
375
|
+
exports.isPgNativePool = isPgNativePool;
|
|
376
|
+
exports.isPgPoolClient = isPgPoolClient;
|
|
377
|
+
exports.mapPostgresError = require_core$1.mapPostgresError;
|
|
378
|
+
exports.onEndPool = onEndPool;
|
|
379
|
+
exports.parseDatabaseName = require_postgreSQLMetadata.parseDatabaseName;
|
|
380
|
+
exports.pgAmbientClientPool = pgAmbientClientPool;
|
|
381
|
+
exports.pgAmbientConnectionPool = pgAmbientConnectionPool;
|
|
382
|
+
exports.pgAmbientNativePool = pgAmbientNativePool;
|
|
383
|
+
exports.pgClientConnection = pgClientConnection;
|
|
384
|
+
exports.pgClientPool = pgClientPool;
|
|
385
|
+
exports.pgConnection = pgConnection;
|
|
386
|
+
exports.pgDumboDriver = pgDumboDriver;
|
|
387
|
+
exports.pgExecute = pgExecute;
|
|
388
|
+
exports.pgFormatter = require_core$1.pgFormatter;
|
|
389
|
+
exports.pgNativePool = pgNativePool;
|
|
390
|
+
exports.pgPool = pgPool;
|
|
391
|
+
exports.pgPoolClientConnection = pgPoolClientConnection;
|
|
392
|
+
exports.pgSQLExecutor = pgSQLExecutor;
|
|
393
|
+
exports.pgTransaction = pgTransaction;
|
|
394
|
+
exports.postgreSQLColumnProcessors = require_core$1.postgreSQLColumnProcessors;
|
|
395
|
+
exports.postgreSQLMetadata = require_postgreSQLMetadata.postgreSQLMetadata;
|
|
396
|
+
exports.releaseAdvisoryLock = require_core$1.releaseAdvisoryLock;
|
|
397
|
+
exports.setPgTypeParser = setPgTypeParser;
|
|
398
|
+
exports.tableExists = require_postgreSQLMetadata.tableExists;
|
|
399
|
+
exports.tableExistsSQL = require_postgreSQLMetadata.tableExistsSQL;
|
|
400
|
+
exports.tryAcquireAdvisoryLock = require_core$1.tryAcquireAdvisoryLock;
|
|
401
|
+
exports.usePgDumboDriver = usePgDumboDriver;
|
|
688
402
|
//# sourceMappingURL=pg.cjs.map
|