rake-db 2.36.19 → 2.37.1
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/bun.js.map +1 -1
- package/dist/bun.mjs.map +1 -1
- package/dist/index.d.ts +94 -39
- package/dist/index.js +119 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -45
- package/dist/index.mjs.map +1 -1
- package/dist/node-postgres.js.map +1 -1
- package/dist/node-postgres.mjs.map +1 -1
- package/dist/postgres-js.js.map +1 -1
- package/dist/postgres-js.mjs.map +1 -1
- package/package.json +2 -2
package/dist/bun.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun.js","names":["AdapterClass","BunAdapter"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import { BunAdapter, BunAdapterOptions } from 'pqb/bun';\nimport { AdapterClass, MaybeArray, toArray } from 'pqb/internal';\nimport {\n rakeDbCliWithAdapter,\n RakeDbFn,\n setRakeDbCliRunFn,\n incrementIntermediateCaller,\n} from 'rake-db';\n\nexport const rakeDb = ((inputConfig, args = process.argv.slice(2)) => {\n if (!('__rakeDbConfig' in inputConfig)) {\n incrementIntermediateCaller();\n }\n\n const rakeDb = rakeDbCliWithAdapter(inputConfig, args);\n return {\n ...rakeDb,\n run(options) {\n const adapters = toArray(options).map((config) => {\n return new AdapterClass({\n driverAdapter: BunAdapter,\n config,\n });\n });\n return rakeDb.run(adapters);\n },\n };\n}) as RakeDbFn<MaybeArray<BunAdapterOptions>>;\n\nsetRakeDbCliRunFn(rakeDb);\n"],"mappings":";;;;AASA,MAAa,WAAW,aAAa,OAAO,QAAQ,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"bun.js","names":["rakeDbCliWithAdapter","toArray","AdapterClass","BunAdapter","setRakeDbCliRunFn"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import { BunAdapter, BunAdapterOptions } from 'pqb/bun';\nimport { AdapterClass, MaybeArray, toArray } from 'pqb/internal';\nimport {\n rakeDbCliWithAdapter,\n RakeDbFn,\n setRakeDbCliRunFn,\n incrementIntermediateCaller,\n} from 'rake-db';\n\nexport const rakeDb = ((inputConfig, args = process.argv.slice(2)) => {\n if (!('__rakeDbConfig' in inputConfig)) {\n incrementIntermediateCaller();\n }\n\n const rakeDb = rakeDbCliWithAdapter(inputConfig, args);\n return {\n ...rakeDb,\n run(options) {\n const adapters = toArray(options).map((config) => {\n return new AdapterClass({\n driverAdapter: BunAdapter,\n config,\n });\n });\n return rakeDb.run(adapters);\n },\n };\n}) as RakeDbFn<MaybeArray<BunAdapterOptions>>;\n\nsetRakeDbCliRunFn(rakeDb);\n"],"mappings":";;;;AASA,MAAa,WAAW,aAAa,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;CACpE,IAAI,EAAE,oBAAoB,cACxB,CAAA,GAAA,QAAA,4BAAA,CAA4B;CAG9B,MAAM,UAAA,GAASA,QAAAA,qBAAAA,CAAqB,aAAa,IAAI;CACrD,OAAO;EACL,GAAG;EACH,IAAI,SAAS;GACX,MAAM,YAAA,GAAWC,aAAAA,QAAAA,CAAQ,OAAO,CAAC,CAAC,KAAK,WAAW;IAChD,OAAO,IAAIC,aAAAA,aAAa;KACtB,eAAeC,QAAAA;KACf;IACF,CAAC;GACH,CAAC;GACD,OAAO,OAAO,IAAI,QAAQ;EAC5B;CACF;AACF;CAEAC,GAAAA,QAAAA,kBAAAA,CAAkB,MAAM"}
|
package/dist/bun.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun.mjs","names":[],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import { BunAdapter, BunAdapterOptions } from 'pqb/bun';\nimport { AdapterClass, MaybeArray, toArray } from 'pqb/internal';\nimport {\n rakeDbCliWithAdapter,\n RakeDbFn,\n setRakeDbCliRunFn,\n incrementIntermediateCaller,\n} from 'rake-db';\n\nexport const rakeDb = ((inputConfig, args = process.argv.slice(2)) => {\n if (!('__rakeDbConfig' in inputConfig)) {\n incrementIntermediateCaller();\n }\n\n const rakeDb = rakeDbCliWithAdapter(inputConfig, args);\n return {\n ...rakeDb,\n run(options) {\n const adapters = toArray(options).map((config) => {\n return new AdapterClass({\n driverAdapter: BunAdapter,\n config,\n });\n });\n return rakeDb.run(adapters);\n },\n };\n}) as RakeDbFn<MaybeArray<BunAdapterOptions>>;\n\nsetRakeDbCliRunFn(rakeDb);\n"],"mappings":";;;AASA,MAAa,WAAW,aAAa,OAAO,QAAQ,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"bun.mjs","names":[],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import { BunAdapter, BunAdapterOptions } from 'pqb/bun';\nimport { AdapterClass, MaybeArray, toArray } from 'pqb/internal';\nimport {\n rakeDbCliWithAdapter,\n RakeDbFn,\n setRakeDbCliRunFn,\n incrementIntermediateCaller,\n} from 'rake-db';\n\nexport const rakeDb = ((inputConfig, args = process.argv.slice(2)) => {\n if (!('__rakeDbConfig' in inputConfig)) {\n incrementIntermediateCaller();\n }\n\n const rakeDb = rakeDbCliWithAdapter(inputConfig, args);\n return {\n ...rakeDb,\n run(options) {\n const adapters = toArray(options).map((config) => {\n return new AdapterClass({\n driverAdapter: BunAdapter,\n config,\n });\n });\n return rakeDb.run(adapters);\n },\n };\n}) as RakeDbFn<MaybeArray<BunAdapterOptions>>;\n\nsetRakeDbCliRunFn(rakeDb);\n"],"mappings":";;;AASA,MAAa,WAAW,aAAa,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;CACpE,IAAI,EAAE,oBAAoB,cACxB,4BAA4B;CAG9B,MAAM,SAAS,qBAAqB,aAAa,IAAI;CACrD,OAAO;EACL,GAAG;EACH,IAAI,SAAS;GACX,MAAM,WAAW,QAAQ,OAAO,CAAC,CAAC,KAAK,WAAW;IAChD,OAAO,IAAI,aAAa;KACtB,eAAe;KACf;IACF,CAAC;GACH,CAAC;GACD,OAAO,OAAO,IAAI,QAAQ;EAC5B;CACF;AACF;AAEA,kBAAkB,MAAM"}
|
package/dist/index.d.ts
CHANGED
|
@@ -628,16 +628,21 @@ interface TableChangeMethods extends TableMethods, TableDataMethods<string> {
|
|
|
628
628
|
index(options?: TableData.Index.ColumnArg): ColumnIndexChangeInput;
|
|
629
629
|
unique<Columns extends [string | TableData.Index.ColumnOrExpressionOptions, ...(string | TableData.Index.ColumnOrExpressionOptions)[]], Name extends string>(columns: Columns, options?: TableData.Index.UniqueOptionsArg<Name>): {
|
|
630
630
|
tableDataItem: true;
|
|
631
|
-
columns: Columns extends (string | TableData.Index.ColumnOptionsForColumn<string>)[] ? { [I in keyof Columns]: 'column' extends keyof Columns[I] ? Columns[I]['column'] : Columns[I] } : never;
|
|
631
|
+
columns: Columns extends (string | TableData.Index.ColumnOptionsForColumn<string>)[] ? { [I in keyof Columns]: 'column' extends keyof Columns[I] ? Columns[I]['column'] : Columns[I]; } : never;
|
|
632
632
|
name: string extends Name ? never : Name;
|
|
633
633
|
};
|
|
634
634
|
unique(options?: TableData.Index.UniqueColumnArg): ColumnIndexChangeInput;
|
|
635
635
|
exclude(columns: TableData.Exclude.ColumnOrExpressionOptions[], options?: TableData.Exclude.Options): NonUniqDataItem;
|
|
636
636
|
exclude(with_: string, options?: TableData.Exclude.ColumnArg): ColumnExcludeChangeInput;
|
|
637
|
-
foreignKey<Shape>(columns: [string, ...string[]], fnOrTable: () =>
|
|
638
|
-
columns
|
|
637
|
+
foreignKey<Shape>(columns: [string, ...string[]], fnOrTable: () => Column$1.ForeignKey.TableParam & {
|
|
638
|
+
columns?: {
|
|
639
639
|
shape: Shape;
|
|
640
640
|
};
|
|
641
|
+
instance?: () => {
|
|
642
|
+
columns: {
|
|
643
|
+
shape: Shape;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
641
646
|
}, foreignColumns: [keyof Shape, ...(keyof Shape)[]], options?: TableData.References.Options): NonUniqDataItem;
|
|
642
647
|
foreignKey(columns: [string, ...string[]], fnOrTable: string, foreignColumns: [string, ...string[]], options?: TableData.References.Options): NonUniqDataItem;
|
|
643
648
|
foreignKey(fnOrTable: string, foreignColumn: string, options?: TableData.References.Options): ColumnForeignKeyChangeInput;
|
|
@@ -756,7 +761,7 @@ interface MigrationInterfaceResult {
|
|
|
756
761
|
* @param up - migrate or rollback
|
|
757
762
|
* @param config - config of `rakeDb`
|
|
758
763
|
*/
|
|
759
|
-
declare const createMigrationInterface: (tx: Adapter, up: boolean, config: Pick<RakeDbConfig,
|
|
764
|
+
declare const createMigrationInterface: (tx: Adapter, up: boolean, config: Pick<RakeDbConfig, 'log' | 'logger'>) => MigrationInterfaceResult;
|
|
760
765
|
type MigrationAdapter = Adapter;
|
|
761
766
|
declare class Migration<CT = unknown> {
|
|
762
767
|
adapter: MigrationAdapter;
|
|
@@ -1729,10 +1734,7 @@ interface RakeDbCtx {
|
|
|
1729
1734
|
migrationsPromise?: Promise<MigrationsSet>;
|
|
1730
1735
|
}
|
|
1731
1736
|
declare const getSchemaAndTableFromName: (schema: QuerySchema | undefined, name: string) => [string | undefined, string];
|
|
1732
|
-
declare const concatSchemaAndName: ({
|
|
1733
|
-
schema,
|
|
1734
|
-
name
|
|
1735
|
-
}: {
|
|
1737
|
+
declare const concatSchemaAndName: ({ schema, name }: {
|
|
1736
1738
|
schema?: string;
|
|
1737
1739
|
name: string;
|
|
1738
1740
|
}, excludeCurrentSchema?: string) => string;
|
|
@@ -1759,7 +1761,7 @@ interface OrmParam {
|
|
|
1759
1761
|
$getAdapter(): Adapter;
|
|
1760
1762
|
}
|
|
1761
1763
|
type DbParam = OrmParam | Adapter;
|
|
1762
|
-
declare const saveMigratedVersion: (db: SilentQueries, version: string, name: string, config: Pick<RakeDbConfig,
|
|
1764
|
+
declare const saveMigratedVersion: (db: SilentQueries, version: string, name: string, config: Pick<RakeDbConfig, 'migrationsTable'>) => Promise<void>;
|
|
1763
1765
|
declare const createMigrationsSchemaAndTable: (db: DbParam, config: {
|
|
1764
1766
|
migrationsTable: string;
|
|
1765
1767
|
logger?: QueryLogger;
|
|
@@ -1786,6 +1788,7 @@ interface MigrateConfigBase extends QueryLogOptions {
|
|
|
1786
1788
|
snakeCase?: boolean;
|
|
1787
1789
|
language?: string;
|
|
1788
1790
|
noPrimaryKey?: NoPrimaryKeyOption;
|
|
1791
|
+
defineTable?: RakeDbDefineTable<unknown>;
|
|
1789
1792
|
baseTable?: RakeDbBaseTable<unknown>;
|
|
1790
1793
|
}
|
|
1791
1794
|
interface MigrateConfigFileBased extends MigrateConfigBase {
|
|
@@ -1881,6 +1884,7 @@ interface MigrationsSet {
|
|
|
1881
1884
|
type SearchPath = (() => string) | string;
|
|
1882
1885
|
interface RakeDbCliConfigInputBase<SchemaConfig extends ColumnSchemaConfig, CT = DefaultColumnTypes<DefaultSchemaConfig>> extends QueryLogOptions {
|
|
1883
1886
|
columnTypes?: CT | ((t: DefaultColumnTypes<DefaultSchemaConfig>) => CT);
|
|
1887
|
+
defineTable?: RakeDbDefineTable<CT>;
|
|
1884
1888
|
baseTable?: RakeDbBaseTable<CT>;
|
|
1885
1889
|
schemaConfig?: SchemaConfig;
|
|
1886
1890
|
basePath?: string;
|
|
@@ -2007,21 +2011,22 @@ interface RakeDbConfig<ColumnTypes = unknown> extends QueryLogOptions {
|
|
|
2007
2011
|
renameMigrations?: RakeDbRenameMigrationsInput;
|
|
2008
2012
|
language?: string;
|
|
2009
2013
|
noPrimaryKey?: NoPrimaryKeyOption;
|
|
2014
|
+
defineTable?: RakeDbDefineTable<unknown>;
|
|
2010
2015
|
baseTable?: RakeDbBaseTable<unknown>;
|
|
2011
2016
|
commands: RakeDbCommands;
|
|
2012
2017
|
}
|
|
2013
2018
|
declare const rakeDbConfigDefaults: {
|
|
2019
|
+
migrationId: {
|
|
2020
|
+
serial: number;
|
|
2021
|
+
};
|
|
2022
|
+
migrationsTable: string;
|
|
2023
|
+
transaction: string;
|
|
2014
2024
|
schemaConfig: DefaultSchemaConfig;
|
|
2015
2025
|
snakeCase: boolean;
|
|
2016
2026
|
commands: {};
|
|
2017
2027
|
log: boolean;
|
|
2018
2028
|
logger: Console;
|
|
2019
2029
|
import(): never;
|
|
2020
|
-
migrationId: {
|
|
2021
|
-
serial: number;
|
|
2022
|
-
};
|
|
2023
|
-
migrationsTable: string;
|
|
2024
|
-
transaction: string;
|
|
2025
2030
|
};
|
|
2026
2031
|
interface RakeDbCommandFn {
|
|
2027
2032
|
(adapters: Adapter[], config: RakeDbConfig, args: string[]): MaybePromise<unknown>;
|
|
@@ -2066,6 +2071,58 @@ interface RakeDbBaseTable<CT> {
|
|
|
2066
2071
|
language?: string;
|
|
2067
2072
|
};
|
|
2068
2073
|
}
|
|
2074
|
+
interface RakeDbDefineTable<CT> {
|
|
2075
|
+
/**
|
|
2076
|
+
* Export name configured for this table factory.
|
|
2077
|
+
*/
|
|
2078
|
+
exportAs: string;
|
|
2079
|
+
/**
|
|
2080
|
+
* Returns the source file path for imports generated by rake-db.
|
|
2081
|
+
*/
|
|
2082
|
+
getFilePath(): string;
|
|
2083
|
+
/**
|
|
2084
|
+
* Column types configured for this table factory.
|
|
2085
|
+
*/
|
|
2086
|
+
types: CT;
|
|
2087
|
+
/**
|
|
2088
|
+
* Custom timestamp SQL configured for this table factory.
|
|
2089
|
+
*/
|
|
2090
|
+
nowSQL?: string;
|
|
2091
|
+
/**
|
|
2092
|
+
* Whether this table factory maps columns and table names to snake case.
|
|
2093
|
+
*/
|
|
2094
|
+
snakeCase?: boolean;
|
|
2095
|
+
/**
|
|
2096
|
+
* Default full text search language configured for this table factory.
|
|
2097
|
+
*/
|
|
2098
|
+
language?: string;
|
|
2099
|
+
}
|
|
2100
|
+
interface RakeDbTableFactoryConfig<CT> {
|
|
2101
|
+
/**
|
|
2102
|
+
* Export name configured for this table factory.
|
|
2103
|
+
*/
|
|
2104
|
+
exportAs: string;
|
|
2105
|
+
/**
|
|
2106
|
+
* Returns the source file path for imports generated by rake-db.
|
|
2107
|
+
*/
|
|
2108
|
+
getFilePath(): string;
|
|
2109
|
+
/**
|
|
2110
|
+
* Column types configured for this table factory.
|
|
2111
|
+
*/
|
|
2112
|
+
columnTypes: CT;
|
|
2113
|
+
/**
|
|
2114
|
+
* Custom timestamp SQL configured for this table factory.
|
|
2115
|
+
*/
|
|
2116
|
+
nowSQL?: string;
|
|
2117
|
+
/**
|
|
2118
|
+
* Whether this table factory maps columns and table names to snake case.
|
|
2119
|
+
*/
|
|
2120
|
+
snakeCase?: boolean;
|
|
2121
|
+
/**
|
|
2122
|
+
* Default full text search language configured for this table factory.
|
|
2123
|
+
*/
|
|
2124
|
+
language?: string;
|
|
2125
|
+
}
|
|
2069
2126
|
interface ModuleExportsRecord {
|
|
2070
2127
|
[fileName: string]: () => Promise<unknown>;
|
|
2071
2128
|
}
|
|
@@ -2118,12 +2175,7 @@ declare const getMigrationsSchemaAndTable: (adapter: Adapter, config: {
|
|
|
2118
2175
|
schema?: string;
|
|
2119
2176
|
table: string;
|
|
2120
2177
|
};
|
|
2121
|
-
declare const promptSelect: ({
|
|
2122
|
-
message,
|
|
2123
|
-
options,
|
|
2124
|
-
active,
|
|
2125
|
-
inactive
|
|
2126
|
-
}: {
|
|
2178
|
+
declare const promptSelect: ({ message, options, active, inactive }: {
|
|
2127
2179
|
message: string;
|
|
2128
2180
|
options: string[];
|
|
2129
2181
|
active?: (s: string) => string;
|
|
@@ -2144,15 +2196,12 @@ interface StructureToAstTableData {
|
|
|
2144
2196
|
constraints: DbStructure.Constraint[];
|
|
2145
2197
|
roles?: DbStructure.Role[];
|
|
2146
2198
|
}
|
|
2147
|
-
declare const makeStructureToAstCtx: (config: Pick<RakeDbConfig,
|
|
2148
|
-
declare const structureToAst: (ctx: StructureToAstCtx, adapter: Adapter, config: Pick<RakeDbConfig,
|
|
2199
|
+
declare const makeStructureToAstCtx: (config: Pick<RakeDbConfig, 'snakeCase' | 'schemaConfig'>, currentSchema: string) => StructureToAstCtx;
|
|
2200
|
+
declare const structureToAst: (ctx: StructureToAstCtx, adapter: Adapter, config: Pick<RakeDbConfig, 'migrationsTable'>) => Promise<RakeDbAst[]>;
|
|
2149
2201
|
declare const makeDomainsMap: (ctx: StructureToAstCtx, data: IntrospectedStructure) => DbStructureDomainsMap;
|
|
2150
2202
|
declare const instantiateDbColumn: (ctx: StructureToAstCtx, data: IntrospectedStructure, domains: DbStructureDomainsMap, dbColumn: DbStructure.Column) => Column$1;
|
|
2151
|
-
declare const tableToAst: (ctx: StructureToAstCtx, data: IntrospectedStructure, table: DbStructure.Table, action:
|
|
2152
|
-
declare const getDbStructureTableData: (data: IntrospectedStructure, {
|
|
2153
|
-
name,
|
|
2154
|
-
schemaName
|
|
2155
|
-
}: DbStructure.Table) => StructureToAstTableData;
|
|
2203
|
+
declare const tableToAst: (ctx: StructureToAstCtx, data: IntrospectedStructure, table: DbStructure.Table, action: 'create' | 'drop', domains: DbStructureDomainsMap) => RakeDbAst.Table;
|
|
2204
|
+
declare const getDbStructureTableData: (data: IntrospectedStructure, { name, schemaName }: DbStructure.Table) => StructureToAstTableData;
|
|
2156
2205
|
interface ColumnChecks {
|
|
2157
2206
|
[K: string]: string[];
|
|
2158
2207
|
}
|
|
@@ -2178,10 +2227,7 @@ type CreateOrDropOk = 'done' | 'already';
|
|
|
2178
2227
|
* });
|
|
2179
2228
|
* ```
|
|
2180
2229
|
*/
|
|
2181
|
-
declare const createDatabase: (db: DbParam, {
|
|
2182
|
-
database,
|
|
2183
|
-
owner
|
|
2184
|
-
}: {
|
|
2230
|
+
declare const createDatabase: (db: DbParam, { database, owner }: {
|
|
2185
2231
|
database: string;
|
|
2186
2232
|
owner?: string;
|
|
2187
2233
|
}) => Promise<CreateOrDropOk>;
|
|
@@ -2204,9 +2250,7 @@ declare const createDatabase: (db: DbParam, {
|
|
|
2204
2250
|
* });
|
|
2205
2251
|
* ```
|
|
2206
2252
|
*/
|
|
2207
|
-
declare const dropDatabase: (db: DbParam, {
|
|
2208
|
-
database
|
|
2209
|
-
}: {
|
|
2253
|
+
declare const dropDatabase: (db: DbParam, { database }: {
|
|
2210
2254
|
database: string;
|
|
2211
2255
|
}) => Promise<CreateOrDropOk>;
|
|
2212
2256
|
/**
|
|
@@ -2220,7 +2264,7 @@ declare const dropDatabase: (db: DbParam, {
|
|
|
2220
2264
|
* const result: 'done' | 'already' = await createSchema(db, '"schema"');
|
|
2221
2265
|
* ```
|
|
2222
2266
|
*/
|
|
2223
|
-
declare const createSchema: (db: DbParam, sql: string) => Promise<
|
|
2267
|
+
declare const createSchema: (db: DbParam, sql: string) => Promise<'done' | 'already'>;
|
|
2224
2268
|
/**
|
|
2225
2269
|
* `dropSchema` uses a savepoint when it is called in a transaction to not break it if the schema does not exist.
|
|
2226
2270
|
*
|
|
@@ -2232,7 +2276,7 @@ declare const createSchema: (db: DbParam, sql: string) => Promise<"done" | "alre
|
|
|
2232
2276
|
* const result: 'done' | 'already' = await dropSchema(db, '"schema"');
|
|
2233
2277
|
* ```
|
|
2234
2278
|
*/
|
|
2235
|
-
declare const dropSchema: (db: DbParam, sql: string) => Promise<
|
|
2279
|
+
declare const dropSchema: (db: DbParam, sql: string) => Promise<'done' | 'already'>;
|
|
2236
2280
|
/**
|
|
2237
2281
|
* `createTable` uses a savepoint when it is called in a transaction to not break it if the table already exists.
|
|
2238
2282
|
*
|
|
@@ -2244,7 +2288,7 @@ declare const dropSchema: (db: DbParam, sql: string) => Promise<"done" | "alread
|
|
|
2244
2288
|
* const result: 'done' | 'already' = await createTable(db, '"table"');
|
|
2245
2289
|
* ```
|
|
2246
2290
|
*/
|
|
2247
|
-
declare const createTable: (db: DbParam, sql: string) => Promise<
|
|
2291
|
+
declare const createTable: (db: DbParam, sql: string) => Promise<'done' | 'already'>;
|
|
2248
2292
|
/**
|
|
2249
2293
|
* `dropTable` uses a savepoint when it is called in a transaction to not break it if the table does not exist.
|
|
2250
2294
|
*
|
|
@@ -2256,6 +2300,17 @@ declare const createTable: (db: DbParam, sql: string) => Promise<"done" | "alrea
|
|
|
2256
2300
|
* const result: 'done' | 'already' = await dropTable(db, '"table"');
|
|
2257
2301
|
* ```
|
|
2258
2302
|
*/
|
|
2259
|
-
declare const dropTable: (db: DbParam, sql: string) => Promise<
|
|
2303
|
+
declare const dropTable: (db: DbParam, sql: string) => Promise<'done' | 'already'>;
|
|
2304
|
+
interface RakeDbTableFactoryConfigInput<CT> {
|
|
2305
|
+
/**
|
|
2306
|
+
* Function-style table factory metadata.
|
|
2307
|
+
*/
|
|
2308
|
+
defineTable?: RakeDbDefineTable<CT>;
|
|
2309
|
+
/**
|
|
2310
|
+
* Class-style base table metadata.
|
|
2311
|
+
*/
|
|
2312
|
+
baseTable?: RakeDbBaseTable<CT>;
|
|
2313
|
+
}
|
|
2314
|
+
declare const getTableFactoryConfig: <CT>({ baseTable, defineTable }: RakeDbTableFactoryConfigInput<CT>) => RakeDbTableFactoryConfig<CT> | undefined;
|
|
2260
2315
|
declare class RakeDbError extends Error {}
|
|
2261
|
-
export { type ChangeCallback, type DbMigration, type DbStructure, type IntrospectedStructure, type MigrateConfig, type MigrateFn, type MigrationChangeFn, type RakeDbAst, type RakeDbChangeFnConfig, type RakeDbCliConfigInput, type RakeDbCliResult, type RakeDbConfig, RakeDbError, type RakeDbFn, type SilentQueries, type StructureToAstCtx, type StructureToAstTableData, astToMigration, concatSchemaAndName, createDatabase, createMigrationChangeFn, createMigrationInterface, createMigrationsSchemaAndTable, createSchema, createTable, dbColumnToAst, dropDatabase, dropSchema, dropTable, encodeColumnDefault, getConstraintName, getDbStructureTableData, getDbTableColumnsChecks, getDbVersion, getExcludeName, getIndexName, getMigrationsSchemaAndTable, getSchemaAndTableFromName, incrementIntermediateCaller, instantiateDbColumn, introspectDbSchema, makeDomainsMap, makeFileVersion, makeStructureToAstCtx, migrate, migrateAndClose, promptSelect, rakeDbCliWithAdapter, rakeDbCommands, rakeDbConfigDefaults, redo, rollback, runMigration, saveMigratedVersion, setRakeDbCliRunFn, structureToAst, tableToAst, writeMigrationFile };
|
|
2316
|
+
export { type ChangeCallback, type DbMigration, type DbStructure, type IntrospectedStructure, type MigrateConfig, type MigrateFn, type MigrationChangeFn, type RakeDbAst, type RakeDbBaseTable, type RakeDbChangeFnConfig, type RakeDbCliConfigInput, type RakeDbCliResult, type RakeDbConfig, type RakeDbDefineTable, RakeDbError, type RakeDbFn, type SilentQueries, type StructureToAstCtx, type StructureToAstTableData, astToMigration, concatSchemaAndName, createDatabase, createMigrationChangeFn, createMigrationInterface, createMigrationsSchemaAndTable, createSchema, createTable, dbColumnToAst, dropDatabase, dropSchema, dropTable, encodeColumnDefault, getConstraintName, getDbStructureTableData, getDbTableColumnsChecks, getDbVersion, getExcludeName, getIndexName, getMigrationsSchemaAndTable, getSchemaAndTableFromName, getTableFactoryConfig, incrementIntermediateCaller, instantiateDbColumn, introspectDbSchema, makeDomainsMap, makeFileVersion, makeStructureToAstCtx, migrate, migrateAndClose, promptSelect, rakeDbCliWithAdapter, rakeDbCommands, rakeDbConfigDefaults, redo, rollback, runMigration, saveMigratedVersion, setRakeDbCliRunFn, structureToAst, tableToAst, writeMigrationFile };
|