rake-db 2.27.7 → 2.27.9
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 +11 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -1
- package/dist/index.mjs.map +1 -1
- package/dist/node-postgres.d.ts +2 -1463
- package/dist/node-postgres.js +9 -5845
- package/dist/node-postgres.js.map +1 -1
- package/dist/node-postgres.mjs +2 -5838
- package/dist/node-postgres.mjs.map +1 -1
- package/dist/postgres-js.d.ts +2 -1463
- package/dist/postgres-js.js +9 -5845
- package/dist/postgres-js.js.map +1 -1
- package/dist/postgres-js.mjs +2 -5838
- package/dist/postgres-js.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -491,6 +491,7 @@ interface RakeDbRenameMigrationsInput {
|
|
|
491
491
|
map: RakeDbRenameMigrationsMap;
|
|
492
492
|
}
|
|
493
493
|
declare const migrationConfigDefaults: RakeDbBaseConfig<ColumnSchemaConfig>;
|
|
494
|
+
declare const processRakeDbConfig: <SchemaConfig extends ColumnSchemaConfig<orchid_core.ColumnTypeBase<orchid_core.ColumnTypeSchemaArg, unknown, any, any, unknown, unknown, any, unknown, any, orchid_core.ColumnDataBase>>, CT>(config: InputRakeDbConfig<SchemaConfig, CT>) => RakeDbConfig<SchemaConfig, CT>;
|
|
494
495
|
|
|
495
496
|
type DropMode = 'CASCADE' | 'RESTRICT';
|
|
496
497
|
type TableOptions = {
|
|
@@ -1493,6 +1494,8 @@ interface RakeDbChangeFnWithPromise<CT> extends RakeDbChangeFn<CT> {
|
|
|
1493
1494
|
* @param args - optionally provide an array of cli args. Default is `process.argv.slice(2)`.
|
|
1494
1495
|
*/
|
|
1495
1496
|
declare const rakeDbWithAdapters: RakeDbFn<AdapterBase[]>;
|
|
1497
|
+
declare const makeChange: (config: RakeDbConfig<ColumnSchemaConfig, unknown>) => (fn: ChangeCallback<unknown>) => MigrationChange;
|
|
1498
|
+
declare const runCommand: <SchemaConfig extends ColumnSchemaConfig<orchid_core.ColumnTypeBase<orchid_core.ColumnTypeSchemaArg, unknown, any, any, unknown, unknown, any, unknown, any, orchid_core.ColumnDataBase>>, CT>(adapters: AdapterBase[], config: RakeDbConfig<SchemaConfig, CT>, args?: string[]) => Promise<RakeDbResult>;
|
|
1496
1499
|
interface RakeDbCommand {
|
|
1497
1500
|
run(adapters: AdapterBase[], config: AnyRakeDbConfig, args: string[]): MaybePromise<unknown>;
|
|
1498
1501
|
help: string;
|
|
@@ -1753,5 +1756,12 @@ interface OrmParam {
|
|
|
1753
1756
|
}
|
|
1754
1757
|
type UnknownPromiseFns = (() => Promise<unknown>)[];
|
|
1755
1758
|
declare const migrateFiles: (db: OrmParam, files: UnknownPromiseFns) => Promise<void>;
|
|
1759
|
+
declare const makeMigrateAdapter: (config?: Partial<MigrateFnConfig>) => ((adapter: AdapterBase, params?: {
|
|
1760
|
+
count?: number;
|
|
1761
|
+
force?: boolean;
|
|
1762
|
+
}) => Promise<void>);
|
|
1763
|
+
|
|
1764
|
+
declare class RakeDbError extends Error {
|
|
1765
|
+
}
|
|
1756
1766
|
|
|
1757
|
-
export { type AnyRakeDbConfig, type ChangeCallback, type DbMigration, DbStructure, type InputRakeDbConfigBase, type IntrospectedStructure, RakeDbAst, type RakeDbChangeFn, type RakeDbChangeFnWithPromise, type RakeDbConfig, type SilentQueries, type StructureToAstCtx, type StructureToAstTableData, astToMigration, concatSchemaAndName, createMigrationInterface, dbColumnToAst, encodeColumnDefault, getConstraintName, getDbStructureTableData, getDbTableColumnsChecks, getExcludeName, getIndexName, getSchemaAndTableFromName, instantiateDbColumn, introspectDbSchema, makeDomainsMap, makeFileVersion, makeStructureToAstCtx, migrate, migrateAndClose, migrateFiles, migrationConfigDefaults, promptSelect, rakeDbCommands, rakeDbWithAdapters, saveMigratedVersion, structureToAst, tableToAst, writeMigrationFile };
|
|
1767
|
+
export { type AnyRakeDbConfig, type ChangeCallback, type DbMigration, DbStructure, type InputRakeDbConfig, type InputRakeDbConfigBase, type IntrospectedStructure, type MigrateFnConfig, RakeDbAst, type RakeDbChangeFn, type RakeDbChangeFnWithPromise, type RakeDbConfig, RakeDbError, type RakeDbFn, type SilentQueries, type StructureToAstCtx, type StructureToAstTableData, astToMigration, concatSchemaAndName, createMigrationInterface, dbColumnToAst, encodeColumnDefault, getConstraintName, getDbStructureTableData, getDbTableColumnsChecks, getExcludeName, getIndexName, getSchemaAndTableFromName, instantiateDbColumn, introspectDbSchema, makeChange, makeDomainsMap, makeFileVersion, makeMigrateAdapter, makeStructureToAstCtx, migrate, migrateAndClose, migrateFiles, migrationConfigDefaults, processRakeDbConfig, promptSelect, rakeDbCommands, rakeDbWithAdapters, runCommand, saveMigratedVersion, structureToAst, tableToAst, writeMigrationFile };
|
package/dist/index.js
CHANGED
|
@@ -5860,7 +5860,24 @@ const migrateFiles = async (db, files) => {
|
|
|
5860
5860
|
}
|
|
5861
5861
|
});
|
|
5862
5862
|
};
|
|
5863
|
+
const makeMigrateAdapter = (config) => {
|
|
5864
|
+
const conf = ensureMigrationsPath(ensureBasePathAndDbScript(config || {}));
|
|
5865
|
+
return async (adapter, params) => {
|
|
5866
|
+
await migrateAndClose({
|
|
5867
|
+
adapter,
|
|
5868
|
+
...params,
|
|
5869
|
+
config: {
|
|
5870
|
+
...conf,
|
|
5871
|
+
columnTypes: conf.columnTypes || pqb.makeColumnTypes(pqb.defaultSchemaConfig),
|
|
5872
|
+
migrationId: conf.migrationId || migrationConfigDefaults.migrationId,
|
|
5873
|
+
migrationsTable: conf.migrationsTable || migrationConfigDefaults.migrationsTable,
|
|
5874
|
+
import: conf.import || migrationConfigDefaults.import
|
|
5875
|
+
}
|
|
5876
|
+
});
|
|
5877
|
+
};
|
|
5878
|
+
};
|
|
5863
5879
|
|
|
5880
|
+
exports.RakeDbError = RakeDbError;
|
|
5864
5881
|
exports.astToMigration = astToMigration;
|
|
5865
5882
|
exports.concatSchemaAndName = concatSchemaAndName;
|
|
5866
5883
|
exports.createMigrationInterface = createMigrationInterface;
|
|
@@ -5874,16 +5891,20 @@ exports.getIndexName = getIndexName;
|
|
|
5874
5891
|
exports.getSchemaAndTableFromName = getSchemaAndTableFromName;
|
|
5875
5892
|
exports.instantiateDbColumn = instantiateDbColumn;
|
|
5876
5893
|
exports.introspectDbSchema = introspectDbSchema;
|
|
5894
|
+
exports.makeChange = makeChange;
|
|
5877
5895
|
exports.makeDomainsMap = makeDomainsMap;
|
|
5878
5896
|
exports.makeFileVersion = makeFileVersion;
|
|
5897
|
+
exports.makeMigrateAdapter = makeMigrateAdapter;
|
|
5879
5898
|
exports.makeStructureToAstCtx = makeStructureToAstCtx;
|
|
5880
5899
|
exports.migrate = migrate;
|
|
5881
5900
|
exports.migrateAndClose = migrateAndClose;
|
|
5882
5901
|
exports.migrateFiles = migrateFiles;
|
|
5883
5902
|
exports.migrationConfigDefaults = migrationConfigDefaults;
|
|
5903
|
+
exports.processRakeDbConfig = processRakeDbConfig;
|
|
5884
5904
|
exports.promptSelect = promptSelect;
|
|
5885
5905
|
exports.rakeDbCommands = rakeDbCommands;
|
|
5886
5906
|
exports.rakeDbWithAdapters = rakeDbWithAdapters;
|
|
5907
|
+
exports.runCommand = runCommand;
|
|
5887
5908
|
exports.saveMigratedVersion = saveMigratedVersion;
|
|
5888
5909
|
exports.structureToAst = structureToAst;
|
|
5889
5910
|
exports.tableToAst = tableToAst;
|