rake-db 2.20.4 → 2.20.6

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.d.ts CHANGED
@@ -1277,7 +1277,7 @@ interface RakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT = DefaultColu
1277
1277
  beforeRollback?: MigrationCallback;
1278
1278
  afterRollback?: MigrationCallback;
1279
1279
  }
1280
- interface InputRakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT> extends QueryLogOptions {
1280
+ interface InputRakeDbConfigBase<SchemaConfig extends ColumnSchemaConfig, CT> extends QueryLogOptions {
1281
1281
  columnTypes?: CT | ((t: DefaultColumnTypes<DefaultSchemaConfig>) => CT);
1282
1282
  baseTable?: RakeDbBaseTable<CT>;
1283
1283
  schemaConfig?: SchemaConfig;
@@ -1285,7 +1285,6 @@ interface InputRakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT> extends
1285
1285
  dbScript?: string;
1286
1286
  migrationsPath?: string;
1287
1287
  migrationId?: RakeDbMigrationId;
1288
- migrations?: ModuleExportsRecord;
1289
1288
  recurrentPath?: string;
1290
1289
  migrationsTable?: string;
1291
1290
  snakeCase?: boolean;
@@ -1293,10 +1292,6 @@ interface InputRakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT> extends
1293
1292
  commands?: Record<string, (options: AdapterOptions[], config: RakeDbConfig<SchemaConfig, CT extends undefined ? DefaultColumnTypes<DefaultSchemaConfig> : CT>, args: string[]) => void | Promise<void>>;
1294
1293
  noPrimaryKey?: NoPrimaryKeyOption;
1295
1294
  forceDefaultExports?: boolean;
1296
- /**
1297
- * It may look odd, but it's required for `tsx` and other bundlers to have such `import` config specified explicitly.
1298
- */
1299
- import(path: string): Promise<unknown>;
1300
1295
  /**
1301
1296
  * Is called once per db before migrating or rolling back a set of migrations.
1302
1297
  *
@@ -1355,6 +1350,21 @@ interface InputRakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT> extends
1355
1350
  */
1356
1351
  afterRollback?: MigrationCallback;
1357
1352
  }
1353
+ type InputRakeDbConfig<SchemaConfig extends ColumnSchemaConfig, CT> = InputRakeDbConfigBase<SchemaConfig, CT> & ({
1354
+ /**
1355
+ * It may look odd, but it's required for `tsx` and other bundlers to have such `import` config specified explicitly.
1356
+ */
1357
+ import(path: string): Promise<unknown>;
1358
+ } | {
1359
+ /**
1360
+ * To specify array of migrations explicitly, without loading them from files.
1361
+ */
1362
+ migrations: ModuleExportsRecord;
1363
+ /**
1364
+ * It may look odd, but it's required for `tsx` and other bundlers to have such `import` config specified explicitly.
1365
+ */
1366
+ import?(path: string): Promise<unknown>;
1367
+ });
1358
1368
  type ChangeCallback$1 = (arg: {
1359
1369
  db: Db;
1360
1370
  up: boolean;
@@ -1395,6 +1405,7 @@ declare const migrationConfigDefaults: {
1395
1405
  commands: {};
1396
1406
  log: true;
1397
1407
  logger: Console;
1408
+ import(): never;
1398
1409
  };
1399
1410
  declare const processRakeDbConfig: <SchemaConfig extends ColumnSchemaConfig<orchid_core.ColumnTypeBase<orchid_core.ColumnTypeSchemaArg, unknown, any, orchid_core.CoreBaseOperators, unknown, unknown, any, unknown, any, orchid_core.ColumnDataBase>>, CT>(config: InputRakeDbConfig<SchemaConfig, CT>) => RakeDbConfig<SchemaConfig, CT>;
1400
1411
  declare const getDatabaseAndUserFromOptions: (options: AdapterOptions) => {
@@ -1766,4 +1777,4 @@ declare const promptText: ({ message, default: def, password, min, }: {
1766
1777
  min?: number;
1767
1778
  }) => Promise<string>;
1768
1779
 
1769
- export { AnyRakeDbConfig, ChangeCallback, ChangeTableCallback, ChangeTableOptions, ColumnComment, ColumnsShapeCallback, CommandFn, DbMigration, DbStructure, DbStructureDomainsMap, DropMode, InputRakeDbConfig, IntrospectedStructure, Migration, MigrationAdapter, MigrationColumnTypes, ModuleExportsRecord, NoMigrationsTableError, RAKE_DB_LOCK_KEY, RakeDbAppliedVersions, RakeDbAst, RakeDbBaseTable, RakeDbChangeFn, RakeDbConfig, RakeDbCtx, RakeDbFn, RakeDbFnReturns, RakeDbLazyFn, RakeDbMigrationId, RakeDbResult, SilentQueries, StructureToAstCtx, StructureToAstTableData, TableOptions, addColumnComment, addColumnIndex, addOrDropEnumValues, astToMigration, changeCache, changeEnumValues, clearChanges, colors, columnToSql, columnTypeToSql, commentsToQuery, concatSchemaAndName, constraintToSql, createDb, createMigrationInterface, dbColumnToAst, deleteMigratedVersion, dropDb, encodeColumnDefault, exhaustive, generateTimeStamp, getColumnName, getConstraintName, getCurrentChanges, getDatabaseAndUserFromOptions, getDbStructureTableData, getDbTableColumnsChecks, getFirstWordAndRest, getForeignKeyTable, getIndexName, getMigratedVersionsMap, getSchemaAndTableFromName, getTextAfterFrom, getTextAfterTo, identityToSql, indexesToQuery, instantiateDbColumn, introspectDbSchema, joinColumns, joinWords, makeDbStructureColumnsShape, makeDomainsMap, makeFileVersion, makePopulateEnumQuery, makeStructureToAstCtx, migrate, migrateOrRollback, migrationConfigDefaults, newMigration, pluralize, primaryKeyToSql, processRakeDbConfig, promptConfirm, promptSelect, promptText, pushChange, queryLock, quoteNameFromString, quoteSchemaTable, quoteTable, quoteWithSchema, rakeDb, rakeDbAliases, rakeDbCommands, redo, referencesToSql, renameType, resetDb, rollback, saveMigratedVersion, structureToAst, tableToAst, transaction, versionToString, writeMigrationFile };
1780
+ export { AnyRakeDbConfig, ChangeCallback, ChangeTableCallback, ChangeTableOptions, ColumnComment, ColumnsShapeCallback, CommandFn, DbMigration, DbStructure, DbStructureDomainsMap, DropMode, InputRakeDbConfig, InputRakeDbConfigBase, IntrospectedStructure, Migration, MigrationAdapter, MigrationColumnTypes, ModuleExportsRecord, NoMigrationsTableError, RAKE_DB_LOCK_KEY, RakeDbAppliedVersions, RakeDbAst, RakeDbBaseTable, RakeDbChangeFn, RakeDbConfig, RakeDbCtx, RakeDbFn, RakeDbFnReturns, RakeDbLazyFn, RakeDbMigrationId, RakeDbResult, SilentQueries, StructureToAstCtx, StructureToAstTableData, TableOptions, addColumnComment, addColumnIndex, addOrDropEnumValues, astToMigration, changeCache, changeEnumValues, clearChanges, colors, columnToSql, columnTypeToSql, commentsToQuery, concatSchemaAndName, constraintToSql, createDb, createMigrationInterface, dbColumnToAst, deleteMigratedVersion, dropDb, encodeColumnDefault, exhaustive, generateTimeStamp, getColumnName, getConstraintName, getCurrentChanges, getDatabaseAndUserFromOptions, getDbStructureTableData, getDbTableColumnsChecks, getFirstWordAndRest, getForeignKeyTable, getIndexName, getMigratedVersionsMap, getSchemaAndTableFromName, getTextAfterFrom, getTextAfterTo, identityToSql, indexesToQuery, instantiateDbColumn, introspectDbSchema, joinColumns, joinWords, makeDbStructureColumnsShape, makeDomainsMap, makeFileVersion, makePopulateEnumQuery, makeStructureToAstCtx, migrate, migrateOrRollback, migrationConfigDefaults, newMigration, pluralize, primaryKeyToSql, processRakeDbConfig, promptConfirm, promptSelect, promptText, pushChange, queryLock, quoteNameFromString, quoteSchemaTable, quoteTable, quoteWithSchema, rakeDb, rakeDbAliases, rakeDbCommands, redo, referencesToSql, renameType, resetDb, rollback, saveMigratedVersion, structureToAst, tableToAst, transaction, versionToString, writeMigrationFile };
package/dist/index.js CHANGED
@@ -3090,7 +3090,10 @@ const migrationConfigDefaults = {
3090
3090
  snakeCase: false,
3091
3091
  commands: {},
3092
3092
  log: true,
3093
- logger: console
3093
+ logger: console,
3094
+ import() {
3095
+ throw new Error("Please define the `import` setting in `rakeDb` config");
3096
+ }
3094
3097
  };
3095
3098
  const processRakeDbConfig = (config) => {
3096
3099
  var _a, _b;