rake-db 2.23.17 → 2.23.18
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 +30 -19
- package/dist/index.js +297 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +296 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ declare namespace RakeDbAst {
|
|
|
62
62
|
check?: ColumnDataCheckBase;
|
|
63
63
|
foreignKeys?: TableData.ColumnReferences[];
|
|
64
64
|
indexes?: TableData.ColumnIndex[];
|
|
65
|
+
excludes?: TableData.ColumnExclude[];
|
|
65
66
|
identity?: TableData.Identity;
|
|
66
67
|
}
|
|
67
68
|
interface RenameType {
|
|
@@ -246,6 +247,7 @@ declare const tableChangeMethods: {
|
|
|
246
247
|
};
|
|
247
248
|
index(columns: (string | TableData.Index.ColumnOrExpressionOptions<string>)[], ...args: [options?: TableData.Index.OptionsArg | undefined] | [name?: string | undefined, options?: TableData.Index.OptionsArg | undefined]): pqb.NonUniqDataItem;
|
|
248
249
|
searchIndex(columns: (string | TableData.Index.ColumnOrExpressionOptions<string>)[], ...args: [options?: TableData.Index.TsVectorArg | undefined] | [name?: string | undefined, options?: TableData.Index.TsVectorArg | undefined]): pqb.NonUniqDataItem;
|
|
250
|
+
exclude(columns: TableData.Exclude.ColumnOrExpressionOptions<string>[], ...args: [options?: TableData.Exclude.Options | undefined] | [name?: string | undefined, options?: TableData.Exclude.Options | undefined]): pqb.NonUniqDataItem;
|
|
249
251
|
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;
|
|
250
252
|
check(check: RawSQLBase<orchid_core.QueryColumn<unknown, any>, unknown>, name?: string | undefined): pqb.NonUniqDataItem;
|
|
251
253
|
sql: pqb.SqlFn;
|
|
@@ -1504,6 +1506,10 @@ declare const migrateOrRollback: (trx: TransactionAdapter, config: RakeDbConfig<
|
|
|
1504
1506
|
declare const changeCache: Record<string, ChangeCallback<unknown>[] | undefined>;
|
|
1505
1507
|
|
|
1506
1508
|
declare namespace DbStructure {
|
|
1509
|
+
interface TableNameAndSchemaName {
|
|
1510
|
+
schemaName: string;
|
|
1511
|
+
tableName: string;
|
|
1512
|
+
}
|
|
1507
1513
|
interface Table {
|
|
1508
1514
|
schemaName: string;
|
|
1509
1515
|
name: string;
|
|
@@ -1531,9 +1537,7 @@ declare namespace DbStructure {
|
|
|
1531
1537
|
argModes: ('i' | 'o')[];
|
|
1532
1538
|
argNames?: string[];
|
|
1533
1539
|
}
|
|
1534
|
-
interface Column {
|
|
1535
|
-
schemaName: string;
|
|
1536
|
-
tableName: string;
|
|
1540
|
+
interface Column extends TableNameAndSchemaName {
|
|
1537
1541
|
name: string;
|
|
1538
1542
|
typeSchema: string;
|
|
1539
1543
|
type: string;
|
|
@@ -1559,9 +1563,7 @@ declare namespace DbStructure {
|
|
|
1559
1563
|
extension?: string;
|
|
1560
1564
|
typmod: number;
|
|
1561
1565
|
}
|
|
1562
|
-
interface Index {
|
|
1563
|
-
schemaName: string;
|
|
1564
|
-
tableName: string;
|
|
1566
|
+
interface Index extends TableNameAndSchemaName {
|
|
1565
1567
|
name: string;
|
|
1566
1568
|
using: string;
|
|
1567
1569
|
unique: boolean;
|
|
@@ -1583,13 +1585,13 @@ declare namespace DbStructure {
|
|
|
1583
1585
|
tsVector?: boolean;
|
|
1584
1586
|
language?: string;
|
|
1585
1587
|
languageColumn?: string;
|
|
1586
|
-
|
|
1588
|
+
}
|
|
1589
|
+
interface Exclude extends Index {
|
|
1590
|
+
exclude: string[];
|
|
1587
1591
|
}
|
|
1588
1592
|
type ForeignKeyMatch = 'f' | 'p' | 's';
|
|
1589
1593
|
type ForeignKeyAction = 'a' | 'r' | 'c' | 'n' | 'd';
|
|
1590
|
-
interface Constraint {
|
|
1591
|
-
schemaName: string;
|
|
1592
|
-
tableName: string;
|
|
1594
|
+
interface Constraint extends TableNameAndSchemaName {
|
|
1593
1595
|
name: string;
|
|
1594
1596
|
primaryKey?: string[];
|
|
1595
1597
|
references?: References;
|
|
@@ -1608,9 +1610,7 @@ declare namespace DbStructure {
|
|
|
1608
1610
|
columns?: string[];
|
|
1609
1611
|
expression: string;
|
|
1610
1612
|
}
|
|
1611
|
-
interface Trigger {
|
|
1612
|
-
schemaName: string;
|
|
1613
|
-
tableName: string;
|
|
1613
|
+
interface Trigger extends TableNameAndSchemaName {
|
|
1614
1614
|
triggerSchema: string;
|
|
1615
1615
|
name: string;
|
|
1616
1616
|
events: string[];
|
|
@@ -1659,6 +1659,7 @@ interface IntrospectedStructure {
|
|
|
1659
1659
|
tables: DbStructure.Table[];
|
|
1660
1660
|
views: DbStructure.View[];
|
|
1661
1661
|
indexes: DbStructure.Index[];
|
|
1662
|
+
excludes: DbStructure.Exclude[];
|
|
1662
1663
|
constraints: DbStructure.Constraint[];
|
|
1663
1664
|
triggers: DbStructure.Trigger[];
|
|
1664
1665
|
extensions: DbStructure.Extension[];
|
|
@@ -1681,6 +1682,7 @@ interface StructureToAstCtx {
|
|
|
1681
1682
|
interface StructureToAstTableData {
|
|
1682
1683
|
primaryKey?: TableData.PrimaryKey;
|
|
1683
1684
|
indexes: DbStructure.Index[];
|
|
1685
|
+
excludes: DbStructure.Exclude[];
|
|
1684
1686
|
constraints: DbStructure.Constraint[];
|
|
1685
1687
|
}
|
|
1686
1688
|
declare const makeStructureToAstCtx: (config: AnyRakeDbConfig, currentSchema: string) => StructureToAstCtx;
|
|
@@ -1706,6 +1708,7 @@ declare const columnToSql: (name: string, item: ColumnType, values: unknown[], h
|
|
|
1706
1708
|
declare const encodeColumnDefault: (def: unknown, values: unknown[], column?: ColumnTypeBase) => string | null;
|
|
1707
1709
|
declare const identityToSql: (identity: TableData.Identity) => string;
|
|
1708
1710
|
declare const addColumnIndex: (indexes: TableData.Index[], name: string, item: ColumnType) => void;
|
|
1711
|
+
declare const addColumnExclude: (excludes: TableData.Exclude[], name: string, item: ColumnType) => void;
|
|
1709
1712
|
declare const addColumnComment: (comments: ColumnComment[], name: string, item: ColumnType) => void;
|
|
1710
1713
|
declare const getForeignKeyTable: (fnOrTable: (() => ForeignKeyTable) | string) => [string | undefined, string];
|
|
1711
1714
|
declare const getConstraintName: (table: string, constraint: {
|
|
@@ -1720,15 +1723,23 @@ declare const constraintToSql: ({ name }: {
|
|
|
1720
1723
|
name: string;
|
|
1721
1724
|
}, up: boolean, constraint: TableData.Constraint, values: unknown[], snakeCase: boolean | undefined) => string;
|
|
1722
1725
|
declare const referencesToSql: (references: TableData.References, snakeCase: boolean | undefined) => string;
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1726
|
+
interface GetIndexOrExcludeName {
|
|
1727
|
+
(table: string, columns: ({
|
|
1728
|
+
column?: string;
|
|
1729
|
+
} | {
|
|
1730
|
+
expression: string;
|
|
1731
|
+
})[]): string;
|
|
1732
|
+
}
|
|
1733
|
+
declare const getIndexName: GetIndexOrExcludeName;
|
|
1734
|
+
declare const getExcludeName: GetIndexOrExcludeName;
|
|
1728
1735
|
declare const indexesToQuery: (up: boolean, { schema, name: tableName }: {
|
|
1729
1736
|
schema?: string;
|
|
1730
1737
|
name: string;
|
|
1731
1738
|
}, indexes: TableData.Index[], snakeCase: boolean | undefined, language?: string) => SingleSql[];
|
|
1739
|
+
declare const excludesToQuery: (up: boolean, { schema, name: tableName }: {
|
|
1740
|
+
schema?: string;
|
|
1741
|
+
name: string;
|
|
1742
|
+
}, excludes: TableData.Exclude[], snakeCase: boolean | undefined) => SingleSql[];
|
|
1732
1743
|
declare const commentsToQuery: (schemaTable: {
|
|
1733
1744
|
schema?: string;
|
|
1734
1745
|
name: string;
|
|
@@ -1820,4 +1831,4 @@ declare const promptText: ({ message, default: def, password, min, }: {
|
|
|
1820
1831
|
min?: number;
|
|
1821
1832
|
}) => Promise<string>;
|
|
1822
1833
|
|
|
1823
|
-
export { type AnyRakeDbConfig, type ChangeCallback, type ChangeTableCallback, type ChangeTableOptions, type ColumnComment, type ColumnsShapeCallback, type CommandFn, type DbMigration, DbStructure, type DbStructureDomainsMap, type DropMode, 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, 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, interpolateSqlValues, introspectDbSchema, joinColumns, joinWords, makeDbStructureColumnsShape, makeDomainsMap, makeFileVersion, makePopulateEnumQuery, makeStructureToAstCtx, migrate, migrateOrRollback, migrationConfigDefaults, 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 };
|
|
1834
|
+
export { type AnyRakeDbConfig, type ChangeCallback, type ChangeTableCallback, type ChangeTableOptions, type ColumnComment, type ColumnsShapeCallback, type CommandFn, type DbMigration, DbStructure, type DbStructureDomainsMap, 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, 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, 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 };
|