rake-db 2.25.3 → 2.25.5
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 +5 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as orchid_core from 'orchid-core';
|
|
2
2
|
import { MaybeArray, RawSQLBase, ColumnDataCheckBase, RecordString, ColumnTypeBase, EmptyObject, ColumnSchemaConfig, QueryLogObject, QueryLogOptions, MaybePromise, RecordOptionalString, ForeignKeyTable, SingleSql } from 'orchid-core';
|
|
3
3
|
import * as pqb from 'pqb';
|
|
4
|
-
import { TableData, ColumnsShape, NoPrimaryKeyOption, ColumnType, EnumColumn, raw, Adapter, DbResult, TransactionAdapter, TableDataFn, TableDataItem, DbDomainArg, Db as Db$1, QueryArraysResult, AdapterOptions, DefaultColumnTypes, DefaultSchemaConfig, SearchWeight, ColumnsByType } from 'pqb';
|
|
4
|
+
import { TableData, ColumnsShape, NoPrimaryKeyOption, ColumnType, EnumColumn, raw, Adapter, DbResult, TransactionAdapter, TableDataFn, TableDataItem, DbDomainArg, Db as Db$1, QueryArraysResult, AdapterOptions, DefaultColumnTypes, DefaultSchemaConfig, SearchWeight, ColumnsByType, DbStructureDomainsMap } from 'pqb';
|
|
5
5
|
|
|
6
6
|
type RakeDbAst = RakeDbAst.Table | RakeDbAst.ChangeTable | RakeDbAst.RenameType | RakeDbAst.Schema | RakeDbAst.RenameSchema | RakeDbAst.Extension | RakeDbAst.Enum | RakeDbAst.EnumValues | RakeDbAst.RenameEnumValues | RakeDbAst.ChangeEnumValues | RakeDbAst.Domain | RakeDbAst.Collation | RakeDbAst.Constraint | RakeDbAst.RenameTableItem | RakeDbAst.View;
|
|
7
7
|
declare namespace RakeDbAst {
|
|
@@ -261,7 +261,7 @@ declare const tableChangeMethods: {
|
|
|
261
261
|
foreignKey<ForeignTable extends string | (() => orchid_core.ForeignKeyTable), ForeignColumns extends ForeignTable extends () => orchid_core.ForeignKeyTable ? [orchid_core.ColumnNameOfTable<ReturnType<ForeignTable>>, ...orchid_core.ColumnNameOfTable<ReturnType<ForeignTable>>[]] : [string, ...string[]]>(columns: [string, ...string[]], fnOrTable: ForeignTable, foreignColumns: ForeignColumns, options?: TableData.References.Options | undefined): pqb.NonUniqDataItem;
|
|
262
262
|
check(check: RawSQLBase<orchid_core.QueryColumn<unknown, any>, unknown>, name?: string | undefined): pqb.NonUniqDataItem;
|
|
263
263
|
sql: pqb.SqlFn;
|
|
264
|
-
enum(name: string): EnumColumn<pqb.DefaultSchemaConfig, undefined,
|
|
264
|
+
enum(name: string): EnumColumn<pqb.DefaultSchemaConfig, undefined, [string, ...string[]]>;
|
|
265
265
|
};
|
|
266
266
|
type TableChanger<CT> = MigrationColumnTypes<CT> & TableChangeMethods;
|
|
267
267
|
type TableChangeData = Record<string, RakeDbAst.ChangeTableItem.Column | RakeDbAst.ChangeTableItem.Rename | Change | SpecialChange | ColumnTypeBase>;
|
|
@@ -277,7 +277,7 @@ type TableOptions = {
|
|
|
277
277
|
language?: string;
|
|
278
278
|
};
|
|
279
279
|
type MigrationColumnTypes<CT> = Omit<CT, 'enum'> & {
|
|
280
|
-
enum: (name: string) => EnumColumn<ColumnSchemaConfig, unknown>;
|
|
280
|
+
enum: (name: string) => EnumColumn<ColumnSchemaConfig, unknown, readonly string[]>;
|
|
281
281
|
};
|
|
282
282
|
type ColumnsShapeCallback<CT, Shape extends ColumnsShape = ColumnsShape> = (t: MigrationColumnTypes<CT> & {
|
|
283
283
|
raw: typeof raw;
|
|
@@ -1264,7 +1264,7 @@ declare const concatSchemaAndName: ({ schema, name, }: {
|
|
|
1264
1264
|
schema?: string;
|
|
1265
1265
|
name: string;
|
|
1266
1266
|
}) => string;
|
|
1267
|
-
declare const makePopulateEnumQuery: (item: EnumColumn<ColumnSchemaConfig, unknown>) => TableQuery;
|
|
1267
|
+
declare const makePopulateEnumQuery: (item: EnumColumn<ColumnSchemaConfig, unknown, readonly string[]>) => TableQuery;
|
|
1268
1268
|
declare const transaction: <T>(adapter: Adapter, fn: (trx: TransactionAdapter) => Promise<T>) => Promise<T>;
|
|
1269
1269
|
declare const queryLock: (trx: TransactionAdapter) => Promise<pqb.QueryResult<any>>;
|
|
1270
1270
|
declare const exhaustive: (_: never) => never;
|
|
@@ -1679,9 +1679,6 @@ interface IntrospectedStructure {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
declare function introspectDbSchema(db: Adapter): Promise<IntrospectedStructure>;
|
|
1681
1681
|
|
|
1682
|
-
interface DbStructureDomainsMap {
|
|
1683
|
-
[K: string]: ColumnType;
|
|
1684
|
-
}
|
|
1685
1682
|
interface StructureToAstCtx {
|
|
1686
1683
|
snakeCase?: boolean;
|
|
1687
1684
|
unsupportedTypes: Record<string, string[]>;
|
|
@@ -1849,4 +1846,4 @@ declare const promptText: ({ message, default: def, password, min, }: {
|
|
|
1849
1846
|
min?: number;
|
|
1850
1847
|
}) => Promise<string>;
|
|
1851
1848
|
|
|
1852
|
-
export { type AnyRakeDbConfig, type ChangeCallback, type ChangeTableCallback, type ChangeTableOptions, type ColumnChecks, type ColumnComment, type ColumnNamedCheck, type ColumnsShapeCallback, type CommandFn, type DbMigration, DbStructure, type
|
|
1849
|
+
export { type AnyRakeDbConfig, type ChangeCallback, type ChangeTableCallback, type ChangeTableOptions, type ColumnChecks, type ColumnComment, type ColumnNamedCheck, type ColumnsShapeCallback, type CommandFn, type DbMigration, DbStructure, type DropMode, type GetIndexOrExcludeName, type InputRakeDbConfig, type InputRakeDbConfigBase, type IntrospectedStructure, Migration, type MigrationAdapter, type MigrationColumnTypes, type ModuleExportsRecord, NoMigrationsTableError, RAKE_DB_LOCK_KEY, type RakeDbAppliedVersions, RakeDbAst, type RakeDbBaseTable, type RakeDbChangeFn, type RakeDbConfig, type RakeDbCtx, type RakeDbFn, type RakeDbFnReturns, type RakeDbLazyFn, type RakeDbMigrationId, type RakeDbRenameMigrations, type RakeDbRenameMigrationsInput, type RakeDbRenameMigrationsMap, type RakeDbResult, type SilentQueries, type StructureToAstCtx, type StructureToAstTableData, type TableOptions, addColumnComment, addColumnExclude, addColumnIndex, addOrDropEnumValues, astToMigration, changeCache, changeEnumValues, clearChanges, cmpRawSql, colors, columnToSql, columnTypeToSql, commentsToQuery, concatSchemaAndName, constraintToSql, createDb, createMigrationInterface, dbColumnToAst, deleteMigratedVersion, dropDb, encodeColumnDefault, excludesToQuery, exhaustive, generateTimeStamp, getColumnName, getConstraintName, getCurrentChanges, getDatabaseAndUserFromOptions, getDbStructureTableData, getDbTableColumnsChecks, getExcludeName, getFirstWordAndRest, getForeignKeyTable, getIndexName, getMigratedVersionsMap, getSchemaAndTableFromName, getTextAfterFrom, getTextAfterTo, identityToSql, indexesToQuery, instantiateDbColumn, interpolateSqlValues, introspectDbSchema, joinColumns, joinWords, makeDbStructureColumnsShape, makeDomainsMap, makeFileVersion, makePopulateEnumQuery, makeStructureToAstCtx, migrate, migrateOrRollback, migrationConfigDefaults, nameColumnChecks, newMigration, pluralize, primaryKeyToSql, processRakeDbConfig, promptConfirm, promptSelect, promptText, pushChange, queryLock, quoteCustomType, quoteNameFromString, quoteSchemaTable, quoteTable, quoteWithSchema, rakeDb, rakeDbAliases, rakeDbCommands, redo, referencesToSql, renameType, resetDb, rollback, saveMigratedVersion, structureToAst, tableToAst, transaction, versionToString, writeMigrationFile };
|