rake-db 2.23.16 → 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 -18
- package/dist/index.js +310 -163
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +309 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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;
|
|
@@ -1584,11 +1586,12 @@ declare namespace DbStructure {
|
|
|
1584
1586
|
language?: string;
|
|
1585
1587
|
languageColumn?: string;
|
|
1586
1588
|
}
|
|
1589
|
+
interface Exclude extends Index {
|
|
1590
|
+
exclude: string[];
|
|
1591
|
+
}
|
|
1587
1592
|
type ForeignKeyMatch = 'f' | 'p' | 's';
|
|
1588
1593
|
type ForeignKeyAction = 'a' | 'r' | 'c' | 'n' | 'd';
|
|
1589
|
-
interface Constraint {
|
|
1590
|
-
schemaName: string;
|
|
1591
|
-
tableName: string;
|
|
1594
|
+
interface Constraint extends TableNameAndSchemaName {
|
|
1592
1595
|
name: string;
|
|
1593
1596
|
primaryKey?: string[];
|
|
1594
1597
|
references?: References;
|
|
@@ -1607,9 +1610,7 @@ declare namespace DbStructure {
|
|
|
1607
1610
|
columns?: string[];
|
|
1608
1611
|
expression: string;
|
|
1609
1612
|
}
|
|
1610
|
-
interface Trigger {
|
|
1611
|
-
schemaName: string;
|
|
1612
|
-
tableName: string;
|
|
1613
|
+
interface Trigger extends TableNameAndSchemaName {
|
|
1613
1614
|
triggerSchema: string;
|
|
1614
1615
|
name: string;
|
|
1615
1616
|
events: string[];
|
|
@@ -1658,6 +1659,7 @@ interface IntrospectedStructure {
|
|
|
1658
1659
|
tables: DbStructure.Table[];
|
|
1659
1660
|
views: DbStructure.View[];
|
|
1660
1661
|
indexes: DbStructure.Index[];
|
|
1662
|
+
excludes: DbStructure.Exclude[];
|
|
1661
1663
|
constraints: DbStructure.Constraint[];
|
|
1662
1664
|
triggers: DbStructure.Trigger[];
|
|
1663
1665
|
extensions: DbStructure.Extension[];
|
|
@@ -1680,6 +1682,7 @@ interface StructureToAstCtx {
|
|
|
1680
1682
|
interface StructureToAstTableData {
|
|
1681
1683
|
primaryKey?: TableData.PrimaryKey;
|
|
1682
1684
|
indexes: DbStructure.Index[];
|
|
1685
|
+
excludes: DbStructure.Exclude[];
|
|
1683
1686
|
constraints: DbStructure.Constraint[];
|
|
1684
1687
|
}
|
|
1685
1688
|
declare const makeStructureToAstCtx: (config: AnyRakeDbConfig, currentSchema: string) => StructureToAstCtx;
|
|
@@ -1705,6 +1708,7 @@ declare const columnToSql: (name: string, item: ColumnType, values: unknown[], h
|
|
|
1705
1708
|
declare const encodeColumnDefault: (def: unknown, values: unknown[], column?: ColumnTypeBase) => string | null;
|
|
1706
1709
|
declare const identityToSql: (identity: TableData.Identity) => string;
|
|
1707
1710
|
declare const addColumnIndex: (indexes: TableData.Index[], name: string, item: ColumnType) => void;
|
|
1711
|
+
declare const addColumnExclude: (excludes: TableData.Exclude[], name: string, item: ColumnType) => void;
|
|
1708
1712
|
declare const addColumnComment: (comments: ColumnComment[], name: string, item: ColumnType) => void;
|
|
1709
1713
|
declare const getForeignKeyTable: (fnOrTable: (() => ForeignKeyTable) | string) => [string | undefined, string];
|
|
1710
1714
|
declare const getConstraintName: (table: string, constraint: {
|
|
@@ -1719,15 +1723,23 @@ declare const constraintToSql: ({ name }: {
|
|
|
1719
1723
|
name: string;
|
|
1720
1724
|
}, up: boolean, constraint: TableData.Constraint, values: unknown[], snakeCase: boolean | undefined) => string;
|
|
1721
1725
|
declare const referencesToSql: (references: TableData.References, snakeCase: boolean | undefined) => string;
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
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;
|
|
1727
1735
|
declare const indexesToQuery: (up: boolean, { schema, name: tableName }: {
|
|
1728
1736
|
schema?: string;
|
|
1729
1737
|
name: string;
|
|
1730
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[];
|
|
1731
1743
|
declare const commentsToQuery: (schemaTable: {
|
|
1732
1744
|
schema?: string;
|
|
1733
1745
|
name: string;
|
|
@@ -1819,4 +1831,4 @@ declare const promptText: ({ message, default: def, password, min, }: {
|
|
|
1819
1831
|
min?: number;
|
|
1820
1832
|
}) => Promise<string>;
|
|
1821
1833
|
|
|
1822
|
-
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 };
|