@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.d.cts
CHANGED
|
@@ -46,10 +46,10 @@ type SQL = string & {
|
|
|
46
46
|
declare function SQL(strings: TemplateStringsArray, ...values: unknown[]): SQL;
|
|
47
47
|
|
|
48
48
|
type SQLQueryOptions = {
|
|
49
|
-
timeoutMs?: number;
|
|
49
|
+
timeoutMs?: number | undefined;
|
|
50
50
|
};
|
|
51
51
|
type SQLCommandOptions = {
|
|
52
|
-
timeoutMs?: number;
|
|
52
|
+
timeoutMs?: number | undefined;
|
|
53
53
|
};
|
|
54
54
|
interface DbSQLExecutor<ConnectorType extends string = string, DbClient = unknown> {
|
|
55
55
|
type: ConnectorType;
|
|
@@ -152,6 +152,7 @@ type MigratorOptions = {
|
|
|
152
152
|
};
|
|
153
153
|
dryRun?: boolean | undefined;
|
|
154
154
|
ignoreMigrationHashMismatch?: boolean | undefined;
|
|
155
|
+
migrationTimeoutMs?: number | undefined;
|
|
155
156
|
};
|
|
156
157
|
type RunSQLMigrationsResult = {
|
|
157
158
|
applied: SQLMigration[];
|
|
@@ -299,6 +300,7 @@ type PostgreSQLMigratorOptions = {
|
|
|
299
300
|
};
|
|
300
301
|
dryRun?: boolean | undefined;
|
|
301
302
|
ignoreMigrationHashMismatch?: boolean | undefined;
|
|
303
|
+
migrationTimeoutMs?: number | undefined;
|
|
302
304
|
};
|
|
303
305
|
declare const migrationTableSchemaComponent: SchemaComponent;
|
|
304
306
|
declare const runPostgreSQLMigrations: (pool: Dumbo, migrations: SQLMigration[], options?: PostgreSQLMigratorOptions) => Promise<RunSQLMigrationsResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,10 +46,10 @@ type SQL = string & {
|
|
|
46
46
|
declare function SQL(strings: TemplateStringsArray, ...values: unknown[]): SQL;
|
|
47
47
|
|
|
48
48
|
type SQLQueryOptions = {
|
|
49
|
-
timeoutMs?: number;
|
|
49
|
+
timeoutMs?: number | undefined;
|
|
50
50
|
};
|
|
51
51
|
type SQLCommandOptions = {
|
|
52
|
-
timeoutMs?: number;
|
|
52
|
+
timeoutMs?: number | undefined;
|
|
53
53
|
};
|
|
54
54
|
interface DbSQLExecutor<ConnectorType extends string = string, DbClient = unknown> {
|
|
55
55
|
type: ConnectorType;
|
|
@@ -152,6 +152,7 @@ type MigratorOptions = {
|
|
|
152
152
|
};
|
|
153
153
|
dryRun?: boolean | undefined;
|
|
154
154
|
ignoreMigrationHashMismatch?: boolean | undefined;
|
|
155
|
+
migrationTimeoutMs?: number | undefined;
|
|
155
156
|
};
|
|
156
157
|
type RunSQLMigrationsResult = {
|
|
157
158
|
applied: SQLMigration[];
|
|
@@ -299,6 +300,7 @@ type PostgreSQLMigratorOptions = {
|
|
|
299
300
|
};
|
|
300
301
|
dryRun?: boolean | undefined;
|
|
301
302
|
ignoreMigrationHashMismatch?: boolean | undefined;
|
|
303
|
+
migrationTimeoutMs?: number | undefined;
|
|
302
304
|
};
|
|
303
305
|
declare const migrationTableSchemaComponent: SchemaComponent;
|
|
304
306
|
declare const runPostgreSQLMigrations: (pool: Dumbo, migrations: SQLMigration[], options?: PostgreSQLMigratorOptions) => Promise<RunSQLMigrationsResult>;
|
package/dist/index.js
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: options.ignoreMigrationHashMismatch ?? false
|
|
739
|
+
ignoreMigrationHashMismatch: 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: options?.migrationTimeoutMs
|
|
786
|
+
});
|
|
782
787
|
await recordMigration(execute, newMigration);
|
|
783
788
|
return true;
|
|
784
789
|
} catch (error) {
|
|
@@ -1045,7 +1050,8 @@ var runPostgreSQLMigrations = (pool, migrations, options) => runSQLMigrations(po
|
|
|
1045
1050
|
}
|
|
1046
1051
|
},
|
|
1047
1052
|
dryRun: options?.dryRun,
|
|
1048
|
-
ignoreMigrationHashMismatch: options?.ignoreMigrationHashMismatch
|
|
1053
|
+
ignoreMigrationHashMismatch: options?.ignoreMigrationHashMismatch,
|
|
1054
|
+
migrationTimeoutMs: options?.migrationTimeoutMs
|
|
1049
1055
|
});
|
|
1050
1056
|
|
|
1051
1057
|
// src/postgres/core/schema/schema.ts
|