@event-driven-io/dumbo 0.13.0-beta.24 → 0.13.0-beta.26
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/{chunk-HXQYRDCR.cjs → chunk-56DF2K5J.cjs} +43 -43
- package/dist/{chunk-HXQYRDCR.cjs.map → chunk-56DF2K5J.cjs.map} +1 -1
- package/dist/{chunk-7RMJPFU5.cjs → chunk-LL7C5HYA.cjs} +6 -6
- package/dist/{chunk-7RMJPFU5.cjs.map → chunk-LL7C5HYA.cjs.map} +1 -1
- package/dist/{chunk-QUAG4MBP.js → chunk-MHY7CYDN.js} +95 -81
- package/dist/{chunk-QUAG4MBP.js.map → chunk-MHY7CYDN.js.map} +1 -1
- package/dist/{chunk-H4QPJIIE.js → chunk-OAPJ2JZR.js} +32 -9
- package/dist/chunk-OAPJ2JZR.js.map +1 -0
- package/dist/{chunk-MRKCAOTY.cjs → chunk-ORXYDMK3.cjs} +93 -70
- package/dist/chunk-ORXYDMK3.cjs.map +1 -0
- package/dist/{chunk-5SCFH2HY.js → chunk-UV4VHOZQ.js} +2 -2
- package/dist/{chunk-QVEVSWG6.cjs → chunk-VIME2LPV.cjs} +97 -83
- package/dist/chunk-VIME2LPV.cjs.map +1 -0
- package/dist/{chunk-TMFEMKPE.cjs → chunk-WBQGX4V6.cjs} +4 -4
- package/dist/{chunk-TMFEMKPE.cjs.map → chunk-WBQGX4V6.cjs.map} +1 -1
- package/dist/{chunk-5OX6NE4Z.js → chunk-WZY7IOOU.js} +2 -2
- package/dist/{chunk-56QRSCG5.js → chunk-XE3EOVHX.js} +2 -2
- package/dist/cloudflare.cjs +60 -60
- package/dist/cloudflare.d.cts +1 -1
- package/dist/cloudflare.d.ts +1 -1
- package/dist/cloudflare.js +3 -3
- package/dist/{columnProcessors-DI6kAsDL.d.cts → columnProcessors-Be2uMYjS.d.cts} +1 -1
- package/dist/{columnProcessors-HcVlgzHa.d.ts → columnProcessors-D0ivj_SU.d.ts} +1 -1
- package/dist/{connectionString-Cl7msrGf.d.cts → connectionString-Dch_MIRU.d.cts} +4 -2
- package/dist/{connectionString-Cl7msrGf.d.ts → connectionString-Dch_MIRU.d.ts} +4 -2
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +37 -37
- package/dist/pg.d.cts +2 -2
- package/dist/pg.d.ts +2 -2
- package/dist/pg.js +3 -3
- package/dist/postgresql.cjs +4 -4
- package/dist/postgresql.d.cts +2 -2
- package/dist/postgresql.d.ts +2 -2
- package/dist/postgresql.js +3 -3
- package/dist/sqlite.cjs +4 -4
- package/dist/sqlite.d.cts +4 -3
- package/dist/sqlite.d.ts +4 -3
- package/dist/sqlite.js +3 -3
- package/dist/sqlite3.cjs +81 -77
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +1 -1
- package/dist/sqlite3.d.ts +1 -1
- package/dist/sqlite3.js +61 -57
- package/dist/sqlite3.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-H4QPJIIE.js.map +0 -1
- package/dist/chunk-MRKCAOTY.cjs.map +0 -1
- package/dist/chunk-QVEVSWG6.cjs.map +0 -1
- /package/dist/{chunk-5SCFH2HY.js.map → chunk-UV4VHOZQ.js.map} +0 -0
- /package/dist/{chunk-5OX6NE4Z.js.map → chunk-WZY7IOOU.js.map} +0 -0
- /package/dist/{chunk-56QRSCG5.js.map → chunk-XE3EOVHX.js.map} +0 -0
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkVIME2LPVcjs = require('./chunk-VIME2LPV.cjs');
|
|
32
32
|
|
|
33
33
|
// src/storage/postgresql/core/errors/errorMapper.ts
|
|
34
34
|
var getPostgresErrorCode = (error) => {
|
|
@@ -40,10 +40,10 @@ var getPostgresErrorCode = (error) => {
|
|
|
40
40
|
var getErrorMessage = (error) => error instanceof Error ? error.message : void 0;
|
|
41
41
|
var asError = (error) => error instanceof Error ? error : void 0;
|
|
42
42
|
var mapPostgresError = (error) => {
|
|
43
|
-
if (
|
|
43
|
+
if (_chunkVIME2LPVcjs.DumboError.isInstanceOf(error)) return error;
|
|
44
44
|
const code = getPostgresErrorCode(error);
|
|
45
45
|
if (!code)
|
|
46
|
-
return new (0,
|
|
46
|
+
return new (0, _chunkVIME2LPVcjs.DumboError)({
|
|
47
47
|
errorCode: 500,
|
|
48
48
|
message: getErrorMessage(error),
|
|
49
49
|
innerError: asError(error)
|
|
@@ -53,61 +53,61 @@ var mapPostgresError = (error) => {
|
|
|
53
53
|
switch (code) {
|
|
54
54
|
// ── Class 23: Integrity Constraint Violations ──
|
|
55
55
|
case "23505":
|
|
56
|
-
return new (0,
|
|
56
|
+
return new (0, _chunkVIME2LPVcjs.UniqueConstraintError)(message, innerError);
|
|
57
57
|
case "23503":
|
|
58
|
-
return new (0,
|
|
58
|
+
return new (0, _chunkVIME2LPVcjs.ForeignKeyViolationError)(message, innerError);
|
|
59
59
|
case "23502":
|
|
60
|
-
return new (0,
|
|
60
|
+
return new (0, _chunkVIME2LPVcjs.NotNullViolationError)(message, innerError);
|
|
61
61
|
case "23514":
|
|
62
|
-
return new (0,
|
|
62
|
+
return new (0, _chunkVIME2LPVcjs.CheckViolationError)(message, innerError);
|
|
63
63
|
case "23P01":
|
|
64
|
-
return new (0,
|
|
64
|
+
return new (0, _chunkVIME2LPVcjs.ExclusionViolationError)(message, innerError);
|
|
65
65
|
// ── Class 40: Transaction Rollback ──
|
|
66
66
|
case "40001":
|
|
67
|
-
return new (0,
|
|
67
|
+
return new (0, _chunkVIME2LPVcjs.SerializationError)(message, innerError);
|
|
68
68
|
case "40P01":
|
|
69
|
-
return new (0,
|
|
69
|
+
return new (0, _chunkVIME2LPVcjs.DeadlockError)(message, innerError);
|
|
70
70
|
// ── Class 55: Object Not In Prerequisite State ──
|
|
71
71
|
case "55P03":
|
|
72
72
|
case "55006":
|
|
73
|
-
return new (0,
|
|
73
|
+
return new (0, _chunkVIME2LPVcjs.LockNotAvailableError)(message, innerError);
|
|
74
74
|
// ── Class 57: Operator Intervention ──
|
|
75
75
|
case "57014":
|
|
76
|
-
return new (0,
|
|
76
|
+
return new (0, _chunkVIME2LPVcjs.QueryCanceledError)(message, innerError);
|
|
77
77
|
case "57P01":
|
|
78
78
|
// admin shutdown
|
|
79
79
|
case "57P02":
|
|
80
|
-
return new (0,
|
|
80
|
+
return new (0, _chunkVIME2LPVcjs.AdminShutdownError)(message, innerError);
|
|
81
81
|
case "57P03":
|
|
82
82
|
// cannot connect now
|
|
83
83
|
case "57P05":
|
|
84
|
-
return new (0,
|
|
84
|
+
return new (0, _chunkVIME2LPVcjs.ConnectionError)(message, innerError);
|
|
85
85
|
}
|
|
86
86
|
const sqlClass = code.slice(0, 2);
|
|
87
87
|
switch (sqlClass) {
|
|
88
88
|
// ── Class 08: Connection Exception ──
|
|
89
89
|
case "08":
|
|
90
|
-
return new (0,
|
|
90
|
+
return new (0, _chunkVIME2LPVcjs.ConnectionError)(message, innerError);
|
|
91
91
|
// ── Class 22: Data Exception ──
|
|
92
92
|
case "22":
|
|
93
|
-
return new (0,
|
|
93
|
+
return new (0, _chunkVIME2LPVcjs.DataError)(message, innerError);
|
|
94
94
|
// ── Class 23: Integrity Constraint (fallback for unknown codes) ──
|
|
95
95
|
case "23":
|
|
96
|
-
return new (0,
|
|
96
|
+
return new (0, _chunkVIME2LPVcjs.IntegrityConstraintViolationError)(message, innerError);
|
|
97
97
|
// ── Class 42: Syntax Error or Access Rule Violation ──
|
|
98
98
|
case "42":
|
|
99
|
-
return new (0,
|
|
99
|
+
return new (0, _chunkVIME2LPVcjs.InvalidOperationError)(message, innerError);
|
|
100
100
|
// ── Class 53: Insufficient Resources ──
|
|
101
101
|
case "53":
|
|
102
|
-
return new (0,
|
|
102
|
+
return new (0, _chunkVIME2LPVcjs.InsufficientResourcesError)(message, innerError);
|
|
103
103
|
// ── Class 57: Operator Intervention (fallback) ──
|
|
104
104
|
case "57":
|
|
105
|
-
return new (0,
|
|
105
|
+
return new (0, _chunkVIME2LPVcjs.ConnectionError)(message, innerError);
|
|
106
106
|
// ── Class 58: System Error ──
|
|
107
107
|
case "58":
|
|
108
|
-
return new (0,
|
|
108
|
+
return new (0, _chunkVIME2LPVcjs.SystemError)(message, innerError);
|
|
109
109
|
}
|
|
110
|
-
return new (0,
|
|
110
|
+
return new (0, _chunkVIME2LPVcjs.DumboError)({
|
|
111
111
|
errorCode: 500,
|
|
112
112
|
message,
|
|
113
113
|
innerError
|
|
@@ -116,37 +116,37 @@ var mapPostgresError = (error) => {
|
|
|
116
116
|
|
|
117
117
|
// src/storage/postgresql/core/locks/advisoryLocks.ts
|
|
118
118
|
var tryAcquireAdvisoryLock = async (execute, options) => {
|
|
119
|
-
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => (
|
|
119
|
+
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( _chunkVIME2LPVcjs.defaultDatabaseLockOptions.timeoutMs));
|
|
120
120
|
const advisoryLock2 = options.mode === "Permanent" ? "pg_advisory_lock" : "pg_advisory_xact_lock";
|
|
121
121
|
try {
|
|
122
|
-
await
|
|
122
|
+
await _chunkVIME2LPVcjs.single.call(void 0,
|
|
123
123
|
execute.query(
|
|
124
|
-
|
|
124
|
+
_chunkVIME2LPVcjs.SQL`SELECT ${_chunkVIME2LPVcjs.SQL.plain(advisoryLock2)}(${options.lockId}) AS locked`,
|
|
125
125
|
{ timeoutMs }
|
|
126
126
|
)
|
|
127
127
|
);
|
|
128
128
|
return true;
|
|
129
129
|
} catch (error) {
|
|
130
|
-
if (error instanceof
|
|
131
|
-
errorType:
|
|
130
|
+
if (error instanceof _chunkVIME2LPVcjs.QueryCanceledError || _chunkVIME2LPVcjs.DumboError.isInstanceOf(error, {
|
|
131
|
+
errorType: _chunkVIME2LPVcjs.QueryCanceledError.ErrorType
|
|
132
132
|
}))
|
|
133
133
|
return false;
|
|
134
134
|
throw error;
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
var releaseAdvisoryLock = async (execute, options) => {
|
|
138
|
-
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => (
|
|
138
|
+
const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( _chunkVIME2LPVcjs.defaultDatabaseLockOptions.timeoutMs));
|
|
139
139
|
try {
|
|
140
|
-
await
|
|
140
|
+
await _chunkVIME2LPVcjs.single.call(void 0,
|
|
141
141
|
execute.query(
|
|
142
|
-
|
|
142
|
+
_chunkVIME2LPVcjs.SQL`SELECT pg_advisory_unlock(${options.lockId}) AS locked`,
|
|
143
143
|
{ timeoutMs }
|
|
144
144
|
)
|
|
145
145
|
);
|
|
146
146
|
return true;
|
|
147
147
|
} catch (error) {
|
|
148
|
-
if (error instanceof
|
|
149
|
-
errorType:
|
|
148
|
+
if (error instanceof _chunkVIME2LPVcjs.QueryCanceledError || _chunkVIME2LPVcjs.DumboError.isInstanceOf(error, {
|
|
149
|
+
errorType: _chunkVIME2LPVcjs.QueryCanceledError.ErrorType
|
|
150
150
|
}))
|
|
151
151
|
return false;
|
|
152
152
|
throw error;
|
|
@@ -203,10 +203,10 @@ var DefaultPostgreSQLMigratorOptions = {
|
|
|
203
203
|
databaseLock: AdvisoryLock
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
_chunkVIME2LPVcjs.registerDefaultMigratorOptions.call(void 0, "PostgreSQL", DefaultPostgreSQLMigratorOptions);
|
|
207
207
|
|
|
208
208
|
// src/storage/postgresql/core/sql/processors/arrayProcessors.ts
|
|
209
|
-
var PostgreSQLArrayProcessor =
|
|
209
|
+
var PostgreSQLArrayProcessor = _chunkVIME2LPVcjs.SQLProcessor.call(void 0, {
|
|
210
210
|
canHandle: "SQL_ARRAY",
|
|
211
211
|
handle: (token, { builder, mapper, serializer }) => {
|
|
212
212
|
if (token.value.length === 0) {
|
|
@@ -222,7 +222,7 @@ var PostgreSQLArrayProcessor = _chunkQVEVSWG6cjs.SQLProcessor.call(void 0, {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
|
-
var PostgreSQLExpandSQLInProcessor =
|
|
225
|
+
var PostgreSQLExpandSQLInProcessor = _chunkVIME2LPVcjs.SQLProcessor.call(void 0,
|
|
226
226
|
{
|
|
227
227
|
canHandle: "SQL_IN",
|
|
228
228
|
handle: (token, context) => {
|
|
@@ -235,7 +235,7 @@ var PostgreSQLExpandSQLInProcessor = _chunkQVEVSWG6cjs.SQLProcessor.call(void 0,
|
|
|
235
235
|
builder.addSQL(
|
|
236
236
|
mapper.mapValue(column.value, context.serializer)
|
|
237
237
|
);
|
|
238
|
-
const arrayProcessor = processorsRegistry.get(
|
|
238
|
+
const arrayProcessor = processorsRegistry.get(_chunkVIME2LPVcjs.SQLArray.type);
|
|
239
239
|
if (!arrayProcessor) {
|
|
240
240
|
throw new Error(
|
|
241
241
|
"No sql processor registered for an array. Cannot expand IN statement"
|
|
@@ -294,7 +294,7 @@ var mapColumnType = (token, { builder }) => {
|
|
|
294
294
|
}
|
|
295
295
|
builder.addSQL(columnSQL);
|
|
296
296
|
};
|
|
297
|
-
var postgreSQLColumnProcessors =
|
|
297
|
+
var postgreSQLColumnProcessors = _chunkVIME2LPVcjs.mapDefaultSQLColumnProcessors.call(void 0, mapColumnType);
|
|
298
298
|
|
|
299
299
|
// src/storage/postgresql/core/sql/formatter/reserved.ts
|
|
300
300
|
var reservedMap = {
|
|
@@ -447,19 +447,19 @@ var reservedMap = {
|
|
|
447
447
|
var reserved_default = reservedMap;
|
|
448
448
|
|
|
449
449
|
// src/storage/postgresql/core/sql/formatter/index.ts
|
|
450
|
-
var postgreSQLProcessorsRegistry =
|
|
451
|
-
from:
|
|
450
|
+
var postgreSQLProcessorsRegistry = _chunkVIME2LPVcjs.SQLProcessorsRegistry.call(void 0, {
|
|
451
|
+
from: _chunkVIME2LPVcjs.defaultProcessorsRegistry
|
|
452
452
|
}).register(postgreSQLColumnProcessors).register(PostgreSQLArrayProcessor, PostgreSQLExpandSQLInProcessor);
|
|
453
|
-
var pgFormatter =
|
|
453
|
+
var pgFormatter = _chunkVIME2LPVcjs.SQLFormatter.call(void 0, {
|
|
454
454
|
processorsRegistry: postgreSQLProcessorsRegistry,
|
|
455
455
|
valueMapper: {
|
|
456
456
|
mapDate: (value) => value.toISOString().replace("T", " ").replace("Z", "+00"),
|
|
457
457
|
mapPlaceholder: (index) => `$${index + 1}`,
|
|
458
|
-
mapIdentifier: (value) =>
|
|
458
|
+
mapIdentifier: (value) => _chunkVIME2LPVcjs.mapSQLIdentifier.call(void 0, value, { reservedWords: reserved_default }),
|
|
459
459
|
mapArray: (values) => values
|
|
460
460
|
}
|
|
461
461
|
});
|
|
462
|
-
|
|
462
|
+
_chunkVIME2LPVcjs.registerFormatter.call(void 0, "PostgreSQL", pgFormatter);
|
|
463
463
|
|
|
464
464
|
// src/storage/postgresql/core/index.ts
|
|
465
465
|
var PostgreSQLDatabaseName = "PostgreSQL";
|
|
@@ -478,4 +478,4 @@ var PostgreSQLDatabaseName = "PostgreSQL";
|
|
|
478
478
|
|
|
479
479
|
|
|
480
480
|
exports.mapPostgresError = mapPostgresError; exports.tryAcquireAdvisoryLock = tryAcquireAdvisoryLock; exports.releaseAdvisoryLock = releaseAdvisoryLock; exports.acquireAdvisoryLock = acquireAdvisoryLock; exports.AdvisoryLock = AdvisoryLock; exports.advisoryLock = advisoryLock; exports.DefaultPostgreSQLMigratorOptions = DefaultPostgreSQLMigratorOptions; exports.PostgreSQLArrayProcessor = PostgreSQLArrayProcessor; exports.PostgreSQLExpandSQLInProcessor = PostgreSQLExpandSQLInProcessor; exports.postgreSQLColumnProcessors = postgreSQLColumnProcessors; exports.pgFormatter = pgFormatter; exports.PostgreSQLDatabaseName = PostgreSQLDatabaseName;
|
|
481
|
-
//# sourceMappingURL=chunk-
|
|
481
|
+
//# sourceMappingURL=chunk-56DF2K5J.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-HXQYRDCR.cjs","../src/storage/postgresql/core/errors/errorMapper.ts","../src/storage/postgresql/core/locks/advisoryLocks.ts","../src/storage/postgresql/core/schema/migrations.ts","../src/storage/postgresql/core/sql/processors/arrayProcessors.ts","../src/storage/postgresql/core/sql/processors/columProcessors.ts","../src/storage/postgresql/core/sql/formatter/reserved.ts","../src/storage/postgresql/core/sql/formatter/index.ts","../src/storage/postgresql/core/index.ts"],"names":["advisoryLock"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACRA,IAAM,qBAAA,EAAuB,CAAC,KAAA,EAAA,GAAuC;AACnE,EAAA,GAAA,CACE,MAAA,WAAiB,MAAA,GACjB,OAAA,GAAU,MAAA,GACV,OAAQ,KAAA,CAAkC,KAAA,IAAS,QAAA,EACnD;AACA,IAAA,OAAQ,KAAA,CAAkC,IAAA;AAAA,EAC5C;AACA,EAAA,OAAO,KAAA,CAAA;AACT,CAAA;AAEA,IAAM,gBAAA,EAAkB,CAAC,KAAA,EAAA,GACvB,MAAA,WAAiB,MAAA,EAAQ,KAAA,CAAM,QAAA,EAAU,KAAA,CAAA;AAE3C,IAAM,QAAA,EAAU,CAAC,KAAA,EAAA,GACf,MAAA,WAAiB,MAAA,EAAQ,MAAA,EAAQ,KAAA,CAAA;AAW5B,IAAM,iBAAA,EAAmB,CAAC,KAAA,EAAA,GAA+B;AAC9D,EAAA,GAAA,CAAI,4BAAA,CAAW,YAAA,CAAyB,KAAK,CAAA,EAAG,OAAO,KAAA;AAEvD,EAAA,MAAM,KAAA,EAAO,oBAA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ACO,EAAA;AACL,EAAA;AACA,EAAA;AACC,EAAA;AACG,EAAA;AACP,EAAA;AACG,EAAA;AACE,EAAA;AACH,EAAA;AACF,EAAA;AACI,EAAA;AACD,EAAA;AACF,EAAA;AACA,EAAA;AACS,EAAA;AACA,EAAA;AACR,EAAA;AACA,EAAA;AACD,EAAA;AACE,EAAA;AACE,EAAA;AACF,EAAA;AACD,EAAA;AACH,EAAA;AACO,EAAA;AACJ,EAAA;AACI,EAAA;AACL,EAAA;AACF,EAAA;AACI,EAAA;AACF,EAAA;AACG,EAAA;AACH,EAAA;AACA,EAAA;AACC,EAAA;AACI,EAAA;AACK,EAAA;AACX,EAAA;AACC,EAAA;AACD,EAAA;AACC,EAAA;AACC,EAAA;AACG,EAAA;AACA,EAAA;AACD,EAAA;AACA,EAAA;AACJ,EAAA;AACA,EAAA;AACI,EAAA;AACH,EAAA;AACC,EAAA;AACF,EAAA;AACI,EAAA;AACD,EAAA;AACH,EAAA;AACD,EAAA;AACE,EAAA;AACA,EAAA;AACF,EAAA;AACG,EAAA;AACA,EAAA;AACG,EAAA;AACA,EAAA;AACC,EAAA;AACF,EAAA;AACA,EAAA;AACA,EAAA;AACJ,EAAA;AACM,EAAA;AACF,EAAA;AACG,EAAA;AACD,EAAA;AACH,EAAA;AACC,EAAA;AACF,EAAA;AACC,EAAA;AACM,EAAA;AACL,EAAA;AACH,EAAA;AACG,EAAA;AACD,EAAA;AACD,EAAA;AACF,EAAA;AACC,EAAA;AACG,EAAA;AACA,EAAA;AACH,EAAA;AACF,EAAA;AACC,EAAA;AACK,EAAA;AACJ,EAAA;AACW,EAAA;AACV,EAAA;AACC,EAAA;AACF,EAAA;AACC,EAAA;AACE,EAAA;AACD,EAAA;AACF,EAAA;AACC,EAAA;AACD,EAAA;AACG,EAAA;AACX;AAEO;ANuSY;AACA;AOlbb;AACE,EAAA;AAEI;AAGsB;AAChC,EAAA;AACa,EAAA;AACD,IAAA;AAEV,IAAA;AACe,IAAA;AAEJ,IAAA;AACb,EAAA;AACD;AAEiB;AP8aC;AACA;AQtcN;ARwcM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-HXQYRDCR.cjs","sourcesContent":[null,"import {\n AdminShutdownError,\n CheckViolationError,\n ConnectionError,\n DataError,\n DeadlockError,\n DumboError,\n ExclusionViolationError,\n ForeignKeyViolationError,\n InsufficientResourcesError,\n IntegrityConstraintViolationError,\n InvalidOperationError,\n LockNotAvailableError,\n NotNullViolationError,\n QueryCanceledError,\n SerializationError,\n SystemError,\n UniqueConstraintError,\n} from '../../../../core/errors';\n\n/**\n * Checks whether the given error looks like a PostgreSQL DatabaseError\n * from the `pg` driver (has a string `code` property with a SQLSTATE value).\n */\nconst getPostgresErrorCode = (error: unknown): string | undefined => {\n if (\n error instanceof Error &&\n 'code' in error &&\n typeof (error as Record<string, unknown>).code === 'string'\n ) {\n return (error as Record<string, unknown>).code as string;\n }\n return undefined;\n};\n\nconst getErrorMessage = (error: unknown): string | undefined =>\n error instanceof Error ? error.message : undefined;\n\nconst asError = (error: unknown): Error | undefined =>\n error instanceof Error ? error : undefined;\n\n/**\n * Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError\n * based on the SQLSTATE code.\n *\n * SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html\n * Transient classification based on Npgsql's PostgresException.IsTransient.\n *\n * Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.\n */\nexport const mapPostgresError = (error: unknown): DumboError => {\n if (DumboError.isInstanceOf<DumboError>(error)) return error;\n\n const code = getPostgresErrorCode(error);\n if (!code)\n return new DumboError({\n errorCode: 500,\n message: getErrorMessage(error),\n innerError: asError(error),\n });\n\n const message = getErrorMessage(error);\n const innerError = asError(error);\n\n // Exact SQLSTATE matches first, then class prefix fallbacks\n\n switch (code) {\n // ── Class 23: Integrity Constraint Violations ──\n case '23505':\n return new UniqueConstraintError(message, innerError);\n case '23503':\n return new ForeignKeyViolationError(message, innerError);\n case '23502':\n return new NotNullViolationError(message, innerError);\n case '23514':\n return new CheckViolationError(message, innerError);\n case '23P01':\n return new ExclusionViolationError(message, innerError);\n\n // ── Class 40: Transaction Rollback ──\n case '40001':\n return new SerializationError(message, innerError);\n case '40P01':\n return new DeadlockError(message, innerError);\n\n // ── Class 55: Object Not In Prerequisite State ──\n case '55P03':\n case '55006':\n return new LockNotAvailableError(message, innerError);\n\n // ── Class 57: Operator Intervention ──\n case '57014': // query_canceled (e.g. statement timeout)\n return new QueryCanceledError(message, innerError);\n case '57P01': // admin shutdown\n case '57P02': // crash shutdown\n return new AdminShutdownError(message, innerError);\n case '57P03': // cannot connect now\n case '57P05': // idle session timeout\n return new ConnectionError(message, innerError);\n }\n\n // Class prefix fallbacks (first 2 characters of the SQLSTATE code)\n const sqlClass = code.slice(0, 2);\n\n switch (sqlClass) {\n // ── Class 08: Connection Exception ──\n case '08':\n return new ConnectionError(message, innerError);\n\n // ── Class 22: Data Exception ──\n case '22':\n return new DataError(message, innerError);\n\n // ── Class 23: Integrity Constraint (fallback for unknown codes) ──\n case '23':\n return new IntegrityConstraintViolationError(message, innerError);\n\n // ── Class 42: Syntax Error or Access Rule Violation ──\n case '42':\n return new InvalidOperationError(message, innerError);\n\n // ── Class 53: Insufficient Resources ──\n case '53':\n return new InsufficientResourcesError(message, innerError);\n\n // ── Class 57: Operator Intervention (fallback) ──\n case '57':\n return new ConnectionError(message, innerError);\n\n // ── Class 58: System Error ──\n case '58':\n return new SystemError(message, innerError);\n }\n\n return new DumboError({\n errorCode: 500,\n message,\n innerError,\n });\n};\n","import {\n defaultDatabaseLockOptions,\n single,\n SQL,\n type AcquireDatabaseLockMode,\n type AcquireDatabaseLockOptions,\n type DatabaseLock,\n type DatabaseLockOptions,\n type ReleaseDatabaseLockOptions,\n type SQLExecutor,\n} from '../../../../core';\nimport { DumboError, QueryCanceledError } from '../../../../core/errors';\n\nexport const tryAcquireAdvisoryLock = async (\n execute: SQLExecutor,\n options: AcquireDatabaseLockOptions,\n): Promise<boolean> => {\n const timeoutMs = options.timeoutMs ?? defaultDatabaseLockOptions.timeoutMs;\n\n const advisoryLock =\n options.mode === 'Permanent' ? 'pg_advisory_lock' : 'pg_advisory_xact_lock';\n\n try {\n await single(\n execute.query<{ locked: boolean }>(\n SQL`SELECT ${SQL.plain(advisoryLock)}(${options.lockId}) AS locked`,\n { timeoutMs },\n ),\n );\n return true;\n } catch (error) {\n if (\n error instanceof QueryCanceledError ||\n DumboError.isInstanceOf(error, {\n errorType: QueryCanceledError.ErrorType,\n })\n )\n return false;\n\n throw error;\n }\n};\n\nexport const releaseAdvisoryLock = async (\n execute: SQLExecutor,\n options: ReleaseDatabaseLockOptions,\n): Promise<boolean> => {\n const timeoutMs = options.timeoutMs ?? defaultDatabaseLockOptions.timeoutMs;\n\n try {\n await single(\n execute.query<{ locked: boolean }>(\n SQL`SELECT pg_advisory_unlock(${options.lockId}) AS locked`,\n { timeoutMs },\n ),\n );\n return true;\n } catch (error) {\n if (\n error instanceof QueryCanceledError ||\n DumboError.isInstanceOf(error, {\n errorType: QueryCanceledError.ErrorType,\n })\n )\n return false;\n\n throw error;\n }\n};\n\nexport const acquireAdvisoryLock = async (\n execute: SQLExecutor,\n options: AcquireDatabaseLockOptions,\n) => {\n const lockAcquired = await tryAcquireAdvisoryLock(execute, options);\n if (!lockAcquired) {\n throw new Error(\n 'Failed to acquire advisory lock within the specified timeout. Migration aborted.',\n );\n }\n};\n\nexport const AdvisoryLock: DatabaseLock = {\n acquire: acquireAdvisoryLock,\n tryAcquire: tryAcquireAdvisoryLock,\n release: releaseAdvisoryLock,\n withAcquire: async <Result>(\n execute: SQLExecutor,\n handle: () => Promise<Result>,\n options: AcquireDatabaseLockOptions,\n ) => {\n await acquireAdvisoryLock(execute, options);\n try {\n return await handle();\n } finally {\n if (options.mode === 'Permanent')\n await releaseAdvisoryLock(execute, options);\n }\n },\n};\n\nexport const advisoryLock = (\n execute: SQLExecutor,\n options: DatabaseLockOptions,\n) => ({\n acquire: (acquireOptions?: { mode: AcquireDatabaseLockMode }) =>\n acquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n }),\n tryAcquire: (acquireOptions?: { mode: AcquireDatabaseLockMode }) =>\n tryAcquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n }),\n release: () => releaseAdvisoryLock(execute, options),\n withAcquire: async <Result>(\n handle: () => Promise<Result>,\n acquireOptions?: { mode: AcquireDatabaseLockMode },\n ) => {\n await acquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n });\n try {\n return await handle();\n } finally {\n await releaseAdvisoryLock(execute, options);\n }\n },\n});\n","import {\n type MigratorOptions,\n registerDefaultMigratorOptions,\n} from '../../../../core';\nimport { AdvisoryLock } from '../locks';\n\nexport const DefaultPostgreSQLMigratorOptions: MigratorOptions = {\n lock: {\n databaseLock: AdvisoryLock,\n },\n};\n\nregisterDefaultMigratorOptions('PostgreSQL', DefaultPostgreSQLMigratorOptions);\n","import type { SQLIn } from '../../../../../core';\nimport {\n SQLArray,\n SQLProcessor,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nexport const PostgreSQLArrayProcessor: SQLProcessor<SQLArray> = SQLProcessor({\n canHandle: 'SQL_ARRAY',\n handle: (\n token: SQLArray,\n { builder, mapper, serializer }: SQLProcessorContext,\n ) => {\n if (token.value.length === 0) {\n throw new Error(\n \"Empty arrays are not supported. If you're using it with SELECT IN statement Use SQL.in(column, array) helper instead.\",\n );\n }\n const mappedValue = mapper.mapValue(token.value, serializer) as unknown[];\n\n if (token.mode === 'params') {\n builder.addParams(mappedValue);\n } else {\n builder.addParam(mappedValue);\n }\n },\n});\n\nexport const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn> = SQLProcessor(\n {\n canHandle: 'SQL_IN',\n handle: (token: SQLIn, context: SQLProcessorContext) => {\n const { builder, mapper, processorsRegistry } = context;\n const { values: inValues, column, mode } = token;\n\n if (inValues.value.length === 0) {\n builder.addParam(mapper.mapValue(false, context.serializer));\n return;\n }\n\n builder.addSQL(\n mapper.mapValue(column.value, context.serializer) as string,\n );\n const arrayProcessor = processorsRegistry.get(SQLArray.type);\n\n if (!arrayProcessor) {\n throw new Error(\n 'No sql processor registered for an array. Cannot expand IN statement',\n );\n }\n\n if (mode === 'params') {\n builder.addSQL(` IN (`);\n const expandedArray = { ...inValues, mode: 'params' as const };\n arrayProcessor.handle(expandedArray, context);\n builder.addSQL(`)`);\n } else {\n builder.addSQL(` = ANY (`);\n arrayProcessor.handle(inValues, context);\n builder.addSQL(`)`);\n }\n },\n },\n);\n","import {\n mapDefaultSQLColumnProcessors,\n type DefaultSQLColumnProcessors,\n type DefaultSQLColumnToken,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nconst mapColumnType = (\n token: DefaultSQLColumnToken,\n { builder }: SQLProcessorContext,\n): void => {\n let columnSQL: string;\n const { sqlTokenType } = token;\n switch (sqlTokenType) {\n case 'SQL_COLUMN_AUTO_INCREMENT':\n columnSQL = `${token.bigint ? 'BIGSERIAL' : 'SERIAL'} ${token.primaryKey ? 'PRIMARY KEY' : ''}`;\n break;\n case 'SQL_COLUMN_BIGINT':\n columnSQL = 'BIGINT';\n break;\n case 'SQL_COLUMN_SERIAL':\n columnSQL = 'SERIAL';\n break;\n case 'SQL_COLUMN_INTEGER':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_JSONB':\n columnSQL = 'JSONB';\n break;\n case 'SQL_COLUMN_BIGSERIAL':\n columnSQL = 'BIGSERIAL';\n break;\n case 'SQL_COLUMN_TIMESTAMP':\n columnSQL = 'TIMESTAMP';\n break;\n case 'SQL_COLUMN_TIMESTAMPTZ':\n columnSQL = 'TIMESTAMPTZ';\n break;\n case 'SQL_COLUMN_VARCHAR':\n columnSQL = `VARCHAR ${Number.isNaN(token.length) ? '' : `(${token.length})`}`;\n break;\n default: {\n const exhaustiveCheck: never = sqlTokenType;\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown column type: ${exhaustiveCheck}`);\n }\n }\n builder.addSQL(columnSQL);\n};\n\nexport const postgreSQLColumnProcessors: DefaultSQLColumnProcessors =\n mapDefaultSQLColumnProcessors(mapColumnType);\n","// Ported from: https://github.com/datalanche/node-pg-format/blob/master/lib/reserved.js\n//\n// PostgreSQL reserved words\n//\nconst reservedMap: { [key: string]: boolean } = {\n AES128: true,\n AES256: true,\n ALL: true,\n ALLOWOVERWRITE: true,\n ANALYSE: true,\n ANALYZE: true,\n AND: true,\n ANY: true,\n ARRAY: true,\n AS: true,\n ASC: true,\n AUTHORIZATION: true,\n BACKUP: true,\n BETWEEN: true,\n BINARY: true,\n BLANKSASNULL: true,\n BOTH: true,\n BYTEDICT: true,\n CASE: true,\n CAST: true,\n CHECK: true,\n COLLATE: true,\n COLUMN: true,\n CONSTRAINT: true,\n CREATE: true,\n CREDENTIALS: true,\n CROSS: true,\n CURRENT_DATE: true,\n CURRENT_TIME: true,\n CURRENT_TIMESTAMP: true,\n CURRENT_USER: true,\n CURRENT_USER_ID: true,\n DEFAULT: true,\n DEFERRABLE: true,\n DEFLATE: true,\n DEFRAG: true,\n DELTA: true,\n DELTA32K: true,\n DESC: true,\n DISABLE: true,\n DISTINCT: true,\n DO: true,\n ELSE: true,\n EMPTYASNULL: true,\n ENABLE: true,\n ENCODE: true,\n ENCRYPT: true,\n ENCRYPTION: true,\n END: true,\n EXCEPT: true,\n EXPLICIT: true,\n FALSE: true,\n FOR: true,\n FOREIGN: true,\n FREEZE: true,\n FROM: true,\n FULL: true,\n GLOBALDICT256: true,\n GLOBALDICT64K: true,\n GRANT: true,\n GROUP: true,\n GZIP: true,\n HAVING: true,\n IDENTITY: true,\n IGNORE: true,\n ILIKE: true,\n IN: true,\n INITIALLY: true,\n INNER: true,\n INTERSECT: true,\n INTO: true,\n IS: true,\n ISNULL: true,\n JOIN: true,\n LEADING: true,\n LEFT: true,\n LIKE: true,\n LIMIT: true,\n LOCALTIME: true,\n LOCALTIMESTAMP: true,\n LUN: true,\n LUNS: true,\n LZO: true,\n LZOP: true,\n MINUS: true,\n MOSTLY13: true,\n MOSTLY32: true,\n MOSTLY8: true,\n NATURAL: true,\n NEW: true,\n NOT: true,\n NOTNULL: true,\n NULL: true,\n NULLS: true,\n OFF: true,\n OFFLINE: true,\n OFFSET: true,\n OLD: true,\n ON: true,\n ONLY: true,\n OPEN: true,\n OR: true,\n ORDER: true,\n OUTER: true,\n OVERLAPS: true,\n PARALLEL: true,\n PARTITION: true,\n PERCENT: true,\n PLACING: true,\n PRIMARY: true,\n RAW: true,\n READRATIO: true,\n RECOVER: true,\n REFERENCES: true,\n REJECTLOG: true,\n RESORT: true,\n RESTORE: true,\n RIGHT: true,\n SELECT: true,\n SESSION_USER: true,\n SIMILAR: true,\n SOME: true,\n SYSDATE: true,\n SYSTEM: true,\n TABLE: true,\n TAG: true,\n TDES: true,\n TEXT255: true,\n TEXT32K: true,\n THEN: true,\n TO: true,\n TOP: true,\n TRAILING: true,\n TRUE: true,\n TRUNCATECOLUMNS: true,\n UNION: true,\n UNIQUE: true,\n USER: true,\n USING: true,\n VERBOSE: true,\n WALLET: true,\n WHEN: true,\n WHERE: true,\n WITH: true,\n WITHOUT: true,\n};\n\nexport default reservedMap;\n","import {\n defaultProcessorsRegistry,\n mapSQLIdentifier,\n registerFormatter,\n SQLFormatter,\n SQLProcessorsRegistry,\n} from '../../../../../core';\nimport {\n PostgreSQLArrayProcessor,\n postgreSQLColumnProcessors,\n PostgreSQLExpandSQLInProcessor,\n} from '../processors';\nimport reservedMap from './reserved';\n\nconst postgreSQLProcessorsRegistry = SQLProcessorsRegistry({\n from: defaultProcessorsRegistry,\n})\n .register(postgreSQLColumnProcessors)\n .register(PostgreSQLArrayProcessor, PostgreSQLExpandSQLInProcessor);\n\nconst pgFormatter: SQLFormatter = SQLFormatter({\n processorsRegistry: postgreSQLProcessorsRegistry,\n valueMapper: {\n mapDate: (value: Date): unknown =>\n value.toISOString().replace('T', ' ').replace('Z', '+00'),\n mapPlaceholder: (index: number): string => `$${index + 1}`,\n mapIdentifier: (value: string): string =>\n mapSQLIdentifier(value, { reservedWords: reservedMap }),\n mapArray: (values: unknown[]): unknown[] => values,\n },\n});\n\nregisterFormatter('PostgreSQL', pgFormatter);\n\n// Export the original functions if needed\nexport { pgFormatter };\n","import type { DatabaseDriverType } from '../../../core';\n\nexport * from './connections';\nexport * from './errors';\nexport * from './locks';\nexport * from './schema';\nexport * from './sql';\n\nexport type PostgreSQLDatabaseName = 'PostgreSQL';\nexport const PostgreSQLDatabaseName = 'PostgreSQL';\n\nexport type PostgreSQLDriverType<DriverName extends string = string> =\n DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-56DF2K5J.cjs","../src/storage/postgresql/core/errors/errorMapper.ts","../src/storage/postgresql/core/locks/advisoryLocks.ts","../src/storage/postgresql/core/schema/migrations.ts","../src/storage/postgresql/core/sql/processors/arrayProcessors.ts","../src/storage/postgresql/core/sql/processors/columProcessors.ts","../src/storage/postgresql/core/sql/formatter/reserved.ts","../src/storage/postgresql/core/sql/formatter/index.ts","../src/storage/postgresql/core/index.ts"],"names":["advisoryLock"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACRA,IAAM,qBAAA,EAAuB,CAAC,KAAA,EAAA,GAAuC;AACnE,EAAA,GAAA,CACE,MAAA,WAAiB,MAAA,GACjB,OAAA,GAAU,MAAA,GACV,OAAQ,KAAA,CAAkC,KAAA,IAAS,QAAA,EACnD;AACA,IAAA,OAAQ,KAAA,CAAkC,IAAA;AAAA,EA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AACP,EAAA;AACA,EAAA;AACJ,EAAA;AACA,EAAA;AACE,EAAA;AACH,EAAA;AACC,EAAA;AACU,EAAA;AACP,EAAA;AACC,EAAA;AACD,EAAA;AACM,EAAA;AACR,EAAA;AACI,EAAA;AACJ,EAAA;AACA,EAAA;AACC,EAAA;AACE,EAAA;AACD,EAAA;AACI,EAAA;AACJ,EAAA;AACK,EAAA;AACN,EAAA;AACO,EAAA;AACA,EAAA;AACd,EAAA;AACc,EAAA;AACG,EAAA;AACR,EAAA;AACG,EAAA;AACH,EAAA;AACD,EAAA;AACD,EAAA;AACG,EAAA;AACJ,EAAA;AACG,EAAA;AACC,EAAA;AACN,EAAA;AACE,EAAA;AACO,EAAA;AACL,EAAA;AACA,EAAA;AACC,EAAA;AACG,EAAA;AACP,EAAA;AACG,EAAA;AACE,EAAA;AACH,EAAA;AACF,EAAA;AACI,EAAA;AACD,EAAA;AACF,EAAA;AACA,EAAA;AACS,EAAA;AACA,EAAA;AACR,EAAA;AACA,EAAA;AACD,EAAA;AACE,EAAA;AACE,EAAA;AACF,EAAA;AACD,EAAA;AACH,EAAA;AACO,EAAA;AACJ,EAAA;AACI,EAAA;AACL,EAAA;AACF,EAAA;AACI,EAAA;AACF,EAAA;AACG,EAAA;AACH,EAAA;AACA,EAAA;AACC,EAAA;AACI,EAAA;AACK,EAAA;AACX,EAAA;AACC,EAAA;AACD,EAAA;AACC,EAAA;AACC,EAAA;AACG,EAAA;AACA,EAAA;AACD,EAAA;AACA,EAAA;AACJ,EAAA;AACA,EAAA;AACI,EAAA;AACH,EAAA;AACC,EAAA;AACF,EAAA;AACI,EAAA;AACD,EAAA;AACH,EAAA;AACD,EAAA;AACE,EAAA;AACA,EAAA;AACF,EAAA;AACG,EAAA;AACA,EAAA;AACG,EAAA;AACA,EAAA;AACC,EAAA;AACF,EAAA;AACA,EAAA;AACA,EAAA;AACJ,EAAA;AACM,EAAA;AACF,EAAA;AACG,EAAA;AACD,EAAA;AACH,EAAA;AACC,EAAA;AACF,EAAA;AACC,EAAA;AACM,EAAA;AACL,EAAA;AACH,EAAA;AACG,EAAA;AACD,EAAA;AACD,EAAA;AACF,EAAA;AACC,EAAA;AACG,EAAA;AACA,EAAA;AACH,EAAA;AACF,EAAA;AACC,EAAA;AACK,EAAA;AACJ,EAAA;AACW,EAAA;AACV,EAAA;AACC,EAAA;AACF,EAAA;AACC,EAAA;AACE,EAAA;AACD,EAAA;AACF,EAAA;AACC,EAAA;AACD,EAAA;AACG,EAAA;AACX;AAEO;ANuSY;AACA;AOlbb;AACE,EAAA;AAEI;AAGsB;AAChC,EAAA;AACa,EAAA;AACD,IAAA;AAEV,IAAA;AACe,IAAA;AAEJ,IAAA;AACb,EAAA;AACD;AAEiB;AP8aC;AACA;AQtcN;ARwcM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-56DF2K5J.cjs","sourcesContent":[null,"import {\n AdminShutdownError,\n CheckViolationError,\n ConnectionError,\n DataError,\n DeadlockError,\n DumboError,\n ExclusionViolationError,\n ForeignKeyViolationError,\n InsufficientResourcesError,\n IntegrityConstraintViolationError,\n InvalidOperationError,\n LockNotAvailableError,\n NotNullViolationError,\n QueryCanceledError,\n SerializationError,\n SystemError,\n UniqueConstraintError,\n} from '../../../../core/errors';\n\n/**\n * Checks whether the given error looks like a PostgreSQL DatabaseError\n * from the `pg` driver (has a string `code` property with a SQLSTATE value).\n */\nconst getPostgresErrorCode = (error: unknown): string | undefined => {\n if (\n error instanceof Error &&\n 'code' in error &&\n typeof (error as Record<string, unknown>).code === 'string'\n ) {\n return (error as Record<string, unknown>).code as string;\n }\n return undefined;\n};\n\nconst getErrorMessage = (error: unknown): string | undefined =>\n error instanceof Error ? error.message : undefined;\n\nconst asError = (error: unknown): Error | undefined =>\n error instanceof Error ? error : undefined;\n\n/**\n * Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError\n * based on the SQLSTATE code.\n *\n * SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html\n * Transient classification based on Npgsql's PostgresException.IsTransient.\n *\n * Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.\n */\nexport const mapPostgresError = (error: unknown): DumboError => {\n if (DumboError.isInstanceOf<DumboError>(error)) return error;\n\n const code = getPostgresErrorCode(error);\n if (!code)\n return new DumboError({\n errorCode: 500,\n message: getErrorMessage(error),\n innerError: asError(error),\n });\n\n const message = getErrorMessage(error);\n const innerError = asError(error);\n\n // Exact SQLSTATE matches first, then class prefix fallbacks\n\n switch (code) {\n // ── Class 23: Integrity Constraint Violations ──\n case '23505':\n return new UniqueConstraintError(message, innerError);\n case '23503':\n return new ForeignKeyViolationError(message, innerError);\n case '23502':\n return new NotNullViolationError(message, innerError);\n case '23514':\n return new CheckViolationError(message, innerError);\n case '23P01':\n return new ExclusionViolationError(message, innerError);\n\n // ── Class 40: Transaction Rollback ──\n case '40001':\n return new SerializationError(message, innerError);\n case '40P01':\n return new DeadlockError(message, innerError);\n\n // ── Class 55: Object Not In Prerequisite State ──\n case '55P03':\n case '55006':\n return new LockNotAvailableError(message, innerError);\n\n // ── Class 57: Operator Intervention ──\n case '57014': // query_canceled (e.g. statement timeout)\n return new QueryCanceledError(message, innerError);\n case '57P01': // admin shutdown\n case '57P02': // crash shutdown\n return new AdminShutdownError(message, innerError);\n case '57P03': // cannot connect now\n case '57P05': // idle session timeout\n return new ConnectionError(message, innerError);\n }\n\n // Class prefix fallbacks (first 2 characters of the SQLSTATE code)\n const sqlClass = code.slice(0, 2);\n\n switch (sqlClass) {\n // ── Class 08: Connection Exception ──\n case '08':\n return new ConnectionError(message, innerError);\n\n // ── Class 22: Data Exception ──\n case '22':\n return new DataError(message, innerError);\n\n // ── Class 23: Integrity Constraint (fallback for unknown codes) ──\n case '23':\n return new IntegrityConstraintViolationError(message, innerError);\n\n // ── Class 42: Syntax Error or Access Rule Violation ──\n case '42':\n return new InvalidOperationError(message, innerError);\n\n // ── Class 53: Insufficient Resources ──\n case '53':\n return new InsufficientResourcesError(message, innerError);\n\n // ── Class 57: Operator Intervention (fallback) ──\n case '57':\n return new ConnectionError(message, innerError);\n\n // ── Class 58: System Error ──\n case '58':\n return new SystemError(message, innerError);\n }\n\n return new DumboError({\n errorCode: 500,\n message,\n innerError,\n });\n};\n","import {\n defaultDatabaseLockOptions,\n single,\n SQL,\n type AcquireDatabaseLockMode,\n type AcquireDatabaseLockOptions,\n type DatabaseLock,\n type DatabaseLockOptions,\n type ReleaseDatabaseLockOptions,\n type SQLExecutor,\n} from '../../../../core';\nimport { DumboError, QueryCanceledError } from '../../../../core/errors';\n\nexport const tryAcquireAdvisoryLock = async (\n execute: SQLExecutor,\n options: AcquireDatabaseLockOptions,\n): Promise<boolean> => {\n const timeoutMs = options.timeoutMs ?? defaultDatabaseLockOptions.timeoutMs;\n\n const advisoryLock =\n options.mode === 'Permanent' ? 'pg_advisory_lock' : 'pg_advisory_xact_lock';\n\n try {\n await single(\n execute.query<{ locked: boolean }>(\n SQL`SELECT ${SQL.plain(advisoryLock)}(${options.lockId}) AS locked`,\n { timeoutMs },\n ),\n );\n return true;\n } catch (error) {\n if (\n error instanceof QueryCanceledError ||\n DumboError.isInstanceOf(error, {\n errorType: QueryCanceledError.ErrorType,\n })\n )\n return false;\n\n throw error;\n }\n};\n\nexport const releaseAdvisoryLock = async (\n execute: SQLExecutor,\n options: ReleaseDatabaseLockOptions,\n): Promise<boolean> => {\n const timeoutMs = options.timeoutMs ?? defaultDatabaseLockOptions.timeoutMs;\n\n try {\n await single(\n execute.query<{ locked: boolean }>(\n SQL`SELECT pg_advisory_unlock(${options.lockId}) AS locked`,\n { timeoutMs },\n ),\n );\n return true;\n } catch (error) {\n if (\n error instanceof QueryCanceledError ||\n DumboError.isInstanceOf(error, {\n errorType: QueryCanceledError.ErrorType,\n })\n )\n return false;\n\n throw error;\n }\n};\n\nexport const acquireAdvisoryLock = async (\n execute: SQLExecutor,\n options: AcquireDatabaseLockOptions,\n) => {\n const lockAcquired = await tryAcquireAdvisoryLock(execute, options);\n if (!lockAcquired) {\n throw new Error(\n 'Failed to acquire advisory lock within the specified timeout. Migration aborted.',\n );\n }\n};\n\nexport const AdvisoryLock: DatabaseLock = {\n acquire: acquireAdvisoryLock,\n tryAcquire: tryAcquireAdvisoryLock,\n release: releaseAdvisoryLock,\n withAcquire: async <Result>(\n execute: SQLExecutor,\n handle: () => Promise<Result>,\n options: AcquireDatabaseLockOptions,\n ) => {\n await acquireAdvisoryLock(execute, options);\n try {\n return await handle();\n } finally {\n if (options.mode === 'Permanent')\n await releaseAdvisoryLock(execute, options);\n }\n },\n};\n\nexport const advisoryLock = (\n execute: SQLExecutor,\n options: DatabaseLockOptions,\n) => ({\n acquire: (acquireOptions?: { mode: AcquireDatabaseLockMode }) =>\n acquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n }),\n tryAcquire: (acquireOptions?: { mode: AcquireDatabaseLockMode }) =>\n tryAcquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n }),\n release: () => releaseAdvisoryLock(execute, options),\n withAcquire: async <Result>(\n handle: () => Promise<Result>,\n acquireOptions?: { mode: AcquireDatabaseLockMode },\n ) => {\n await acquireAdvisoryLock(execute, {\n ...options,\n ...(acquireOptions ?? {}),\n });\n try {\n return await handle();\n } finally {\n await releaseAdvisoryLock(execute, options);\n }\n },\n});\n","import {\n type MigratorOptions,\n registerDefaultMigratorOptions,\n} from '../../../../core';\nimport { AdvisoryLock } from '../locks';\n\nexport const DefaultPostgreSQLMigratorOptions: MigratorOptions = {\n lock: {\n databaseLock: AdvisoryLock,\n },\n};\n\nregisterDefaultMigratorOptions('PostgreSQL', DefaultPostgreSQLMigratorOptions);\n","import type { SQLIn } from '../../../../../core';\nimport {\n SQLArray,\n SQLProcessor,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nexport const PostgreSQLArrayProcessor: SQLProcessor<SQLArray> = SQLProcessor({\n canHandle: 'SQL_ARRAY',\n handle: (\n token: SQLArray,\n { builder, mapper, serializer }: SQLProcessorContext,\n ) => {\n if (token.value.length === 0) {\n throw new Error(\n \"Empty arrays are not supported. If you're using it with SELECT IN statement Use SQL.in(column, array) helper instead.\",\n );\n }\n const mappedValue = mapper.mapValue(token.value, serializer) as unknown[];\n\n if (token.mode === 'params') {\n builder.addParams(mappedValue);\n } else {\n builder.addParam(mappedValue);\n }\n },\n});\n\nexport const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn> = SQLProcessor(\n {\n canHandle: 'SQL_IN',\n handle: (token: SQLIn, context: SQLProcessorContext) => {\n const { builder, mapper, processorsRegistry } = context;\n const { values: inValues, column, mode } = token;\n\n if (inValues.value.length === 0) {\n builder.addParam(mapper.mapValue(false, context.serializer));\n return;\n }\n\n builder.addSQL(\n mapper.mapValue(column.value, context.serializer) as string,\n );\n const arrayProcessor = processorsRegistry.get(SQLArray.type);\n\n if (!arrayProcessor) {\n throw new Error(\n 'No sql processor registered for an array. Cannot expand IN statement',\n );\n }\n\n if (mode === 'params') {\n builder.addSQL(` IN (`);\n const expandedArray = { ...inValues, mode: 'params' as const };\n arrayProcessor.handle(expandedArray, context);\n builder.addSQL(`)`);\n } else {\n builder.addSQL(` = ANY (`);\n arrayProcessor.handle(inValues, context);\n builder.addSQL(`)`);\n }\n },\n },\n);\n","import {\n mapDefaultSQLColumnProcessors,\n type DefaultSQLColumnProcessors,\n type DefaultSQLColumnToken,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nconst mapColumnType = (\n token: DefaultSQLColumnToken,\n { builder }: SQLProcessorContext,\n): void => {\n let columnSQL: string;\n const { sqlTokenType } = token;\n switch (sqlTokenType) {\n case 'SQL_COLUMN_AUTO_INCREMENT':\n columnSQL = `${token.bigint ? 'BIGSERIAL' : 'SERIAL'} ${token.primaryKey ? 'PRIMARY KEY' : ''}`;\n break;\n case 'SQL_COLUMN_BIGINT':\n columnSQL = 'BIGINT';\n break;\n case 'SQL_COLUMN_SERIAL':\n columnSQL = 'SERIAL';\n break;\n case 'SQL_COLUMN_INTEGER':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_JSONB':\n columnSQL = 'JSONB';\n break;\n case 'SQL_COLUMN_BIGSERIAL':\n columnSQL = 'BIGSERIAL';\n break;\n case 'SQL_COLUMN_TIMESTAMP':\n columnSQL = 'TIMESTAMP';\n break;\n case 'SQL_COLUMN_TIMESTAMPTZ':\n columnSQL = 'TIMESTAMPTZ';\n break;\n case 'SQL_COLUMN_VARCHAR':\n columnSQL = `VARCHAR ${Number.isNaN(token.length) ? '' : `(${token.length})`}`;\n break;\n default: {\n const exhaustiveCheck: never = sqlTokenType;\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown column type: ${exhaustiveCheck}`);\n }\n }\n builder.addSQL(columnSQL);\n};\n\nexport const postgreSQLColumnProcessors: DefaultSQLColumnProcessors =\n mapDefaultSQLColumnProcessors(mapColumnType);\n","// Ported from: https://github.com/datalanche/node-pg-format/blob/master/lib/reserved.js\n//\n// PostgreSQL reserved words\n//\nconst reservedMap: { [key: string]: boolean } = {\n AES128: true,\n AES256: true,\n ALL: true,\n ALLOWOVERWRITE: true,\n ANALYSE: true,\n ANALYZE: true,\n AND: true,\n ANY: true,\n ARRAY: true,\n AS: true,\n ASC: true,\n AUTHORIZATION: true,\n BACKUP: true,\n BETWEEN: true,\n BINARY: true,\n BLANKSASNULL: true,\n BOTH: true,\n BYTEDICT: true,\n CASE: true,\n CAST: true,\n CHECK: true,\n COLLATE: true,\n COLUMN: true,\n CONSTRAINT: true,\n CREATE: true,\n CREDENTIALS: true,\n CROSS: true,\n CURRENT_DATE: true,\n CURRENT_TIME: true,\n CURRENT_TIMESTAMP: true,\n CURRENT_USER: true,\n CURRENT_USER_ID: true,\n DEFAULT: true,\n DEFERRABLE: true,\n DEFLATE: true,\n DEFRAG: true,\n DELTA: true,\n DELTA32K: true,\n DESC: true,\n DISABLE: true,\n DISTINCT: true,\n DO: true,\n ELSE: true,\n EMPTYASNULL: true,\n ENABLE: true,\n ENCODE: true,\n ENCRYPT: true,\n ENCRYPTION: true,\n END: true,\n EXCEPT: true,\n EXPLICIT: true,\n FALSE: true,\n FOR: true,\n FOREIGN: true,\n FREEZE: true,\n FROM: true,\n FULL: true,\n GLOBALDICT256: true,\n GLOBALDICT64K: true,\n GRANT: true,\n GROUP: true,\n GZIP: true,\n HAVING: true,\n IDENTITY: true,\n IGNORE: true,\n ILIKE: true,\n IN: true,\n INITIALLY: true,\n INNER: true,\n INTERSECT: true,\n INTO: true,\n IS: true,\n ISNULL: true,\n JOIN: true,\n LEADING: true,\n LEFT: true,\n LIKE: true,\n LIMIT: true,\n LOCALTIME: true,\n LOCALTIMESTAMP: true,\n LUN: true,\n LUNS: true,\n LZO: true,\n LZOP: true,\n MINUS: true,\n MOSTLY13: true,\n MOSTLY32: true,\n MOSTLY8: true,\n NATURAL: true,\n NEW: true,\n NOT: true,\n NOTNULL: true,\n NULL: true,\n NULLS: true,\n OFF: true,\n OFFLINE: true,\n OFFSET: true,\n OLD: true,\n ON: true,\n ONLY: true,\n OPEN: true,\n OR: true,\n ORDER: true,\n OUTER: true,\n OVERLAPS: true,\n PARALLEL: true,\n PARTITION: true,\n PERCENT: true,\n PLACING: true,\n PRIMARY: true,\n RAW: true,\n READRATIO: true,\n RECOVER: true,\n REFERENCES: true,\n REJECTLOG: true,\n RESORT: true,\n RESTORE: true,\n RIGHT: true,\n SELECT: true,\n SESSION_USER: true,\n SIMILAR: true,\n SOME: true,\n SYSDATE: true,\n SYSTEM: true,\n TABLE: true,\n TAG: true,\n TDES: true,\n TEXT255: true,\n TEXT32K: true,\n THEN: true,\n TO: true,\n TOP: true,\n TRAILING: true,\n TRUE: true,\n TRUNCATECOLUMNS: true,\n UNION: true,\n UNIQUE: true,\n USER: true,\n USING: true,\n VERBOSE: true,\n WALLET: true,\n WHEN: true,\n WHERE: true,\n WITH: true,\n WITHOUT: true,\n};\n\nexport default reservedMap;\n","import {\n defaultProcessorsRegistry,\n mapSQLIdentifier,\n registerFormatter,\n SQLFormatter,\n SQLProcessorsRegistry,\n} from '../../../../../core';\nimport {\n PostgreSQLArrayProcessor,\n postgreSQLColumnProcessors,\n PostgreSQLExpandSQLInProcessor,\n} from '../processors';\nimport reservedMap from './reserved';\n\nconst postgreSQLProcessorsRegistry = SQLProcessorsRegistry({\n from: defaultProcessorsRegistry,\n})\n .register(postgreSQLColumnProcessors)\n .register(PostgreSQLArrayProcessor, PostgreSQLExpandSQLInProcessor);\n\nconst pgFormatter: SQLFormatter = SQLFormatter({\n processorsRegistry: postgreSQLProcessorsRegistry,\n valueMapper: {\n mapDate: (value: Date): unknown =>\n value.toISOString().replace('T', ' ').replace('Z', '+00'),\n mapPlaceholder: (index: number): string => `$${index + 1}`,\n mapIdentifier: (value: string): string =>\n mapSQLIdentifier(value, { reservedWords: reservedMap }),\n mapArray: (values: unknown[]): unknown[] => values,\n },\n});\n\nregisterFormatter('PostgreSQL', pgFormatter);\n\n// Export the original functions if needed\nexport { pgFormatter };\n","import type { DatabaseDriverType } from '../../../core';\n\nexport * from './connections';\nexport * from './errors';\nexport * from './locks';\nexport * from './schema';\nexport * from './sql';\n\nexport type PostgreSQLDatabaseName = 'PostgreSQL';\nexport const PostgreSQLDatabaseName = 'PostgreSQL';\n\nexport type PostgreSQLDriverType<DriverName extends string = string> =\n DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkVIME2LPVcjs = require('./chunk-VIME2LPV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/storage/postgresql/core/connections/connectionString.ts
|
|
7
7
|
var defaultPostgreSQLConnectionString = "postgresql://postgres@localhost:5432/postgres";
|
|
@@ -40,19 +40,19 @@ function parseDatabaseName(str) {
|
|
|
40
40
|
|
|
41
41
|
// src/storage/postgresql/core/schema/schema.ts
|
|
42
42
|
var defaultPostgreSqlDatabase = "postgres";
|
|
43
|
-
var tableExistsSQL = (tableName) =>
|
|
43
|
+
var tableExistsSQL = (tableName) => _chunkVIME2LPVcjs.SQL`
|
|
44
44
|
SELECT EXISTS (
|
|
45
45
|
SELECT FROM pg_tables
|
|
46
46
|
WHERE tablename = ${tableName}
|
|
47
47
|
) AS exists;`;
|
|
48
|
-
var tableExists = async (execute, tableName) =>
|
|
49
|
-
var functionExistsSQL = (functionName) =>
|
|
48
|
+
var tableExists = async (execute, tableName) => _chunkVIME2LPVcjs.exists.call(void 0, execute.query(tableExistsSQL(tableName)));
|
|
49
|
+
var functionExistsSQL = (functionName) => _chunkVIME2LPVcjs.SQL`
|
|
50
50
|
SELECT EXISTS (
|
|
51
51
|
SELECT FROM pg_proc
|
|
52
52
|
WHERE
|
|
53
53
|
proname = ${functionName}
|
|
54
54
|
) AS exists;`;
|
|
55
|
-
var functionExists = async (execute, functionName) =>
|
|
55
|
+
var functionExists = async (execute, functionName) => _chunkVIME2LPVcjs.exists.call(void 0, execute.query(functionExistsSQL(functionName)));
|
|
56
56
|
|
|
57
57
|
// src/storage/postgresql/core/schema/postgreSQLMetadata.ts
|
|
58
58
|
var postgreSQLMetadata = {
|
|
@@ -80,4 +80,4 @@ dumboDatabaseMetadataRegistry.register("PostgreSQL", postgreSQLMetadata);
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
exports.defaultPostgreSQLConnectionString = defaultPostgreSQLConnectionString; exports.PostgreSQLConnectionString = PostgreSQLConnectionString; exports.parseDatabaseName = parseDatabaseName; exports.defaultPostgreSqlDatabase = defaultPostgreSqlDatabase; exports.tableExistsSQL = tableExistsSQL; exports.tableExists = tableExists; exports.functionExistsSQL = functionExistsSQL; exports.functionExists = functionExists; exports.postgreSQLMetadata = postgreSQLMetadata;
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-LL7C5HYA.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-LL7C5HYA.cjs","../src/storage/postgresql/core/connections/connectionString.ts","../src/storage/postgresql/core/schema/schema.ts","../src/storage/postgresql/core/schema/postgreSQLMetadata.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACHO,IAAM,kCAAA,EACX,+CAAA;AAOK,IAAM,2BAAA,EAA6B,CACxC,gBAAA,EAAA,GAC+B;AAC/B,EAAA,GAAA,CACE,CAAC,gBAAA,CAAiB,UAAA,CAAW,eAAe,EAAA,GAC5C,CAAC,gBAAA,CAAiB,UAAA,CAAW,aAAa,CAAA,EAC1C;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,sCAAA,EAAyC,gBAAgB,CAAA,uCAAA;AAAA,IAC3D,CAAA;AAAA,EACF;AACA,EAAA,OAAO,gBAAA;AACT,CAAA;AAQO,SAAS,iBAAA,CAAkB,GAAA,EAA4B;AAE5D,EAAA,GAAA,CAAI,GAAA,CAAI,MAAA,CAAO,CAAC,EAAA,IAAM,GAAA,EAAK;AACzB,IAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,KAAA,CAAM,GAAG,CAAA;AAC3B,IAAA,OAAO,KAAA,CAAM,CAAC,EAAA,GAAK,IAAA;AAAA,EACrB;AAGA,EAAA,GAAA,CAAI,kCAAA,CAAmC,IAAA,CAAK,GAAG,CAAA,EAAG;AAChD,IAAA,IAAA,EAAM,SAAA,CAAU,GAAG,CAAA,CAAE,OAAA,CAAQ,YAAA,EAAc,KAAK,CAAA;AAAA,EAClD;AAEA,EAAA,IAAI,MAAA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yD;AAAA,EACpE,YAAA,EAAc,YAAA;AAAA,EACd,mBAAA,EAAqB,yBAAA;AAAA,EACrB,YAAA,EAAc;AAAA,IACZ,eAAA,EAAiB,IAAA;AAAA,IACjB,iBAAA,EAAmB,IAAA;AAAA,IACnB,yBAAA,EAA2B;AAAA,EAC7B,CAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA,EAAmB,CAAC,gBAAA,EAAA,oBAAA,CACjB,iBAAA,EAAmB,iBAAA,CAAkB,gBAAgB,EAAA,EAAI,IAAA,CAAA,UAC1D;AACJ,CAAA;AAEA,6BAAA,CAA8B,QAAA,CAAS,YAAA,EAAc,kBAAkB,CAAA;AH+CvE;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,kdAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-LL7C5HYA.cjs","sourcesContent":[null,"import type { DatabaseConnectionString } from '../../../all';\n\nexport const defaultPostgreSQLConnectionString: PostgreSQLConnectionString =\n 'postgresql://postgres@localhost:5432/postgres' as PostgreSQLConnectionString;\n\nexport type PostgreSQLConnectionString = DatabaseConnectionString<\n 'PostgreSQL',\n `postgresql://${string}` | `postgres://${string}`\n>;\n\nexport const PostgreSQLConnectionString = (\n connectionString: string,\n): PostgreSQLConnectionString => {\n if (\n !connectionString.startsWith('postgresql://') &&\n !connectionString.startsWith('postgres://')\n ) {\n throw new Error(\n `Invalid PostgreSQL connection string: ${connectionString}. It should start with \"postgresql://\".`,\n );\n }\n return connectionString as PostgreSQLConnectionString;\n};\n\n// Stripped from https://github.com/brianc/node-postgres\n// Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)\n// MIT License\n/**\n * Parse database name from a PostgreSQL connection string\n */\nexport function parseDatabaseName(str: string): string | null {\n // Unix socket format: /path/to/socket database_name\n if (str.charAt(0) === '/') {\n const parts = str.split(' ');\n return parts[1] || null;\n }\n\n // Encode spaces if present\n if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) {\n str = encodeURI(str).replace(/%25(\\d\\d)/g, '%$1');\n }\n\n let result: URL;\n try {\n result = new URL(str, 'postgres://base');\n } catch {\n // Try with dummy host for malformed URLs\n try {\n result = new URL(str.replace('@/', '@___DUMMY___/'), 'postgres://base');\n } catch {\n return null;\n }\n }\n\n // Socket protocol: socket://path?db=dbname\n if (result.protocol === 'socket:') {\n return result.searchParams.get('db');\n }\n\n // Standard URL: postgres://user:pass@host:port/database\n const pathname = result.pathname.slice(1) || null;\n return pathname ? decodeURI(pathname) : null;\n}\n","import { exists, SQL, type SQLExecutor } from '../../../../core';\nexport * from './schema';\n\nexport const defaultPostgreSqlDatabase = 'postgres';\n\nexport const tableExistsSQL = (tableName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT FROM pg_tables\n WHERE tablename = ${tableName}\n ) AS exists;`;\n\nexport const tableExists = async (\n execute: SQLExecutor,\n tableName: string,\n): Promise<boolean> => exists(execute.query(tableExistsSQL(tableName)));\n\nexport const functionExistsSQL = (functionName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT FROM pg_proc\n WHERE\n proname = ${functionName}\n ) AS exists;`;\n\nexport const functionExists = async (\n execute: SQLExecutor,\n functionName: string,\n): Promise<boolean> => exists(execute.query(functionExistsSQL(functionName)));\n","import type { DatabaseMetadata } from '../../../../core';\nimport { parseDatabaseName } from '../connections';\nimport {\n defaultPostgreSqlDatabase,\n functionExists,\n tableExists,\n} from './schema';\n\nexport const postgreSQLMetadata: DatabaseMetadata<true, true, true> = {\n databaseType: 'PostgreSQL',\n defaultDatabaseName: defaultPostgreSqlDatabase,\n capabilities: {\n supportsSchemas: true,\n supportsFunctions: true,\n supportsMultipleDatabases: true,\n },\n tableExists,\n functionExists,\n parseDatabaseName: (connectionString?: string) =>\n (connectionString ? parseDatabaseName(connectionString) : null) ??\n defaultPostgreSqlDatabase,\n};\n\ndumboDatabaseMetadataRegistry.register('PostgreSQL', postgreSQLMetadata);\n"]}
|
|
@@ -2001,6 +2001,85 @@ var transactionFactoryWithAmbientConnection = (connect) => ({
|
|
|
2001
2001
|
return withTx(handle, options);
|
|
2002
2002
|
}
|
|
2003
2003
|
});
|
|
2004
|
+
var transactionFactoryWithAsyncAmbientConnection = (driverType, connect, close) => {
|
|
2005
|
+
close ??= () => Promise.resolve();
|
|
2006
|
+
return {
|
|
2007
|
+
transaction: (options) => {
|
|
2008
|
+
let conn = null;
|
|
2009
|
+
let innerTx = null;
|
|
2010
|
+
const ensureConnection = async () => {
|
|
2011
|
+
if (!conn) {
|
|
2012
|
+
conn = await connect();
|
|
2013
|
+
innerTx = conn.transaction(options);
|
|
2014
|
+
}
|
|
2015
|
+
return innerTx;
|
|
2016
|
+
};
|
|
2017
|
+
const tx = {
|
|
2018
|
+
driverType,
|
|
2019
|
+
get connection() {
|
|
2020
|
+
if (!conn) {
|
|
2021
|
+
throw new Error("Transaction not started - call begin() first");
|
|
2022
|
+
}
|
|
2023
|
+
return conn;
|
|
2024
|
+
},
|
|
2025
|
+
execute: {
|
|
2026
|
+
query: async (sql, queryOptions) => {
|
|
2027
|
+
const tx2 = await ensureConnection();
|
|
2028
|
+
return tx2.execute.query(sql, queryOptions);
|
|
2029
|
+
},
|
|
2030
|
+
batchQuery: async (sqls, queryOptions) => {
|
|
2031
|
+
const tx2 = await ensureConnection();
|
|
2032
|
+
return tx2.execute.batchQuery(sqls, queryOptions);
|
|
2033
|
+
},
|
|
2034
|
+
command: async (sql, commandOptions) => {
|
|
2035
|
+
const tx2 = await ensureConnection();
|
|
2036
|
+
return tx2.execute.command(sql, commandOptions);
|
|
2037
|
+
},
|
|
2038
|
+
batchCommand: async (sqls, commandOptions) => {
|
|
2039
|
+
const tx2 = await ensureConnection();
|
|
2040
|
+
return tx2.execute.batchCommand(sqls, commandOptions);
|
|
2041
|
+
}
|
|
2042
|
+
},
|
|
2043
|
+
begin: async () => {
|
|
2044
|
+
const tx2 = await ensureConnection();
|
|
2045
|
+
return tx2.begin();
|
|
2046
|
+
},
|
|
2047
|
+
commit: async () => {
|
|
2048
|
+
if (!innerTx) {
|
|
2049
|
+
throw new Error("Transaction not started");
|
|
2050
|
+
}
|
|
2051
|
+
try {
|
|
2052
|
+
return await innerTx.commit();
|
|
2053
|
+
} finally {
|
|
2054
|
+
if (conn) await close(conn);
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
rollback: async (error) => {
|
|
2058
|
+
if (!innerTx) {
|
|
2059
|
+
if (conn) await close(conn);
|
|
2060
|
+
return;
|
|
2061
|
+
}
|
|
2062
|
+
try {
|
|
2063
|
+
return await innerTx.rollback(error);
|
|
2064
|
+
} finally {
|
|
2065
|
+
if (conn) await close(conn);
|
|
2066
|
+
}
|
|
2067
|
+
},
|
|
2068
|
+
_transactionOptions: void 0
|
|
2069
|
+
};
|
|
2070
|
+
return tx;
|
|
2071
|
+
},
|
|
2072
|
+
withTransaction: async (handle, options) => {
|
|
2073
|
+
const conn = await connect();
|
|
2074
|
+
try {
|
|
2075
|
+
const withTx = conn.withTransaction;
|
|
2076
|
+
return await withTx(handle, options);
|
|
2077
|
+
} finally {
|
|
2078
|
+
await close(conn);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2004
2083
|
|
|
2005
2084
|
// src/core/connections/connection.ts
|
|
2006
2085
|
var createAmbientConnection = (options) => {
|
|
@@ -2237,21 +2316,24 @@ var createAmbientConnectionPool = (options) => {
|
|
|
2237
2316
|
var createSingletonConnectionPool = (options) => {
|
|
2238
2317
|
const { driverType, getConnection } = options;
|
|
2239
2318
|
let connection = null;
|
|
2240
|
-
const getExistingOrNewConnection = () => connection ?? (connection = getConnection());
|
|
2241
|
-
const getExistingOrNewConnectionAsync = () => Promise.resolve(getExistingOrNewConnection());
|
|
2319
|
+
const getExistingOrNewConnection = async () => connection ?? (connection = await getConnection());
|
|
2242
2320
|
const result = {
|
|
2243
2321
|
driverType,
|
|
2244
|
-
connection: () =>
|
|
2322
|
+
connection: () => getExistingOrNewConnection().then(
|
|
2245
2323
|
(conn) => wrapPooledConnection(conn, () => Promise.resolve())
|
|
2246
2324
|
),
|
|
2247
2325
|
execute: sqlExecutorInAmbientConnection({
|
|
2248
2326
|
driverType,
|
|
2249
|
-
connection:
|
|
2327
|
+
connection: getExistingOrNewConnection
|
|
2250
2328
|
}),
|
|
2251
2329
|
withConnection: (handle, _options) => executeInAmbientConnection(handle, {
|
|
2252
|
-
connection:
|
|
2330
|
+
connection: getExistingOrNewConnection
|
|
2253
2331
|
}),
|
|
2254
|
-
...
|
|
2332
|
+
...transactionFactoryWithAsyncAmbientConnection(
|
|
2333
|
+
options.driverType,
|
|
2334
|
+
getExistingOrNewConnection,
|
|
2335
|
+
options.closeConnection
|
|
2336
|
+
),
|
|
2255
2337
|
close: () => {
|
|
2256
2338
|
return connection !== null ? connection.close() : Promise.resolve();
|
|
2257
2339
|
}
|
|
@@ -2317,80 +2399,11 @@ var createBoundedConnectionPool = (options) => {
|
|
|
2317
2399
|
batchCommand: (sqls, options2) => executeWithPooling((conn) => conn.execute.batchCommand(sqls, options2))
|
|
2318
2400
|
},
|
|
2319
2401
|
withConnection: executeWithPooling,
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
conn = await acquire();
|
|
2326
|
-
innerTx = conn.transaction(options2);
|
|
2327
|
-
}
|
|
2328
|
-
return innerTx;
|
|
2329
|
-
};
|
|
2330
|
-
const tx = {
|
|
2331
|
-
driverType,
|
|
2332
|
-
get connection() {
|
|
2333
|
-
if (!conn) {
|
|
2334
|
-
throw new Error("Transaction not started - call begin() first");
|
|
2335
|
-
}
|
|
2336
|
-
return conn;
|
|
2337
|
-
},
|
|
2338
|
-
execute: {
|
|
2339
|
-
query: async (sql, queryOptions) => {
|
|
2340
|
-
const tx2 = await ensureConnection();
|
|
2341
|
-
return tx2.execute.query(sql, queryOptions);
|
|
2342
|
-
},
|
|
2343
|
-
batchQuery: async (sqls, queryOptions) => {
|
|
2344
|
-
const tx2 = await ensureConnection();
|
|
2345
|
-
return tx2.execute.batchQuery(sqls, queryOptions);
|
|
2346
|
-
},
|
|
2347
|
-
command: async (sql, commandOptions) => {
|
|
2348
|
-
const tx2 = await ensureConnection();
|
|
2349
|
-
return tx2.execute.command(sql, commandOptions);
|
|
2350
|
-
},
|
|
2351
|
-
batchCommand: async (sqls, commandOptions) => {
|
|
2352
|
-
const tx2 = await ensureConnection();
|
|
2353
|
-
return tx2.execute.batchCommand(sqls, commandOptions);
|
|
2354
|
-
}
|
|
2355
|
-
},
|
|
2356
|
-
begin: async () => {
|
|
2357
|
-
const tx2 = await ensureConnection();
|
|
2358
|
-
return tx2.begin();
|
|
2359
|
-
},
|
|
2360
|
-
commit: async () => {
|
|
2361
|
-
if (!innerTx) {
|
|
2362
|
-
throw new Error("Transaction not started");
|
|
2363
|
-
}
|
|
2364
|
-
try {
|
|
2365
|
-
return await innerTx.commit();
|
|
2366
|
-
} finally {
|
|
2367
|
-
if (conn) release(conn);
|
|
2368
|
-
}
|
|
2369
|
-
},
|
|
2370
|
-
rollback: async (error) => {
|
|
2371
|
-
if (!innerTx) {
|
|
2372
|
-
if (conn) release(conn);
|
|
2373
|
-
return;
|
|
2374
|
-
}
|
|
2375
|
-
try {
|
|
2376
|
-
return await innerTx.rollback(error);
|
|
2377
|
-
} finally {
|
|
2378
|
-
if (conn) release(conn);
|
|
2379
|
-
}
|
|
2380
|
-
},
|
|
2381
|
-
_transactionOptions: void 0
|
|
2382
|
-
};
|
|
2383
|
-
return tx;
|
|
2384
|
-
},
|
|
2385
|
-
withTransaction: async (handle, options2) => {
|
|
2386
|
-
const conn = await acquire();
|
|
2387
|
-
try {
|
|
2388
|
-
const withTx = conn.withTransaction;
|
|
2389
|
-
return await withTx(handle, options2);
|
|
2390
|
-
} finally {
|
|
2391
|
-
release(conn);
|
|
2392
|
-
}
|
|
2393
|
-
},
|
|
2402
|
+
...transactionFactoryWithAsyncAmbientConnection(
|
|
2403
|
+
driverType,
|
|
2404
|
+
acquire,
|
|
2405
|
+
release
|
|
2406
|
+
),
|
|
2394
2407
|
close: async () => {
|
|
2395
2408
|
if (closed) return;
|
|
2396
2409
|
closed = true;
|
|
@@ -2799,6 +2812,7 @@ export {
|
|
|
2799
2812
|
transactionFactoryWithDbClient,
|
|
2800
2813
|
transactionFactoryWithNewConnection,
|
|
2801
2814
|
transactionFactoryWithAmbientConnection,
|
|
2815
|
+
transactionFactoryWithAsyncAmbientConnection,
|
|
2802
2816
|
createAmbientConnection,
|
|
2803
2817
|
createSingletonConnection,
|
|
2804
2818
|
createTransientConnection,
|
|
@@ -2810,4 +2824,4 @@ export {
|
|
|
2810
2824
|
createAlwaysNewConnectionPool,
|
|
2811
2825
|
createConnectionPool
|
|
2812
2826
|
};
|
|
2813
|
-
//# sourceMappingURL=chunk-
|
|
2827
|
+
//# sourceMappingURL=chunk-MHY7CYDN.js.map
|