@event-driven-io/dumbo 0.12.6 → 0.12.7
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/index.cjs +18 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -730,11 +730,14 @@ var runSQLMigrations = (pool, migrations, options) => pool.withTransaction(async
|
|
|
730
730
|
async () => {
|
|
731
731
|
for (const migration of coreMigrations) {
|
|
732
732
|
const sql2 = combineMigrations(migration);
|
|
733
|
-
await execute.command(rawSql(sql2)
|
|
733
|
+
await execute.command(rawSql(sql2), {
|
|
734
|
+
timeoutMs: options.migrationTimeoutMs
|
|
735
|
+
});
|
|
734
736
|
}
|
|
735
737
|
for (const migration of migrations) {
|
|
736
738
|
const wasApplied = await runSQLMigration(execute, migration, {
|
|
737
|
-
ignoreMigrationHashMismatch: _nullishCoalesce(options.ignoreMigrationHashMismatch, () => ( false))
|
|
739
|
+
ignoreMigrationHashMismatch: _nullishCoalesce(options.ignoreMigrationHashMismatch, () => ( false)),
|
|
740
|
+
migrationTimeoutMs: options.migrationTimeoutMs
|
|
738
741
|
});
|
|
739
742
|
if (wasApplied) {
|
|
740
743
|
result.applied.push(migration);
|
|
@@ -778,7 +781,9 @@ var runSQLMigration = async (execute, migration, options) => {
|
|
|
778
781
|
await updateMigrationHash(execute, newMigration);
|
|
779
782
|
return false;
|
|
780
783
|
}
|
|
781
|
-
await execute.command(rawSql(sql2)
|
|
784
|
+
await execute.command(rawSql(sql2), {
|
|
785
|
+
timeoutMs: _optionalChain([options, 'optionalAccess', _13 => _13.migrationTimeoutMs])
|
|
786
|
+
});
|
|
782
787
|
await recordMigration(execute, newMigration);
|
|
783
788
|
return true;
|
|
784
789
|
} catch (error) {
|
|
@@ -934,7 +939,7 @@ ${indent} `
|
|
|
934
939
|
)}
|
|
935
940
|
${indent}${COLOR_BRACKETS("}")}`;
|
|
936
941
|
};
|
|
937
|
-
var prettyJson = (obj, options) => formatJson(obj, 0, _optionalChain([options, 'optionalAccess',
|
|
942
|
+
var prettyJson = (obj, options) => formatJson(obj, 0, _optionalChain([options, 'optionalAccess', _14 => _14.handleMultiline]));
|
|
938
943
|
|
|
939
944
|
// src/core/tracing/index.ts
|
|
940
945
|
var tracer = () => {
|
|
@@ -1044,8 +1049,9 @@ var runPostgreSQLMigrations = (pool, migrations, options) => runSQLMigrations(po
|
|
|
1044
1049
|
lockId: MIGRATIONS_LOCK_ID
|
|
1045
1050
|
}
|
|
1046
1051
|
},
|
|
1047
|
-
dryRun: _optionalChain([options, 'optionalAccess',
|
|
1048
|
-
ignoreMigrationHashMismatch: _optionalChain([options, 'optionalAccess',
|
|
1052
|
+
dryRun: _optionalChain([options, 'optionalAccess', _15 => _15.dryRun]),
|
|
1053
|
+
ignoreMigrationHashMismatch: _optionalChain([options, 'optionalAccess', _16 => _16.ignoreMigrationHashMismatch]),
|
|
1054
|
+
migrationTimeoutMs: _optionalChain([options, 'optionalAccess', _17 => _17.migrationTimeoutMs])
|
|
1049
1055
|
});
|
|
1050
1056
|
|
|
1051
1057
|
// src/postgres/core/schema/schema.ts
|
|
@@ -1185,8 +1191,8 @@ async function batch(client, sqlOrSqls, options) {
|
|
|
1185
1191
|
const results = Array(
|
|
1186
1192
|
sqls.length
|
|
1187
1193
|
);
|
|
1188
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1189
|
-
await client.query(`SET statement_timeout = ${_optionalChain([options, 'optionalAccess',
|
|
1194
|
+
if (_optionalChain([options, 'optionalAccess', _18 => _18.timeoutMs])) {
|
|
1195
|
+
await client.query(`SET statement_timeout = ${_optionalChain([options, 'optionalAccess', _19 => _19.timeoutMs])}`);
|
|
1190
1196
|
}
|
|
1191
1197
|
for (let i = 0; i < sqls.length; i++) {
|
|
1192
1198
|
tracer.info("db:sql:query", { sql: sqls[i] });
|
|
@@ -1207,12 +1213,12 @@ var nodePostgresTransaction = (connection) => (getClient, options) => ({
|
|
|
1207
1213
|
commit: async () => {
|
|
1208
1214
|
const client = await getClient;
|
|
1209
1215
|
await client.query("COMMIT");
|
|
1210
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1216
|
+
if (_optionalChain([options, 'optionalAccess', _20 => _20.close])) await _optionalChain([options, 'optionalAccess', _21 => _21.close, 'call', _22 => _22(client)]);
|
|
1211
1217
|
},
|
|
1212
1218
|
rollback: async (error) => {
|
|
1213
1219
|
const client = await getClient;
|
|
1214
1220
|
await client.query("ROLLBACK");
|
|
1215
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1221
|
+
if (_optionalChain([options, 'optionalAccess', _23 => _23.close])) await _optionalChain([options, 'optionalAccess', _24 => _24.close, 'call', _25 => _25(client, error)]);
|
|
1216
1222
|
},
|
|
1217
1223
|
execute: sqlExecutor(nodePostgresSQLExecutor(), {
|
|
1218
1224
|
connect: () => getClient
|
|
@@ -1271,14 +1277,14 @@ var checkConnection = async (connectionString) => {
|
|
|
1271
1277
|
|
|
1272
1278
|
var arePgTypesSet = false;
|
|
1273
1279
|
var setNodePostgresTypeParser = (options) => {
|
|
1274
|
-
if (arePgTypesSet && !_optionalChain([options, 'optionalAccess',
|
|
1280
|
+
if (arePgTypesSet && !_optionalChain([options, 'optionalAccess', _26 => _26.force])) return;
|
|
1275
1281
|
arePgTypesSet = true;
|
|
1276
1282
|
_pg2.default.types.setTypeParser(20, (val) => BigInt(val));
|
|
1277
1283
|
_pg2.default.types.setTypeParser(3802, (val) => JSONSerializer.deserialize(val));
|
|
1278
1284
|
_pg2.default.types.setTypeParser(114, (val) => JSONSerializer.deserialize(val));
|
|
1279
1285
|
};
|
|
1280
1286
|
var setNodePostgresTypeRawParser = (options) => {
|
|
1281
|
-
if (arePgTypesSet && !_optionalChain([options, 'optionalAccess',
|
|
1287
|
+
if (arePgTypesSet && !_optionalChain([options, 'optionalAccess', _27 => _27.force])) return;
|
|
1282
1288
|
arePgTypesSet = true;
|
|
1283
1289
|
_pg2.default.types.setTypeParser(20, (val) => BigInt(val));
|
|
1284
1290
|
_pg2.default.types.setTypeParser(3802, (val) => RawJSONSerializer.deserialize(val));
|