arkormx 2.10.1 → 2.10.2
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/cli.mjs +67 -4
- package/dist/{index-GhBV8Kyw.d.cts → index-CGawfwb8.d.cts} +66 -6
- package/dist/{index-ufenXVzx.d.mts → index-ClVzjhGq.d.mts} +66 -6
- package/dist/index.cjs +77 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +77 -5
- package/dist/relationship/index.cjs +1 -1
- package/dist/relationship/index.d.cts +1 -1
- package/dist/relationship/index.d.mts +1 -1
- package/dist/relationship/index.mjs +1 -1
- package/dist/{relationship-DGOpcWA0.cjs → relationship-DWtfgLfh.cjs} +59 -4
- package/dist/{relationship-CmhzOlEo.mjs → relationship-SFhKrphd.mjs} +59 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -455,6 +455,15 @@ var EnumBuilder = class {
|
|
|
455
455
|
this.tableBuilder.map(name, this.columnName);
|
|
456
456
|
return this;
|
|
457
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
460
|
+
*
|
|
461
|
+
* @returns
|
|
462
|
+
*/
|
|
463
|
+
change() {
|
|
464
|
+
this.tableBuilder.change(this.columnName);
|
|
465
|
+
return this;
|
|
466
|
+
}
|
|
458
467
|
};
|
|
459
468
|
/**
|
|
460
469
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -467,6 +476,7 @@ var TableBuilder = class {
|
|
|
467
476
|
constructor() {
|
|
468
477
|
this.columns = [];
|
|
469
478
|
this.dropColumnNames = [];
|
|
479
|
+
this.changeColumnNames = /* @__PURE__ */ new Set();
|
|
470
480
|
this.indexes = [];
|
|
471
481
|
this.foreignKeys = [];
|
|
472
482
|
this.compositeUniqueConstraints = [];
|
|
@@ -780,6 +790,24 @@ var TableBuilder = class {
|
|
|
780
790
|
return this;
|
|
781
791
|
}
|
|
782
792
|
/**
|
|
793
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
794
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
795
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
796
|
+
*
|
|
797
|
+
* ```ts
|
|
798
|
+
* table.string('status').default('active').change()
|
|
799
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
800
|
+
* ```
|
|
801
|
+
*
|
|
802
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
803
|
+
* @returns The current TableBuilder instance for chaining.
|
|
804
|
+
*/
|
|
805
|
+
change(columnName) {
|
|
806
|
+
const column = this.resolveColumn(columnName);
|
|
807
|
+
this.changeColumnNames.add(column.name);
|
|
808
|
+
return this;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
783
811
|
* Marks a column as nullable.
|
|
784
812
|
*
|
|
785
813
|
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
@@ -888,7 +916,18 @@ var TableBuilder = class {
|
|
|
888
916
|
* @returns
|
|
889
917
|
*/
|
|
890
918
|
getColumns() {
|
|
891
|
-
return this.columns.map((column) => ({
|
|
919
|
+
return this.columns.filter((column) => !this.changeColumnNames.has(column.name)).map((column) => ({
|
|
920
|
+
...column,
|
|
921
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
922
|
+
}));
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
926
|
+
*
|
|
927
|
+
* @returns
|
|
928
|
+
*/
|
|
929
|
+
getChangeColumns() {
|
|
930
|
+
return this.columns.filter((column) => this.changeColumnNames.has(column.name)).map((column) => ({
|
|
892
931
|
...column,
|
|
893
932
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
894
933
|
}));
|
|
@@ -1110,6 +1149,7 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1110
1149
|
type: "alterTable",
|
|
1111
1150
|
table,
|
|
1112
1151
|
addColumns: builder.getColumns(),
|
|
1152
|
+
changeColumns: builder.getChangeColumns(),
|
|
1113
1153
|
dropColumns: builder.getDropColumns(),
|
|
1114
1154
|
addIndexes: builder.getIndexes(),
|
|
1115
1155
|
addForeignKeys: builder.getForeignKeys(),
|
|
@@ -1164,6 +1204,10 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1164
1204
|
...column,
|
|
1165
1205
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1166
1206
|
})),
|
|
1207
|
+
changeColumns: operation.changeColumns?.map((column) => ({
|
|
1208
|
+
...column,
|
|
1209
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1210
|
+
})),
|
|
1167
1211
|
dropColumns: [...operation.dropColumns],
|
|
1168
1212
|
addIndexes: operation.addIndexes.map((index) => ({
|
|
1169
1213
|
...index,
|
|
@@ -1667,11 +1711,18 @@ const applyCreateTableOperation = (schema, operation) => {
|
|
|
1667
1711
|
const applyAlterTableOperation = (schema, operation) => {
|
|
1668
1712
|
const model = findModelBlock(schema, operation.table);
|
|
1669
1713
|
if (!model) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
1670
|
-
const schemaWithEnums = ensureEnumBlocks(schema, operation.addColumns);
|
|
1714
|
+
const schemaWithEnums = ensureEnumBlocks(schema, [...operation.addColumns, ...operation.changeColumns ?? []]);
|
|
1671
1715
|
const refreshedModel = findModelBlock(schemaWithEnums, operation.table);
|
|
1672
1716
|
if (!refreshedModel) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
1673
1717
|
let block = refreshedModel.block;
|
|
1674
1718
|
const bodyLines = block.split("\n");
|
|
1719
|
+
(operation.changeColumns ?? []).forEach((column) => {
|
|
1720
|
+
const fieldLine = buildFieldLine(column);
|
|
1721
|
+
const columnRegex = new RegExp(`^\\s*${escapeRegex(column.name)}\\s+`);
|
|
1722
|
+
const index = bodyLines.findIndex((line) => columnRegex.test(line));
|
|
1723
|
+
if (index >= 0) bodyLines.splice(index, 1, fieldLine);
|
|
1724
|
+
else bodyLines.splice(Math.max(1, bodyLines.length - 1), 0, fieldLine);
|
|
1725
|
+
});
|
|
1675
1726
|
operation.dropColumns.forEach((column) => {
|
|
1676
1727
|
const columnRegex = new RegExp(`^\\s*${escapeRegex(column)}\\s+`);
|
|
1677
1728
|
for (let index = 0; index < bodyLines.length; index += 1) if (columnRegex.test(bodyLines[index])) {
|
|
@@ -1896,14 +1947,18 @@ const stripPrismaSchemaModelsAndEnums = (schema) => {
|
|
|
1896
1947
|
};
|
|
1897
1948
|
const applyMigrationToDatabase = async (adapter, migration) => {
|
|
1898
1949
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
1899
|
-
const
|
|
1950
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
1951
|
+
const operations = await getMigrationPlan(instance, "up");
|
|
1900
1952
|
await adapter.executeSchemaOperations(operations);
|
|
1953
|
+
await instance.done?.("up");
|
|
1901
1954
|
return { operations };
|
|
1902
1955
|
};
|
|
1903
1956
|
const applyMigrationRollbackToDatabase = async (adapter, migration) => {
|
|
1904
1957
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
1905
|
-
const
|
|
1958
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
1959
|
+
const operations = await getMigrationPlan(instance, "down");
|
|
1906
1960
|
await adapter.executeSchemaOperations(operations);
|
|
1961
|
+
await instance.done?.("down");
|
|
1907
1962
|
return { operations };
|
|
1908
1963
|
};
|
|
1909
1964
|
/**
|
|
@@ -4173,6 +4228,14 @@ var Migration = class {
|
|
|
4173
4228
|
static {
|
|
4174
4229
|
this[MIGRATION_BRAND] = true;
|
|
4175
4230
|
}
|
|
4231
|
+
/**
|
|
4232
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
4233
|
+
* have been applied to the database, for either direction. Override it to run
|
|
4234
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
4235
|
+
*
|
|
4236
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
4237
|
+
*/
|
|
4238
|
+
done(_direction) {}
|
|
4176
4239
|
};
|
|
4177
4240
|
|
|
4178
4241
|
//#endregion
|
|
@@ -70,6 +70,8 @@ interface SchemaTableAlterOperation {
|
|
|
70
70
|
type: 'alterTable';
|
|
71
71
|
table: string;
|
|
72
72
|
addColumns: SchemaColumn[];
|
|
73
|
+
/** Columns whose definition (type, nullability, default, enum values) is being redefined in place. */
|
|
74
|
+
changeColumns?: SchemaColumn[];
|
|
73
75
|
dropColumns: string[];
|
|
74
76
|
addIndexes: SchemaIndex[];
|
|
75
77
|
addForeignKeys: SchemaForeignKey[];
|
|
@@ -106,6 +108,7 @@ interface PrismaMigrationWorkflowOptions extends PrismaSchemaSyncOptions {
|
|
|
106
108
|
type MigrationInstanceLike = {
|
|
107
109
|
up: (...args: any[]) => Promise<void> | void;
|
|
108
110
|
down: (...args: any[]) => Promise<void> | void;
|
|
111
|
+
done?: (direction: 'up' | 'down') => Promise<void> | void;
|
|
109
112
|
};
|
|
110
113
|
interface AppliedMigrationEntry {
|
|
111
114
|
id: string;
|
|
@@ -2632,6 +2635,17 @@ declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<strin
|
|
|
2632
2635
|
*/
|
|
2633
2636
|
fill(attributes: Partial<TAttributes>): this;
|
|
2634
2637
|
fill(attributes: Record<string, unknown>): this;
|
|
2638
|
+
/**
|
|
2639
|
+
* Merge already-stored (database representation) attribute values into the
|
|
2640
|
+
* model without running set mutators or casts. Used to refresh the instance
|
|
2641
|
+
* from a row returned by a write, where the values are already in storage
|
|
2642
|
+
* form and must not be re-cast (re-applying a non-idempotent set-cast such as
|
|
2643
|
+
* a money or array cast would corrupt the value).
|
|
2644
|
+
*
|
|
2645
|
+
* @param attributes
|
|
2646
|
+
* @returns
|
|
2647
|
+
*/
|
|
2648
|
+
protected fillRawAttributes(attributes: Record<string, unknown>): this;
|
|
2635
2649
|
/**
|
|
2636
2650
|
* Update the model's state in the database using data from a plain object.
|
|
2637
2651
|
* If the model has no identifier (id), the process will be skipped and the
|
|
@@ -5478,6 +5492,17 @@ declare class KyselyDatabaseAdapter implements DatabaseAdapter {
|
|
|
5478
5492
|
private ensureEnumTypes;
|
|
5479
5493
|
private executeCreateTableOperation;
|
|
5480
5494
|
private executeAlterTableOperation;
|
|
5495
|
+
private enumTypeExists;
|
|
5496
|
+
/**
|
|
5497
|
+
* Redefine an existing column in place using ALTER COLUMN statements: the
|
|
5498
|
+
* column type (recreating the enum type when enum values change), nullability,
|
|
5499
|
+
* default, and a conventionally-named unique constraint.
|
|
5500
|
+
*
|
|
5501
|
+
* @param table
|
|
5502
|
+
* @param column
|
|
5503
|
+
* @param executor
|
|
5504
|
+
*/
|
|
5505
|
+
private executeChangeColumn;
|
|
5481
5506
|
private executeDropTableOperation;
|
|
5482
5507
|
private ensureMigrationStateTables;
|
|
5483
5508
|
private writeAppliedMigrationsStateInternal;
|
|
@@ -6693,6 +6718,12 @@ declare class EnumBuilder {
|
|
|
6693
6718
|
* @returns
|
|
6694
6719
|
*/
|
|
6695
6720
|
map(name: string): this;
|
|
6721
|
+
/**
|
|
6722
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
6723
|
+
*
|
|
6724
|
+
* @returns
|
|
6725
|
+
*/
|
|
6726
|
+
change(): this;
|
|
6696
6727
|
}
|
|
6697
6728
|
/**
|
|
6698
6729
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -6704,6 +6735,7 @@ declare class EnumBuilder {
|
|
|
6704
6735
|
declare class TableBuilder {
|
|
6705
6736
|
private readonly columns;
|
|
6706
6737
|
private readonly dropColumnNames;
|
|
6738
|
+
private readonly changeColumnNames;
|
|
6707
6739
|
private readonly indexes;
|
|
6708
6740
|
private readonly foreignKeys;
|
|
6709
6741
|
private readonly compositeUniqueConstraints;
|
|
@@ -6920,6 +6952,20 @@ declare class TableBuilder {
|
|
|
6920
6952
|
* @returns
|
|
6921
6953
|
*/
|
|
6922
6954
|
dropColumn(name: string): this;
|
|
6955
|
+
/**
|
|
6956
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
6957
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
6958
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
6959
|
+
*
|
|
6960
|
+
* ```ts
|
|
6961
|
+
* table.string('status').default('active').change()
|
|
6962
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
6963
|
+
* ```
|
|
6964
|
+
*
|
|
6965
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
6966
|
+
* @returns The current TableBuilder instance for chaining.
|
|
6967
|
+
*/
|
|
6968
|
+
change(columnName?: string): this;
|
|
6923
6969
|
/**
|
|
6924
6970
|
* Marks a column as nullable.
|
|
6925
6971
|
*
|
|
@@ -6988,6 +7034,12 @@ declare class TableBuilder {
|
|
|
6988
7034
|
* @returns
|
|
6989
7035
|
*/
|
|
6990
7036
|
getColumns(): SchemaColumn[];
|
|
7037
|
+
/**
|
|
7038
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
7039
|
+
*
|
|
7040
|
+
* @returns
|
|
7041
|
+
*/
|
|
7042
|
+
getChangeColumns(): SchemaColumn[];
|
|
6991
7043
|
/**
|
|
6992
7044
|
* Returns a copy of the defined column names to be dropped from the table.
|
|
6993
7045
|
*
|
|
@@ -7141,6 +7193,14 @@ declare abstract class Migration {
|
|
|
7141
7193
|
* @param schema A SchemaBuilder instance.
|
|
7142
7194
|
*/
|
|
7143
7195
|
abstract down(schema: SchemaBuilder): Promise<void> | void;
|
|
7196
|
+
/**
|
|
7197
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
7198
|
+
* have been applied to the database, for either direction. Override it to run
|
|
7199
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
7200
|
+
*
|
|
7201
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
7202
|
+
*/
|
|
7203
|
+
done(_direction: 'up' | 'down'): Promise<void> | void;
|
|
7144
7204
|
}
|
|
7145
7205
|
//#endregion
|
|
7146
7206
|
//#region src/DB.d.ts
|
|
@@ -7590,15 +7650,15 @@ declare const generateMigrationFile: (name: string, options?: GenerateMigrationO
|
|
|
7590
7650
|
* @param direction The direction of the migration to plan for ('up' or 'down').
|
|
7591
7651
|
* @returns A promise that resolves to an array of schema operations that would be performed.
|
|
7592
7652
|
*/
|
|
7593
|
-
declare const getMigrationPlan: (migration:
|
|
7653
|
+
declare const getMigrationPlan: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), direction?: "up" | "down") => Promise<SchemaOperation[]>;
|
|
7594
7654
|
declare const supportsDatabaseMigrationExecution: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "executeSchemaOperations">>;
|
|
7595
7655
|
declare const supportsDatabaseCreation: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "createDatabaseFromError">>;
|
|
7596
7656
|
declare const supportsDatabaseReset: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "resetDatabase">>;
|
|
7597
7657
|
declare const stripPrismaSchemaModelsAndEnums: (schema: string) => string;
|
|
7598
|
-
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration:
|
|
7658
|
+
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7599
7659
|
operations: SchemaOperation[];
|
|
7600
7660
|
}>;
|
|
7601
|
-
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration:
|
|
7661
|
+
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7602
7662
|
operations: SchemaOperation[];
|
|
7603
7663
|
}>;
|
|
7604
7664
|
/**
|
|
@@ -7610,7 +7670,7 @@ declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migra
|
|
|
7610
7670
|
* @param options Options for applying the migration, including schema path and write flag.
|
|
7611
7671
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and list of operations applied.
|
|
7612
7672
|
*/
|
|
7613
|
-
declare const applyMigrationToPrismaSchema: (migration:
|
|
7673
|
+
declare const applyMigrationToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7614
7674
|
schema: string;
|
|
7615
7675
|
schemaPath: string;
|
|
7616
7676
|
operations: SchemaOperation[];
|
|
@@ -7622,7 +7682,7 @@ declare const applyMigrationToPrismaSchema: (migration: Migration | (new () => M
|
|
|
7622
7682
|
* @param options Options for applying the rollback, including schema path and write flag.
|
|
7623
7683
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and rollback operations applied.
|
|
7624
7684
|
*/
|
|
7625
|
-
declare const applyMigrationRollbackToPrismaSchema: (migration:
|
|
7685
|
+
declare const applyMigrationRollbackToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7626
7686
|
schema: string;
|
|
7627
7687
|
schemaPath: string;
|
|
7628
7688
|
operations: SchemaOperation[];
|
|
@@ -7636,7 +7696,7 @@ declare const applyMigrationRollbackToPrismaSchema: (migration: Migration | (new
|
|
|
7636
7696
|
* @param options Options for running the migration, including schema path, write flag, and Prisma commands.
|
|
7637
7697
|
* @returns A promise that resolves to an object containing the schema path and list of operations applied.
|
|
7638
7698
|
*/
|
|
7639
|
-
declare const runMigrationWithPrisma: (migration:
|
|
7699
|
+
declare const runMigrationWithPrisma: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaMigrationWorkflowOptions) => Promise<{
|
|
7640
7700
|
schemaPath: string;
|
|
7641
7701
|
operations: SchemaOperation[];
|
|
7642
7702
|
}>;
|
|
@@ -70,6 +70,8 @@ interface SchemaTableAlterOperation {
|
|
|
70
70
|
type: 'alterTable';
|
|
71
71
|
table: string;
|
|
72
72
|
addColumns: SchemaColumn[];
|
|
73
|
+
/** Columns whose definition (type, nullability, default, enum values) is being redefined in place. */
|
|
74
|
+
changeColumns?: SchemaColumn[];
|
|
73
75
|
dropColumns: string[];
|
|
74
76
|
addIndexes: SchemaIndex[];
|
|
75
77
|
addForeignKeys: SchemaForeignKey[];
|
|
@@ -106,6 +108,7 @@ interface PrismaMigrationWorkflowOptions extends PrismaSchemaSyncOptions {
|
|
|
106
108
|
type MigrationInstanceLike = {
|
|
107
109
|
up: (...args: any[]) => Promise<void> | void;
|
|
108
110
|
down: (...args: any[]) => Promise<void> | void;
|
|
111
|
+
done?: (direction: 'up' | 'down') => Promise<void> | void;
|
|
109
112
|
};
|
|
110
113
|
interface AppliedMigrationEntry {
|
|
111
114
|
id: string;
|
|
@@ -2632,6 +2635,17 @@ declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<strin
|
|
|
2632
2635
|
*/
|
|
2633
2636
|
fill(attributes: Partial<TAttributes>): this;
|
|
2634
2637
|
fill(attributes: Record<string, unknown>): this;
|
|
2638
|
+
/**
|
|
2639
|
+
* Merge already-stored (database representation) attribute values into the
|
|
2640
|
+
* model without running set mutators or casts. Used to refresh the instance
|
|
2641
|
+
* from a row returned by a write, where the values are already in storage
|
|
2642
|
+
* form and must not be re-cast (re-applying a non-idempotent set-cast such as
|
|
2643
|
+
* a money or array cast would corrupt the value).
|
|
2644
|
+
*
|
|
2645
|
+
* @param attributes
|
|
2646
|
+
* @returns
|
|
2647
|
+
*/
|
|
2648
|
+
protected fillRawAttributes(attributes: Record<string, unknown>): this;
|
|
2635
2649
|
/**
|
|
2636
2650
|
* Update the model's state in the database using data from a plain object.
|
|
2637
2651
|
* If the model has no identifier (id), the process will be skipped and the
|
|
@@ -5478,6 +5492,17 @@ declare class KyselyDatabaseAdapter implements DatabaseAdapter {
|
|
|
5478
5492
|
private ensureEnumTypes;
|
|
5479
5493
|
private executeCreateTableOperation;
|
|
5480
5494
|
private executeAlterTableOperation;
|
|
5495
|
+
private enumTypeExists;
|
|
5496
|
+
/**
|
|
5497
|
+
* Redefine an existing column in place using ALTER COLUMN statements: the
|
|
5498
|
+
* column type (recreating the enum type when enum values change), nullability,
|
|
5499
|
+
* default, and a conventionally-named unique constraint.
|
|
5500
|
+
*
|
|
5501
|
+
* @param table
|
|
5502
|
+
* @param column
|
|
5503
|
+
* @param executor
|
|
5504
|
+
*/
|
|
5505
|
+
private executeChangeColumn;
|
|
5481
5506
|
private executeDropTableOperation;
|
|
5482
5507
|
private ensureMigrationStateTables;
|
|
5483
5508
|
private writeAppliedMigrationsStateInternal;
|
|
@@ -6693,6 +6718,12 @@ declare class EnumBuilder {
|
|
|
6693
6718
|
* @returns
|
|
6694
6719
|
*/
|
|
6695
6720
|
map(name: string): this;
|
|
6721
|
+
/**
|
|
6722
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
6723
|
+
*
|
|
6724
|
+
* @returns
|
|
6725
|
+
*/
|
|
6726
|
+
change(): this;
|
|
6696
6727
|
}
|
|
6697
6728
|
/**
|
|
6698
6729
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -6704,6 +6735,7 @@ declare class EnumBuilder {
|
|
|
6704
6735
|
declare class TableBuilder {
|
|
6705
6736
|
private readonly columns;
|
|
6706
6737
|
private readonly dropColumnNames;
|
|
6738
|
+
private readonly changeColumnNames;
|
|
6707
6739
|
private readonly indexes;
|
|
6708
6740
|
private readonly foreignKeys;
|
|
6709
6741
|
private readonly compositeUniqueConstraints;
|
|
@@ -6920,6 +6952,20 @@ declare class TableBuilder {
|
|
|
6920
6952
|
* @returns
|
|
6921
6953
|
*/
|
|
6922
6954
|
dropColumn(name: string): this;
|
|
6955
|
+
/**
|
|
6956
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
6957
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
6958
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
6959
|
+
*
|
|
6960
|
+
* ```ts
|
|
6961
|
+
* table.string('status').default('active').change()
|
|
6962
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
6963
|
+
* ```
|
|
6964
|
+
*
|
|
6965
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
6966
|
+
* @returns The current TableBuilder instance for chaining.
|
|
6967
|
+
*/
|
|
6968
|
+
change(columnName?: string): this;
|
|
6923
6969
|
/**
|
|
6924
6970
|
* Marks a column as nullable.
|
|
6925
6971
|
*
|
|
@@ -6988,6 +7034,12 @@ declare class TableBuilder {
|
|
|
6988
7034
|
* @returns
|
|
6989
7035
|
*/
|
|
6990
7036
|
getColumns(): SchemaColumn[];
|
|
7037
|
+
/**
|
|
7038
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
7039
|
+
*
|
|
7040
|
+
* @returns
|
|
7041
|
+
*/
|
|
7042
|
+
getChangeColumns(): SchemaColumn[];
|
|
6991
7043
|
/**
|
|
6992
7044
|
* Returns a copy of the defined column names to be dropped from the table.
|
|
6993
7045
|
*
|
|
@@ -7141,6 +7193,14 @@ declare abstract class Migration {
|
|
|
7141
7193
|
* @param schema A SchemaBuilder instance.
|
|
7142
7194
|
*/
|
|
7143
7195
|
abstract down(schema: SchemaBuilder): Promise<void> | void;
|
|
7196
|
+
/**
|
|
7197
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
7198
|
+
* have been applied to the database, for either direction. Override it to run
|
|
7199
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
7200
|
+
*
|
|
7201
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
7202
|
+
*/
|
|
7203
|
+
done(_direction: 'up' | 'down'): Promise<void> | void;
|
|
7144
7204
|
}
|
|
7145
7205
|
//#endregion
|
|
7146
7206
|
//#region src/DB.d.ts
|
|
@@ -7590,15 +7650,15 @@ declare const generateMigrationFile: (name: string, options?: GenerateMigrationO
|
|
|
7590
7650
|
* @param direction The direction of the migration to plan for ('up' or 'down').
|
|
7591
7651
|
* @returns A promise that resolves to an array of schema operations that would be performed.
|
|
7592
7652
|
*/
|
|
7593
|
-
declare const getMigrationPlan: (migration:
|
|
7653
|
+
declare const getMigrationPlan: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), direction?: "up" | "down") => Promise<SchemaOperation[]>;
|
|
7594
7654
|
declare const supportsDatabaseMigrationExecution: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "executeSchemaOperations">>;
|
|
7595
7655
|
declare const supportsDatabaseCreation: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "createDatabaseFromError">>;
|
|
7596
7656
|
declare const supportsDatabaseReset: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "resetDatabase">>;
|
|
7597
7657
|
declare const stripPrismaSchemaModelsAndEnums: (schema: string) => string;
|
|
7598
|
-
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration:
|
|
7658
|
+
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7599
7659
|
operations: SchemaOperation[];
|
|
7600
7660
|
}>;
|
|
7601
|
-
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration:
|
|
7661
|
+
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7602
7662
|
operations: SchemaOperation[];
|
|
7603
7663
|
}>;
|
|
7604
7664
|
/**
|
|
@@ -7610,7 +7670,7 @@ declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migra
|
|
|
7610
7670
|
* @param options Options for applying the migration, including schema path and write flag.
|
|
7611
7671
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and list of operations applied.
|
|
7612
7672
|
*/
|
|
7613
|
-
declare const applyMigrationToPrismaSchema: (migration:
|
|
7673
|
+
declare const applyMigrationToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7614
7674
|
schema: string;
|
|
7615
7675
|
schemaPath: string;
|
|
7616
7676
|
operations: SchemaOperation[];
|
|
@@ -7622,7 +7682,7 @@ declare const applyMigrationToPrismaSchema: (migration: Migration | (new () => M
|
|
|
7622
7682
|
* @param options Options for applying the rollback, including schema path and write flag.
|
|
7623
7683
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and rollback operations applied.
|
|
7624
7684
|
*/
|
|
7625
|
-
declare const applyMigrationRollbackToPrismaSchema: (migration:
|
|
7685
|
+
declare const applyMigrationRollbackToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7626
7686
|
schema: string;
|
|
7627
7687
|
schemaPath: string;
|
|
7628
7688
|
operations: SchemaOperation[];
|
|
@@ -7636,7 +7696,7 @@ declare const applyMigrationRollbackToPrismaSchema: (migration: Migration | (new
|
|
|
7636
7696
|
* @param options Options for running the migration, including schema path, write flag, and Prisma commands.
|
|
7637
7697
|
* @returns A promise that resolves to an object containing the schema path and list of operations applied.
|
|
7638
7698
|
*/
|
|
7639
|
-
declare const runMigrationWithPrisma: (migration:
|
|
7699
|
+
declare const runMigrationWithPrisma: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaMigrationWorkflowOptions) => Promise<{
|
|
7640
7700
|
schemaPath: string;
|
|
7641
7701
|
operations: SchemaOperation[];
|
|
7642
7702
|
}>;
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_relationship = require('./relationship-
|
|
2
|
+
const require_relationship = require('./relationship-DWtfgLfh.cjs');
|
|
3
3
|
let pg = require("pg");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
let module$1 = require("module");
|
|
@@ -451,12 +451,60 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
451
451
|
const table = this.resolveMappedTable(operation.table);
|
|
452
452
|
await this.ensureEnumTypes(table, operation.addColumns, executor);
|
|
453
453
|
for (const column of operation.addColumns) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add column if not exists ${this.buildSchemaColumnDefinition(table, column)}`, executor);
|
|
454
|
+
for (const column of operation.changeColumns ?? []) await this.executeChangeColumn(table, column, executor);
|
|
454
455
|
for (const column of operation.dropColumns) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} drop column if exists ${this.quoteIdentifier(column)}`, executor);
|
|
455
456
|
for (const foreignKey of operation.addForeignKeys ?? []) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaForeignKeyConstraint(table, foreignKey, operation.addColumns)}`, executor);
|
|
456
457
|
if (operation.addPrimaryKey) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaPrimaryKeyConstraint(table, operation.addPrimaryKey, operation.addColumns)}`, executor);
|
|
457
458
|
for (const constraint of operation.addUniqueConstraints ?? []) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaUniqueConstraint(table, constraint, operation.addColumns)}`, executor);
|
|
458
459
|
for (const index of operation.addIndexes ?? []) await this.executeRawStatement(this.buildSchemaIndexStatement(table, index, operation.addColumns), executor);
|
|
459
460
|
}
|
|
461
|
+
async enumTypeExists(enumName, executor) {
|
|
462
|
+
const result = await kysely.sql`
|
|
463
|
+
select exists(select 1 from pg_type where typname = ${enumName}) as exists
|
|
464
|
+
`.execute(executor);
|
|
465
|
+
return Boolean(result.rows[0]?.exists);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Redefine an existing column in place using ALTER COLUMN statements: the
|
|
469
|
+
* column type (recreating the enum type when enum values change), nullability,
|
|
470
|
+
* default, and a conventionally-named unique constraint.
|
|
471
|
+
*
|
|
472
|
+
* @param table
|
|
473
|
+
* @param column
|
|
474
|
+
* @param executor
|
|
475
|
+
*/
|
|
476
|
+
async executeChangeColumn(table, column, executor) {
|
|
477
|
+
const quotedTable = this.quoteIdentifier(table);
|
|
478
|
+
const physicalName = column.map ?? column.name;
|
|
479
|
+
const physical = this.quoteIdentifier(physicalName);
|
|
480
|
+
if (column.type === "enum") {
|
|
481
|
+
const enumName = this.resolveSchemaEnumName(table, column);
|
|
482
|
+
const values = column.enumValues ?? [];
|
|
483
|
+
if (values.length === 0) throw new require_relationship.ArkormException(`Enum column [${column.name}] requires enum values to change its definition.`);
|
|
484
|
+
const quotedEnum = this.quoteIdentifier(enumName);
|
|
485
|
+
const enumLiterals = values.map((value) => this.quoteLiteral(value)).join(", ");
|
|
486
|
+
if (await this.enumTypeExists(enumName, executor)) {
|
|
487
|
+
const tempEnum = this.quoteIdentifier(`${enumName}__arkorm_change`);
|
|
488
|
+
await this.executeRawStatement(`drop type if exists ${tempEnum}`, executor);
|
|
489
|
+
await this.executeRawStatement(`alter type ${quotedEnum} rename to ${tempEnum}`, executor);
|
|
490
|
+
await this.executeRawStatement(`create type ${quotedEnum} as enum (${enumLiterals})`, executor);
|
|
491
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${quotedEnum} using ${physical}::text::${quotedEnum}`, executor);
|
|
492
|
+
await this.executeRawStatement(`drop type ${tempEnum}`, executor);
|
|
493
|
+
} else {
|
|
494
|
+
await this.executeRawStatement(`create type ${quotedEnum} as enum (${enumLiterals})`, executor);
|
|
495
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${quotedEnum} using ${physical}::text::${quotedEnum}`, executor);
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
498
|
+
const targetType = this.resolveSchemaColumnType(table, column);
|
|
499
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${targetType} using ${physical}::${targetType}`, executor);
|
|
500
|
+
}
|
|
501
|
+
await this.executeRawStatement(column.nullable ? `alter table ${quotedTable} alter column ${physical} drop not null` : `alter table ${quotedTable} alter column ${physical} set not null`, executor);
|
|
502
|
+
const defaultValue = this.resolveSchemaColumnDefault(column);
|
|
503
|
+
await this.executeRawStatement(defaultValue ? `alter table ${quotedTable} alter column ${physical} set default ${defaultValue}` : `alter table ${quotedTable} alter column ${physical} drop default`, executor);
|
|
504
|
+
const constraint = this.quoteIdentifier(`${table}_${physicalName}_key`);
|
|
505
|
+
await this.executeRawStatement(`alter table ${quotedTable} drop constraint if exists ${constraint}`, executor);
|
|
506
|
+
if (column.unique) await this.executeRawStatement(`alter table ${quotedTable} add constraint ${constraint} unique (${physical})`, executor);
|
|
507
|
+
}
|
|
460
508
|
async executeDropTableOperation(operation, executor) {
|
|
461
509
|
const table = this.resolveMappedTable(operation.table);
|
|
462
510
|
await this.executeRawStatement(`drop table if exists ${this.quoteIdentifier(table)} cascade`, executor);
|
|
@@ -3326,6 +3374,14 @@ var Migration = class {
|
|
|
3326
3374
|
static {
|
|
3327
3375
|
this[MIGRATION_BRAND] = true;
|
|
3328
3376
|
}
|
|
3377
|
+
/**
|
|
3378
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
3379
|
+
* have been applied to the database, for either direction. Override it to run
|
|
3380
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
3381
|
+
*
|
|
3382
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
3383
|
+
*/
|
|
3384
|
+
done(_direction) {}
|
|
3329
3385
|
};
|
|
3330
3386
|
|
|
3331
3387
|
//#endregion
|
|
@@ -8191,6 +8247,22 @@ var Model = class Model {
|
|
|
8191
8247
|
});
|
|
8192
8248
|
return this;
|
|
8193
8249
|
}
|
|
8250
|
+
/**
|
|
8251
|
+
* Merge already-stored (database representation) attribute values into the
|
|
8252
|
+
* model without running set mutators or casts. Used to refresh the instance
|
|
8253
|
+
* from a row returned by a write, where the values are already in storage
|
|
8254
|
+
* form and must not be re-cast (re-applying a non-idempotent set-cast such as
|
|
8255
|
+
* a money or array cast would corrupt the value).
|
|
8256
|
+
*
|
|
8257
|
+
* @param attributes
|
|
8258
|
+
* @returns
|
|
8259
|
+
*/
|
|
8260
|
+
fillRawAttributes(attributes) {
|
|
8261
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
8262
|
+
this.attributes[key] = Model.cloneAttributeValue(value);
|
|
8263
|
+
});
|
|
8264
|
+
return this;
|
|
8265
|
+
}
|
|
8194
8266
|
async update(attributes) {
|
|
8195
8267
|
try {
|
|
8196
8268
|
const primaryKey = this.constructor.getPrimaryKey();
|
|
@@ -8246,7 +8318,7 @@ var Model = class Model {
|
|
|
8246
8318
|
await Model.dispatchEvent(constructor, "creating", this);
|
|
8247
8319
|
const payload = this.normalizePersistenceAttributes(this.getRawAttributes());
|
|
8248
8320
|
const model = await constructor.query().create(payload);
|
|
8249
|
-
this.
|
|
8321
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8250
8322
|
this.syncChanges(previousOriginal);
|
|
8251
8323
|
this.syncPrevious(previousOriginal);
|
|
8252
8324
|
this.syncOriginal();
|
|
@@ -8263,7 +8335,7 @@ var Model = class Model {
|
|
|
8263
8335
|
const payload = this.normalizePersistenceAttributes(this.getDirtyAttributes());
|
|
8264
8336
|
delete payload[primaryKey];
|
|
8265
8337
|
const model = await constructor.query().where({ [primaryKey]: identifier }).update(payload);
|
|
8266
|
-
this.
|
|
8338
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8267
8339
|
this.syncChanges(previousOriginal);
|
|
8268
8340
|
this.syncPrevious(previousOriginal);
|
|
8269
8341
|
this.syncOriginal();
|
|
@@ -8306,7 +8378,7 @@ var Model = class Model {
|
|
|
8306
8378
|
const softDeleteConfig = constructor.getSoftDeleteConfig();
|
|
8307
8379
|
if (softDeleteConfig.enabled) {
|
|
8308
8380
|
const model = await constructor.query().where({ [primaryKey]: identifier }).update({ [softDeleteConfig.column]: /* @__PURE__ */ new Date() });
|
|
8309
|
-
this.
|
|
8381
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8310
8382
|
this.syncChanges(previousOriginal);
|
|
8311
8383
|
this.syncOriginal();
|
|
8312
8384
|
await Model.dispatchEvent(constructor, "deleted", this);
|
|
@@ -8381,7 +8453,7 @@ var Model = class Model {
|
|
|
8381
8453
|
const previousOriginal = this.getOriginal();
|
|
8382
8454
|
await Model.dispatchEvent(constructor, "restoring", this);
|
|
8383
8455
|
const model = await constructor.query().withTrashed().where({ [primaryKey]: identifier }).update({ [softDeleteConfig.column]: null });
|
|
8384
|
-
this.
|
|
8456
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8385
8457
|
this.syncChanges(previousOriginal);
|
|
8386
8458
|
this.syncOriginal();
|
|
8387
8459
|
await Model.dispatchEvent(constructor, "restored", this);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildRelationLine, $a as DelegateForModelSchema, $i as EagerLoadConstraint, $n as RuntimePathMap, $o as RelatedModelFromResult, $r as QueryFullTextCondition, $s as TimestampNames, $t as getPersistedColumnMap, A as isTransactionCapableClient, Aa as QuerySchemaUniqueWhere, Ai as UpsertSpec, An as ForeignKeyBuilder, Ar as AdapterModelFieldStructure, As as RelationMetadataType, At as createEmptyAppliedMigrationsState, B as applyDropTableOperation, Ba as TransactionCapableClient, Bi as CastType, Bn as MakeFactoryCommand, Bo as RelationAggregateType, Br as DatabaseRow, Bs as PrismaSchemaSyncOptions, Bt as removeAppliedMigration, C as getRuntimeDebugHandler, Ca as QuerySchemaCreateData, Ci as RelationLoadPlan, Cn as ArkormException, Co as defineFactory, Cr as createPrismaDatabaseAdapter, Cs as ModelMetadata, Ct as supportsDatabaseMigrationExecution, D as getUserConfig, Da as QuerySchemaRow, Di as SortDirection, Dn as SchemaBuilder, Dr as AdapterCapability, Ds as MorphToRelationMetadata, Dt as buildMigrationIdentity, E as getRuntimePrismaClient, Ea as QuerySchemaOrderBy, Ei as SoftDeleteQueryMode, En as Migration, Er as AdapterCapabilities, Es as MorphToManyRelationMetadata, Et as toModelName, F as PRISMA_ENUM_MEMBER_REGEX, Fa as RuntimeClientLike, Fi as ArkormDebugEvent, Fn as MigrateFreshCommand, Fr as AggregateOperation, Fs as GeneratedMigrationFile, Ft as isMigrationApplied, G as applyOperationsToPrismaSchema, Ga as QueryBuilder, Gi as DelegateOrderBy, Gn as AttributeOptions, Go as RelationMetadataProvider, Gr as InsertManySpec, Gs as SchemaIndex, Gt as PersistedColumnMappingsState, H as applyMigrationRollbackToPrismaSchema, Ha as TransactionOptions, Hi as DelegateCreateData, Hn as CliApp, Ho as RelationConstraint, Hr as DatabaseValue, Hs as SchemaColumnType, Ht as supportsDatabaseMigrationState, I as PRISMA_ENUM_REGEX, Ia as Serializable, Ii as ArkormDebugHandler, In as MigrateCommand, Ir as AggregateSelection, Is as MigrationClass, It as markMigrationApplied, J as buildIndexLine, Ja as AttributeQuerySchema, Ji as DelegateSelect, Jn as RegisteredFactory, Jo as RelationTableLookupSpec, Jr as QueryComparisonCondition, Js as SchemaTableAlterOperation, Jt as PersistedTableMetadata, K as buildEnumBlock, Ka as AttributeCreateInput, Ki as DelegateRow, Kn as Arkorm, Ko as RelationResult, Kr as InsertSpec, Ks as SchemaOperation, Kt as PersistedMetadataFeatures, L as PRISMA_MODEL_REGEX, La as SimplePaginationMeta, Li as CastDefinition, Ln as MakeSeederCommand, Lr as AggregateSpec, Ls as MigrationInstanceLike, Lt as markMigrationRun, M as resetArkormRuntimeForTests, Ma as QuerySchemaUpdateData, Mi as AdapterQueryInspection, Mn as ModelsSyncCommand, Mr as AdapterModelStructure, Ms as AppliedMigrationRun, Mt as findAppliedMigration, N as runArkormTransaction, Na as QuerySchemaWhere, Ni as ArkormBootContext, Nn as MigrationHistoryCommand, Nr as AdapterQueryOperation, Ns as AppliedMigrationsState, Nt as getLastMigrationRun, O as isDelegateLike, Oa as QuerySchemaRows, Oi as UpdateManySpec, On as EnumBuilder, Or as AdapterDatabaseCreationResult, Os as PivotModelStatic, Ot as buildMigrationRunId, P as PrimaryKeyGenerationPlanner, Pa as RawSelectInput, Pi as ArkormConfig, Pn as MigrateRollbackCommand, Pr as AdapterTransactionContext, Ps as GenerateMigrationOptions, Pt as getLatestAppliedMigrations, Q as buildPrimaryKeyLine, Qa as AttributeWhereInput, Qi as DelegateWhere, Qn as RuntimePathKey, Qo as RelatedModelForRelationship, Qr as QueryExistsCondition, Qs as TimestampColumnBehavior, Qt as deletePersistedColumnMappingsState, R as applyAlterTableOperation, Ra as SoftDeleteConfig, Ri as CastHandler, Rn as MakeModelCommand, Ro as RelationAggregateConstraint, Rr as DatabaseAdapter, Rs as PrimaryKeyGeneration, Rt as readAppliedMigrationsState, S as getRuntimeClient, Sa as PrismaTransactionOptions, Si as RelationFilterSpec, Sn as ArkormErrorContext, So as ModelFactory, Sr as createPrismaCompatibilityAdapter, Ss as HasOneThroughRelationMetadata, St as supportsDatabaseCreation, T as getRuntimePaginationURLDriverFactory, Ta as QuerySchemaInclude, Ti as SelectSpec, Tn as MIGRATION_BRAND, Tr as createKyselyAdapter, Ts as MorphOneRelationMetadata, Tt as toMigrationFileSlug, U as applyMigrationToDatabase, Ua as ModelStatic, Ui as DelegateFindManyArgs, Un as resolveCast, Uo as RelationDefaultResolver, Ur as DeleteManySpec, Us as SchemaForeignKey, Ut as writeAppliedMigrationsState, V as applyMigrationRollbackToDatabase, Va as TransactionContext, Vi as ClientResolver, Vn as InitCommand, Vo as RelationColumnLookupSpec, Vr as DatabaseRows, Vs as SchemaColumn, Vt as resolveMigrationStateFilePath, W as applyMigrationToPrismaSchema, Wa as RelationshipModelStatic, Wi as DelegateInclude, Wn as Attribute, Wo as RelationDefaultValue, Wr as DeleteSpec, Ws as SchemaForeignKeyAction, Wt as writeAppliedMigrationsStateToStore, X as buildMigrationSource, Xa as AttributeSelect, Xi as DelegateUpdateArgs, Xn as RuntimeConstructor, Xo as JoinOn, Xr as QueryCondition, Xs as SchemaTableDropOperation, Xt as applyOperationsToPersistedColumnMappingsState, Y as buildInverseRelationLine, Ya as AttributeSchemaDelegate, Yi as DelegateUniqueWhere, Yn as RegisteredModel, Yo as EagerLoadRelations, Yr as QueryComparisonOperator, Ys as SchemaTableCreateOperation, Yt as PersistedTimestampColumn, Z as buildModelBlock, Za as AttributeUpdateInput, Zi as DelegateUpdateData, Zn as RuntimePathInput, Zo as JoinSource, Zr as QueryDayCondition, Zs as SchemaUniqueConstraint, Zt as createEmptyPersistedColumnMappingsState, _ as ensureArkormConfigLoading, _a as PrismaLikeSortOrder, _i as QuerySelectColumn, _n as QueryExecutionException, _o as QuerySchemaForModel, _r as SeederCallArgument, _s as BelongsToRelationMetadata, _t as resolveMigrationClassName, a as getRuntimeCompatibilityAdapter, aa as PaginationCurrentPageResolver, ai as QueryJoinNestedConstraint, an as readPersistedColumnMappingsState, ao as ModelDeclaredAttributeKey, ar as loadFactoriesFrom, as as FactoryAttributeResolver, at as deriveRelationFieldName, b as getDefaultStubsPath, ba as PrismaTransactionCapableClient, bi as RawQuerySpec, bn as ModelNotFoundException, bo as Model, br as PrismaDatabaseAdapter, bs as HasManyThroughRelationMetadata, bt as runPrismaCommand, c as PrismaDelegateMap, ca as PaginationURLDriver, ci as QueryJoinType, cn as resolveColumnMappingsFilePath, co as ModelEventHandlerConstructor, cr as loadSeedersFrom, cs as FactoryDefinition, ct as findEnumBlock, d as inferDelegateName, da as PrismaDelegateLike, di as QueryJsonConditionKind, dn as validatePersistedMetadataFeaturesForMigrations, do as ModelLifecycleState, dr as registerModels, ds as FactoryRelationshipResolver, dt as formatEnumDefaultValue, ea as EagerLoadMap, ec as TimestampNaming, ei as QueryGroupCondition, en as getPersistedEnumMap, eo as GlobalScope, er as getRegisteredFactories, es as WhereCallback, et as buildUniqueConstraintLine, f as awaitConfiguredModelsRegistration, fa as PrismaFindManyArgsLike, fi as QueryLogicalOperator, fn as writePersistedColumnMappingsState, fo as ModelOrderByInput, fr as registerPaths, fs as FactoryState, ft as formatRelationAction, g as emitRuntimeDebugEvent, ga as PrismaLikeSelect, gi as QueryScalarComparisonOperator, gn as RelationResolutionException, go as ModelWhereInput, gr as Seeder, gs as BelongsToManyRelationMetadata, gt as resolveEnumName, h as defineConfig, ha as PrismaLikeScalarFilter, hi as QueryRawCondition, hn as ScopeNotDefinedException, ho as ModelUpdateData, hr as SEEDER_BRAND, hs as DatabaseTablePersistedMetadataOptions, ht as pad, i as RuntimeModuleLoader, ia as NamingCase, ii as QueryJoinConstraint, in as getPersistedTimestampColumns, io as ModelCreateData, ir as getRegisteredSeeders, is as ArkormCollection, it as deriveRelationAlias, j as loadArkormConfig, ja as QuerySchemaUpdateArgs, ji as AdapterBindableModel, jn as SeedCommand, jr as AdapterModelIntrospectionOptions, js as AppliedMigrationEntry, jt as deleteAppliedMigrationsStateFromStore, k as isQuerySchemaLike, ka as QuerySchemaSelect, ki as UpdateSpec, kn as TableBuilder, kr as AdapterInspectionRequest, ks as RelationMetadata, kt as computeMigrationChecksum, l as createPrismaAdapter, la as PaginationURLDriverFactory, li as QueryJoinValueConstraint, ln as resolvePersistedMetadataFeatures, lo as ModelEventListener, lr as registerFactories, ls as FactoryDefinitionAttributes, lt as findModelBlock, m as configureArkormRuntime, ma as PrismaLikeOrderBy, mi as QueryOrderBy, mn as UniqueConstraintResolutionException, mo as ModelRelationshipResult, mr as resetRuntimeRegistryForTests, ms as DatabaseTableOptions, mt as getMigrationPlan, n as PivotModel, na as ModelQuerySchemaLike, ni as QueryJoinBoolean, nn as getPersistedPrimaryKeyGeneration, no as ModelAttributes, nr as getRegisteredModels, ns as LengthAwarePaginator, nt as deriveCollectionFieldName, o as resolveRuntimeCompatibilityQuerySchema, oa as PaginationMeta, oi as QueryJoinNullConstraint, on as rebuildPersistedColumnMappingsState, oo as ModelEventDispatcher, or as loadMigrationsFrom, os as FactoryAttributes, ot as deriveSingularFieldName, p as bindAdapterToModels, pa as PrismaLikeInclude, pi as QueryNotCondition, pn as UnsupportedAdapterFeatureException, po as ModelRelationshipKey, pr as registerSeeders, ps as MaybePromise, pt as generateMigrationFile, q as buildFieldLine, qa as AttributeOrderBy, qi as DelegateRows, qn as Arkormx, qo as RelationResultCache, qr as QueryColumnComparisonCondition, qs as SchemaPrimaryKey, qt as PersistedPrimaryKeyGeneration, r as LoadedRuntimeModule, ra as ModelTableCase, ri as QueryJoinColumnConstraint, rn as getPersistedTableMetadata, ro as ModelAttributesOf, rr as getRegisteredPaths, rs as Paginator, rt as deriveInverseRelationAlias, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as PaginationOptions, si as QueryJoinRawConstraint, sn as resetPersistedColumnMappingsCache, so as ModelEventHandler, sr as loadModelsFrom, ss as FactoryCallback, st as escapeRegex, t as URLDriver, ta as GetUserConfig, ti as QueryJoin, tn as getPersistedEnumTsType, to as ModelAttributeValue, tr as getRegisteredMigrations, ts as JoinClause, tt as createMigrationTimestamp, u as createPrismaDelegateMap, ua as PrismaClientLike, ui as QueryJsonCondition, un as syncPersistedColumnMappingsFromState, uo as ModelEventName, ur as registerMigrations, us as FactoryModelConstructor, ut as formatDefaultValue, v as getActiveTransactionAdapter, va as PrismaLikeWhereInput, vi as QueryTarget, vn as QueryExecutionExceptionContext, vo as QuerySchemaForModelInstance, vr as SeederConstructor, vs as ColumnMap, vt as resolvePrismaType, w as getRuntimePaginationCurrentPageResolver, wa as QuerySchemaFindManyArgs, wi as RelationLoadSpec, wn as DB, wr as KyselyDatabaseAdapter, ws as MorphManyRelationMetadata, wt as supportsDatabaseReset, x as getRuntimeAdapter, xa as PrismaTransactionContext, xi as RelationAggregateSpec, xn as MissingDelegateException, xo as InlineFactory, xr as PrismaDelegateNameMapping, xs as HasOneRelationMetadata, xt as stripPrismaSchemaModelsAndEnums, y as getActiveTransactionClient, ya as PrismaTransactionCallback, yi as QueryTimeCondition, yn as QueryConstraintException, yo as RelatedModelClass, yr as SeederInput, ys as HasManyRelationMetadata, yt as runMigrationWithPrisma, z as applyCreateTableOperation, za as TransactionCallback, zi as CastMap, zn as MakeMigrationCommand, zo as RelationAggregateInput, zr as DatabasePrimitive, zs as PrismaMigrationWorkflowOptions, zt as readAppliedMigrationsStateFromStore } from "./index-GhBV8Kyw.cjs";
|
|
1
|
+
import { $ as buildRelationLine, $a as DelegateForModelSchema, $i as EagerLoadConstraint, $n as RuntimePathMap, $o as RelatedModelFromResult, $r as QueryFullTextCondition, $s as TimestampNames, $t as getPersistedColumnMap, A as isTransactionCapableClient, Aa as QuerySchemaUniqueWhere, Ai as UpsertSpec, An as ForeignKeyBuilder, Ar as AdapterModelFieldStructure, As as RelationMetadataType, At as createEmptyAppliedMigrationsState, B as applyDropTableOperation, Ba as TransactionCapableClient, Bi as CastType, Bn as MakeFactoryCommand, Bo as RelationAggregateType, Br as DatabaseRow, Bs as PrismaSchemaSyncOptions, Bt as removeAppliedMigration, C as getRuntimeDebugHandler, Ca as QuerySchemaCreateData, Ci as RelationLoadPlan, Cn as ArkormException, Co as defineFactory, Cr as createPrismaDatabaseAdapter, Cs as ModelMetadata, Ct as supportsDatabaseMigrationExecution, D as getUserConfig, Da as QuerySchemaRow, Di as SortDirection, Dn as SchemaBuilder, Dr as AdapterCapability, Ds as MorphToRelationMetadata, Dt as buildMigrationIdentity, E as getRuntimePrismaClient, Ea as QuerySchemaOrderBy, Ei as SoftDeleteQueryMode, En as Migration, Er as AdapterCapabilities, Es as MorphToManyRelationMetadata, Et as toModelName, F as PRISMA_ENUM_MEMBER_REGEX, Fa as RuntimeClientLike, Fi as ArkormDebugEvent, Fn as MigrateFreshCommand, Fr as AggregateOperation, Fs as GeneratedMigrationFile, Ft as isMigrationApplied, G as applyOperationsToPrismaSchema, Ga as QueryBuilder, Gi as DelegateOrderBy, Gn as AttributeOptions, Go as RelationMetadataProvider, Gr as InsertManySpec, Gs as SchemaIndex, Gt as PersistedColumnMappingsState, H as applyMigrationRollbackToPrismaSchema, Ha as TransactionOptions, Hi as DelegateCreateData, Hn as CliApp, Ho as RelationConstraint, Hr as DatabaseValue, Hs as SchemaColumnType, Ht as supportsDatabaseMigrationState, I as PRISMA_ENUM_REGEX, Ia as Serializable, Ii as ArkormDebugHandler, In as MigrateCommand, Ir as AggregateSelection, Is as MigrationClass, It as markMigrationApplied, J as buildIndexLine, Ja as AttributeQuerySchema, Ji as DelegateSelect, Jn as RegisteredFactory, Jo as RelationTableLookupSpec, Jr as QueryComparisonCondition, Js as SchemaTableAlterOperation, Jt as PersistedTableMetadata, K as buildEnumBlock, Ka as AttributeCreateInput, Ki as DelegateRow, Kn as Arkorm, Ko as RelationResult, Kr as InsertSpec, Ks as SchemaOperation, Kt as PersistedMetadataFeatures, L as PRISMA_MODEL_REGEX, La as SimplePaginationMeta, Li as CastDefinition, Ln as MakeSeederCommand, Lr as AggregateSpec, Ls as MigrationInstanceLike, Lt as markMigrationRun, M as resetArkormRuntimeForTests, Ma as QuerySchemaUpdateData, Mi as AdapterQueryInspection, Mn as ModelsSyncCommand, Mr as AdapterModelStructure, Ms as AppliedMigrationRun, Mt as findAppliedMigration, N as runArkormTransaction, Na as QuerySchemaWhere, Ni as ArkormBootContext, Nn as MigrationHistoryCommand, Nr as AdapterQueryOperation, Ns as AppliedMigrationsState, Nt as getLastMigrationRun, O as isDelegateLike, Oa as QuerySchemaRows, Oi as UpdateManySpec, On as EnumBuilder, Or as AdapterDatabaseCreationResult, Os as PivotModelStatic, Ot as buildMigrationRunId, P as PrimaryKeyGenerationPlanner, Pa as RawSelectInput, Pi as ArkormConfig, Pn as MigrateRollbackCommand, Pr as AdapterTransactionContext, Ps as GenerateMigrationOptions, Pt as getLatestAppliedMigrations, Q as buildPrimaryKeyLine, Qa as AttributeWhereInput, Qi as DelegateWhere, Qn as RuntimePathKey, Qo as RelatedModelForRelationship, Qr as QueryExistsCondition, Qs as TimestampColumnBehavior, Qt as deletePersistedColumnMappingsState, R as applyAlterTableOperation, Ra as SoftDeleteConfig, Ri as CastHandler, Rn as MakeModelCommand, Ro as RelationAggregateConstraint, Rr as DatabaseAdapter, Rs as PrimaryKeyGeneration, Rt as readAppliedMigrationsState, S as getRuntimeClient, Sa as PrismaTransactionOptions, Si as RelationFilterSpec, Sn as ArkormErrorContext, So as ModelFactory, Sr as createPrismaCompatibilityAdapter, Ss as HasOneThroughRelationMetadata, St as supportsDatabaseCreation, T as getRuntimePaginationURLDriverFactory, Ta as QuerySchemaInclude, Ti as SelectSpec, Tn as MIGRATION_BRAND, Tr as createKyselyAdapter, Ts as MorphOneRelationMetadata, Tt as toMigrationFileSlug, U as applyMigrationToDatabase, Ua as ModelStatic, Ui as DelegateFindManyArgs, Un as resolveCast, Uo as RelationDefaultResolver, Ur as DeleteManySpec, Us as SchemaForeignKey, Ut as writeAppliedMigrationsState, V as applyMigrationRollbackToDatabase, Va as TransactionContext, Vi as ClientResolver, Vn as InitCommand, Vo as RelationColumnLookupSpec, Vr as DatabaseRows, Vs as SchemaColumn, Vt as resolveMigrationStateFilePath, W as applyMigrationToPrismaSchema, Wa as RelationshipModelStatic, Wi as DelegateInclude, Wn as Attribute, Wo as RelationDefaultValue, Wr as DeleteSpec, Ws as SchemaForeignKeyAction, Wt as writeAppliedMigrationsStateToStore, X as buildMigrationSource, Xa as AttributeSelect, Xi as DelegateUpdateArgs, Xn as RuntimeConstructor, Xo as JoinOn, Xr as QueryCondition, Xs as SchemaTableDropOperation, Xt as applyOperationsToPersistedColumnMappingsState, Y as buildInverseRelationLine, Ya as AttributeSchemaDelegate, Yi as DelegateUniqueWhere, Yn as RegisteredModel, Yo as EagerLoadRelations, Yr as QueryComparisonOperator, Ys as SchemaTableCreateOperation, Yt as PersistedTimestampColumn, Z as buildModelBlock, Za as AttributeUpdateInput, Zi as DelegateUpdateData, Zn as RuntimePathInput, Zo as JoinSource, Zr as QueryDayCondition, Zs as SchemaUniqueConstraint, Zt as createEmptyPersistedColumnMappingsState, _ as ensureArkormConfigLoading, _a as PrismaLikeSortOrder, _i as QuerySelectColumn, _n as QueryExecutionException, _o as QuerySchemaForModel, _r as SeederCallArgument, _s as BelongsToRelationMetadata, _t as resolveMigrationClassName, a as getRuntimeCompatibilityAdapter, aa as PaginationCurrentPageResolver, ai as QueryJoinNestedConstraint, an as readPersistedColumnMappingsState, ao as ModelDeclaredAttributeKey, ar as loadFactoriesFrom, as as FactoryAttributeResolver, at as deriveRelationFieldName, b as getDefaultStubsPath, ba as PrismaTransactionCapableClient, bi as RawQuerySpec, bn as ModelNotFoundException, bo as Model, br as PrismaDatabaseAdapter, bs as HasManyThroughRelationMetadata, bt as runPrismaCommand, c as PrismaDelegateMap, ca as PaginationURLDriver, ci as QueryJoinType, cn as resolveColumnMappingsFilePath, co as ModelEventHandlerConstructor, cr as loadSeedersFrom, cs as FactoryDefinition, ct as findEnumBlock, d as inferDelegateName, da as PrismaDelegateLike, di as QueryJsonConditionKind, dn as validatePersistedMetadataFeaturesForMigrations, do as ModelLifecycleState, dr as registerModels, ds as FactoryRelationshipResolver, dt as formatEnumDefaultValue, ea as EagerLoadMap, ec as TimestampNaming, ei as QueryGroupCondition, en as getPersistedEnumMap, eo as GlobalScope, er as getRegisteredFactories, es as WhereCallback, et as buildUniqueConstraintLine, f as awaitConfiguredModelsRegistration, fa as PrismaFindManyArgsLike, fi as QueryLogicalOperator, fn as writePersistedColumnMappingsState, fo as ModelOrderByInput, fr as registerPaths, fs as FactoryState, ft as formatRelationAction, g as emitRuntimeDebugEvent, ga as PrismaLikeSelect, gi as QueryScalarComparisonOperator, gn as RelationResolutionException, go as ModelWhereInput, gr as Seeder, gs as BelongsToManyRelationMetadata, gt as resolveEnumName, h as defineConfig, ha as PrismaLikeScalarFilter, hi as QueryRawCondition, hn as ScopeNotDefinedException, ho as ModelUpdateData, hr as SEEDER_BRAND, hs as DatabaseTablePersistedMetadataOptions, ht as pad, i as RuntimeModuleLoader, ia as NamingCase, ii as QueryJoinConstraint, in as getPersistedTimestampColumns, io as ModelCreateData, ir as getRegisteredSeeders, is as ArkormCollection, it as deriveRelationAlias, j as loadArkormConfig, ja as QuerySchemaUpdateArgs, ji as AdapterBindableModel, jn as SeedCommand, jr as AdapterModelIntrospectionOptions, js as AppliedMigrationEntry, jt as deleteAppliedMigrationsStateFromStore, k as isQuerySchemaLike, ka as QuerySchemaSelect, ki as UpdateSpec, kn as TableBuilder, kr as AdapterInspectionRequest, ks as RelationMetadata, kt as computeMigrationChecksum, l as createPrismaAdapter, la as PaginationURLDriverFactory, li as QueryJoinValueConstraint, ln as resolvePersistedMetadataFeatures, lo as ModelEventListener, lr as registerFactories, ls as FactoryDefinitionAttributes, lt as findModelBlock, m as configureArkormRuntime, ma as PrismaLikeOrderBy, mi as QueryOrderBy, mn as UniqueConstraintResolutionException, mo as ModelRelationshipResult, mr as resetRuntimeRegistryForTests, ms as DatabaseTableOptions, mt as getMigrationPlan, n as PivotModel, na as ModelQuerySchemaLike, ni as QueryJoinBoolean, nn as getPersistedPrimaryKeyGeneration, no as ModelAttributes, nr as getRegisteredModels, ns as LengthAwarePaginator, nt as deriveCollectionFieldName, o as resolveRuntimeCompatibilityQuerySchema, oa as PaginationMeta, oi as QueryJoinNullConstraint, on as rebuildPersistedColumnMappingsState, oo as ModelEventDispatcher, or as loadMigrationsFrom, os as FactoryAttributes, ot as deriveSingularFieldName, p as bindAdapterToModels, pa as PrismaLikeInclude, pi as QueryNotCondition, pn as UnsupportedAdapterFeatureException, po as ModelRelationshipKey, pr as registerSeeders, ps as MaybePromise, pt as generateMigrationFile, q as buildFieldLine, qa as AttributeOrderBy, qi as DelegateRows, qn as Arkormx, qo as RelationResultCache, qr as QueryColumnComparisonCondition, qs as SchemaPrimaryKey, qt as PersistedPrimaryKeyGeneration, r as LoadedRuntimeModule, ra as ModelTableCase, ri as QueryJoinColumnConstraint, rn as getPersistedTableMetadata, ro as ModelAttributesOf, rr as getRegisteredPaths, rs as Paginator, rt as deriveInverseRelationAlias, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as PaginationOptions, si as QueryJoinRawConstraint, sn as resetPersistedColumnMappingsCache, so as ModelEventHandler, sr as loadModelsFrom, ss as FactoryCallback, st as escapeRegex, t as URLDriver, ta as GetUserConfig, ti as QueryJoin, tn as getPersistedEnumTsType, to as ModelAttributeValue, tr as getRegisteredMigrations, ts as JoinClause, tt as createMigrationTimestamp, u as createPrismaDelegateMap, ua as PrismaClientLike, ui as QueryJsonCondition, un as syncPersistedColumnMappingsFromState, uo as ModelEventName, ur as registerMigrations, us as FactoryModelConstructor, ut as formatDefaultValue, v as getActiveTransactionAdapter, va as PrismaLikeWhereInput, vi as QueryTarget, vn as QueryExecutionExceptionContext, vo as QuerySchemaForModelInstance, vr as SeederConstructor, vs as ColumnMap, vt as resolvePrismaType, w as getRuntimePaginationCurrentPageResolver, wa as QuerySchemaFindManyArgs, wi as RelationLoadSpec, wn as DB, wr as KyselyDatabaseAdapter, ws as MorphManyRelationMetadata, wt as supportsDatabaseReset, x as getRuntimeAdapter, xa as PrismaTransactionContext, xi as RelationAggregateSpec, xn as MissingDelegateException, xo as InlineFactory, xr as PrismaDelegateNameMapping, xs as HasOneRelationMetadata, xt as stripPrismaSchemaModelsAndEnums, y as getActiveTransactionClient, ya as PrismaTransactionCallback, yi as QueryTimeCondition, yn as QueryConstraintException, yo as RelatedModelClass, yr as SeederInput, ys as HasManyRelationMetadata, yt as runMigrationWithPrisma, z as applyCreateTableOperation, za as TransactionCallback, zi as CastMap, zn as MakeMigrationCommand, zo as RelationAggregateInput, zr as DatabasePrimitive, zs as PrismaMigrationWorkflowOptions, zt as readAppliedMigrationsStateFromStore } from "./index-CGawfwb8.cjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, CastDefinition, CastHandler, CastMap, CastType, CliApp, ClientResolver, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EagerLoadConstraint, EagerLoadMap, EagerLoadRelations, EnumBuilder, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, GenerateMigrationOptions, GeneratedMigrationFile, GetUserConfig, GlobalScope, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, KyselyDatabaseAdapter, LengthAwarePaginator, LoadedRuntimeModule, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MaybePromise, MigrateCommand, MigrateFreshCommand, MigrateRollbackCommand, Migration, MigrationClass, MigrationHistoryCommand, MigrationInstanceLike, MissingDelegateException, Model, ModelAttributeValue, ModelAttributes, ModelAttributesOf, ModelCreateData, ModelDeclaredAttributeKey, ModelEventDispatcher, ModelEventHandler, ModelEventHandlerConstructor, ModelEventListener, ModelEventName, ModelFactory, ModelLifecycleState, ModelMetadata, ModelNotFoundException, ModelOrderByInput, ModelQuerySchemaLike, ModelRelationshipKey, ModelRelationshipResult, ModelStatic, ModelTableCase, ModelUpdateData, ModelWhereInput, ModelsSyncCommand, MorphManyRelationMetadata, MorphOneRelationMetadata, MorphToManyRelationMetadata, MorphToRelationMetadata, NamingCase, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PersistedColumnMappingsState, PersistedMetadataFeatures, PersistedPrimaryKeyGeneration, PersistedTableMetadata, PersistedTimestampColumn, PivotModel, PivotModelStatic, PrimaryKeyGeneration, PrimaryKeyGenerationPlanner, PrismaClientLike, PrismaDatabaseAdapter, PrismaDelegateLike, PrismaDelegateMap, PrismaDelegateNameMapping, PrismaFindManyArgsLike, PrismaLikeInclude, PrismaLikeOrderBy, PrismaLikeScalarFilter, PrismaLikeSelect, PrismaLikeSortOrder, PrismaLikeWhereInput, PrismaMigrationWorkflowOptions, PrismaSchemaSyncOptions, PrismaTransactionCallback, PrismaTransactionCapableClient, PrismaTransactionContext, PrismaTransactionOptions, QueryBuilder, QueryColumnComparisonCondition, QueryComparisonCondition, QueryComparisonOperator, QueryCondition, QueryConstraintException, QueryDayCondition, QueryExecutionException, QueryExecutionExceptionContext, QueryExistsCondition, QueryFullTextCondition, QueryGroupCondition, QueryJoin, QueryJoinBoolean, QueryJoinColumnConstraint, QueryJoinConstraint, QueryJoinNestedConstraint, QueryJoinNullConstraint, QueryJoinRawConstraint, QueryJoinType, QueryJoinValueConstraint, QueryJsonCondition, QueryJsonConditionKind, QueryLogicalOperator, QueryNotCondition, QueryOrderBy, QueryRawCondition, QueryScalarComparisonOperator, QuerySchemaCreateData, QuerySchemaFindManyArgs, QuerySchemaForModel, QuerySchemaForModelInstance, QuerySchemaInclude, QuerySchemaOrderBy, QuerySchemaRow, QuerySchemaRows, QuerySchemaSelect, QuerySchemaUniqueWhere, QuerySchemaUpdateArgs, QuerySchemaUpdateData, QuerySchemaWhere, QuerySelectColumn, QueryTarget, QueryTimeCondition, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RelatedModelClass, RelatedModelForRelationship, RelatedModelFromResult, RelationAggregateConstraint, RelationAggregateInput, RelationAggregateSpec, RelationAggregateType, RelationColumnLookupSpec, RelationConstraint, RelationDefaultResolver, RelationDefaultValue, RelationFilterSpec, RelationLoadPlan, RelationLoadSpec, RelationMetadata, RelationMetadataProvider, RelationMetadataType, RelationResolutionException, RelationResult, RelationResultCache, RelationTableLookupSpec, RelationshipModelStatic, RuntimeClientLike, RuntimeConstructor, RuntimeModuleLoader, RuntimePathInput, RuntimePathKey, RuntimePathMap, SEEDER_BRAND, SchemaBuilder, SchemaColumn, SchemaColumnType, SchemaForeignKey, SchemaForeignKeyAction, SchemaIndex, SchemaOperation, SchemaPrimaryKey, SchemaTableAlterOperation, SchemaTableCreateOperation, SchemaTableDropOperation, SchemaUniqueConstraint, ScopeNotDefinedException, SeedCommand, Seeder, SeederCallArgument, SeederConstructor, SeederInput, SelectSpec, Serializable, SimplePaginationMeta, SoftDeleteConfig, SoftDeleteQueryMode, SortDirection, TableBuilder, TimestampColumnBehavior, TimestampNames, TimestampNaming, TransactionCallback, TransactionCapableClient, TransactionContext, TransactionOptions, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, UpdateManySpec, UpdateSpec, UpsertSpec, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, computeMigrationChecksum, configureArkormRuntime, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, findAppliedMigration, findEnumBlock, findModelBlock, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, pad, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, validatePersistedMetadataFeaturesForMigrations, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildRelationLine, $a as DelegateForModelSchema, $i as EagerLoadConstraint, $n as RuntimePathMap, $o as RelatedModelFromResult, $r as QueryFullTextCondition, $s as TimestampNames, $t as getPersistedColumnMap, A as isTransactionCapableClient, Aa as QuerySchemaUniqueWhere, Ai as UpsertSpec, An as ForeignKeyBuilder, Ar as AdapterModelFieldStructure, As as RelationMetadataType, At as createEmptyAppliedMigrationsState, B as applyDropTableOperation, Ba as TransactionCapableClient, Bi as CastType, Bn as MakeFactoryCommand, Bo as RelationAggregateType, Br as DatabaseRow, Bs as PrismaSchemaSyncOptions, Bt as removeAppliedMigration, C as getRuntimeDebugHandler, Ca as QuerySchemaCreateData, Ci as RelationLoadPlan, Cn as ArkormException, Co as defineFactory, Cr as createPrismaDatabaseAdapter, Cs as ModelMetadata, Ct as supportsDatabaseMigrationExecution, D as getUserConfig, Da as QuerySchemaRow, Di as SortDirection, Dn as SchemaBuilder, Dr as AdapterCapability, Ds as MorphToRelationMetadata, Dt as buildMigrationIdentity, E as getRuntimePrismaClient, Ea as QuerySchemaOrderBy, Ei as SoftDeleteQueryMode, En as Migration, Er as AdapterCapabilities, Es as MorphToManyRelationMetadata, Et as toModelName, F as PRISMA_ENUM_MEMBER_REGEX, Fa as RuntimeClientLike, Fi as ArkormDebugEvent, Fn as MigrateFreshCommand, Fr as AggregateOperation, Fs as GeneratedMigrationFile, Ft as isMigrationApplied, G as applyOperationsToPrismaSchema, Ga as QueryBuilder, Gi as DelegateOrderBy, Gn as AttributeOptions, Go as RelationMetadataProvider, Gr as InsertManySpec, Gs as SchemaIndex, Gt as PersistedColumnMappingsState, H as applyMigrationRollbackToPrismaSchema, Ha as TransactionOptions, Hi as DelegateCreateData, Hn as CliApp, Ho as RelationConstraint, Hr as DatabaseValue, Hs as SchemaColumnType, Ht as supportsDatabaseMigrationState, I as PRISMA_ENUM_REGEX, Ia as Serializable, Ii as ArkormDebugHandler, In as MigrateCommand, Ir as AggregateSelection, Is as MigrationClass, It as markMigrationApplied, J as buildIndexLine, Ja as AttributeQuerySchema, Ji as DelegateSelect, Jn as RegisteredFactory, Jo as RelationTableLookupSpec, Jr as QueryComparisonCondition, Js as SchemaTableAlterOperation, Jt as PersistedTableMetadata, K as buildEnumBlock, Ka as AttributeCreateInput, Ki as DelegateRow, Kn as Arkorm, Ko as RelationResult, Kr as InsertSpec, Ks as SchemaOperation, Kt as PersistedMetadataFeatures, L as PRISMA_MODEL_REGEX, La as SimplePaginationMeta, Li as CastDefinition, Ln as MakeSeederCommand, Lr as AggregateSpec, Ls as MigrationInstanceLike, Lt as markMigrationRun, M as resetArkormRuntimeForTests, Ma as QuerySchemaUpdateData, Mi as AdapterQueryInspection, Mn as ModelsSyncCommand, Mr as AdapterModelStructure, Ms as AppliedMigrationRun, Mt as findAppliedMigration, N as runArkormTransaction, Na as QuerySchemaWhere, Ni as ArkormBootContext, Nn as MigrationHistoryCommand, Nr as AdapterQueryOperation, Ns as AppliedMigrationsState, Nt as getLastMigrationRun, O as isDelegateLike, Oa as QuerySchemaRows, Oi as UpdateManySpec, On as EnumBuilder, Or as AdapterDatabaseCreationResult, Os as PivotModelStatic, Ot as buildMigrationRunId, P as PrimaryKeyGenerationPlanner, Pa as RawSelectInput, Pi as ArkormConfig, Pn as MigrateRollbackCommand, Pr as AdapterTransactionContext, Ps as GenerateMigrationOptions, Pt as getLatestAppliedMigrations, Q as buildPrimaryKeyLine, Qa as AttributeWhereInput, Qi as DelegateWhere, Qn as RuntimePathKey, Qo as RelatedModelForRelationship, Qr as QueryExistsCondition, Qs as TimestampColumnBehavior, Qt as deletePersistedColumnMappingsState, R as applyAlterTableOperation, Ra as SoftDeleteConfig, Ri as CastHandler, Rn as MakeModelCommand, Ro as RelationAggregateConstraint, Rr as DatabaseAdapter, Rs as PrimaryKeyGeneration, Rt as readAppliedMigrationsState, S as getRuntimeClient, Sa as PrismaTransactionOptions, Si as RelationFilterSpec, Sn as ArkormErrorContext, So as ModelFactory, Sr as createPrismaCompatibilityAdapter, Ss as HasOneThroughRelationMetadata, St as supportsDatabaseCreation, T as getRuntimePaginationURLDriverFactory, Ta as QuerySchemaInclude, Ti as SelectSpec, Tn as MIGRATION_BRAND, Tr as createKyselyAdapter, Ts as MorphOneRelationMetadata, Tt as toMigrationFileSlug, U as applyMigrationToDatabase, Ua as ModelStatic, Ui as DelegateFindManyArgs, Un as resolveCast, Uo as RelationDefaultResolver, Ur as DeleteManySpec, Us as SchemaForeignKey, Ut as writeAppliedMigrationsState, V as applyMigrationRollbackToDatabase, Va as TransactionContext, Vi as ClientResolver, Vn as InitCommand, Vo as RelationColumnLookupSpec, Vr as DatabaseRows, Vs as SchemaColumn, Vt as resolveMigrationStateFilePath, W as applyMigrationToPrismaSchema, Wa as RelationshipModelStatic, Wi as DelegateInclude, Wn as Attribute, Wo as RelationDefaultValue, Wr as DeleteSpec, Ws as SchemaForeignKeyAction, Wt as writeAppliedMigrationsStateToStore, X as buildMigrationSource, Xa as AttributeSelect, Xi as DelegateUpdateArgs, Xn as RuntimeConstructor, Xo as JoinOn, Xr as QueryCondition, Xs as SchemaTableDropOperation, Xt as applyOperationsToPersistedColumnMappingsState, Y as buildInverseRelationLine, Ya as AttributeSchemaDelegate, Yi as DelegateUniqueWhere, Yn as RegisteredModel, Yo as EagerLoadRelations, Yr as QueryComparisonOperator, Ys as SchemaTableCreateOperation, Yt as PersistedTimestampColumn, Z as buildModelBlock, Za as AttributeUpdateInput, Zi as DelegateUpdateData, Zn as RuntimePathInput, Zo as JoinSource, Zr as QueryDayCondition, Zs as SchemaUniqueConstraint, Zt as createEmptyPersistedColumnMappingsState, _ as ensureArkormConfigLoading, _a as PrismaLikeSortOrder, _i as QuerySelectColumn, _n as QueryExecutionException, _o as QuerySchemaForModel, _r as SeederCallArgument, _s as BelongsToRelationMetadata, _t as resolveMigrationClassName, a as getRuntimeCompatibilityAdapter, aa as PaginationCurrentPageResolver, ai as QueryJoinNestedConstraint, an as readPersistedColumnMappingsState, ao as ModelDeclaredAttributeKey, ar as loadFactoriesFrom, as as FactoryAttributeResolver, at as deriveRelationFieldName, b as getDefaultStubsPath, ba as PrismaTransactionCapableClient, bi as RawQuerySpec, bn as ModelNotFoundException, bo as Model, br as PrismaDatabaseAdapter, bs as HasManyThroughRelationMetadata, bt as runPrismaCommand, c as PrismaDelegateMap, ca as PaginationURLDriver, ci as QueryJoinType, cn as resolveColumnMappingsFilePath, co as ModelEventHandlerConstructor, cr as loadSeedersFrom, cs as FactoryDefinition, ct as findEnumBlock, d as inferDelegateName, da as PrismaDelegateLike, di as QueryJsonConditionKind, dn as validatePersistedMetadataFeaturesForMigrations, do as ModelLifecycleState, dr as registerModels, ds as FactoryRelationshipResolver, dt as formatEnumDefaultValue, ea as EagerLoadMap, ec as TimestampNaming, ei as QueryGroupCondition, en as getPersistedEnumMap, eo as GlobalScope, er as getRegisteredFactories, es as WhereCallback, et as buildUniqueConstraintLine, f as awaitConfiguredModelsRegistration, fa as PrismaFindManyArgsLike, fi as QueryLogicalOperator, fn as writePersistedColumnMappingsState, fo as ModelOrderByInput, fr as registerPaths, fs as FactoryState, ft as formatRelationAction, g as emitRuntimeDebugEvent, ga as PrismaLikeSelect, gi as QueryScalarComparisonOperator, gn as RelationResolutionException, go as ModelWhereInput, gr as Seeder, gs as BelongsToManyRelationMetadata, gt as resolveEnumName, h as defineConfig, ha as PrismaLikeScalarFilter, hi as QueryRawCondition, hn as ScopeNotDefinedException, ho as ModelUpdateData, hr as SEEDER_BRAND, hs as DatabaseTablePersistedMetadataOptions, ht as pad, i as RuntimeModuleLoader, ia as NamingCase, ii as QueryJoinConstraint, in as getPersistedTimestampColumns, io as ModelCreateData, ir as getRegisteredSeeders, is as ArkormCollection, it as deriveRelationAlias, j as loadArkormConfig, ja as QuerySchemaUpdateArgs, ji as AdapterBindableModel, jn as SeedCommand, jr as AdapterModelIntrospectionOptions, js as AppliedMigrationEntry, jt as deleteAppliedMigrationsStateFromStore, k as isQuerySchemaLike, ka as QuerySchemaSelect, ki as UpdateSpec, kn as TableBuilder, kr as AdapterInspectionRequest, ks as RelationMetadata, kt as computeMigrationChecksum, l as createPrismaAdapter, la as PaginationURLDriverFactory, li as QueryJoinValueConstraint, ln as resolvePersistedMetadataFeatures, lo as ModelEventListener, lr as registerFactories, ls as FactoryDefinitionAttributes, lt as findModelBlock, m as configureArkormRuntime, ma as PrismaLikeOrderBy, mi as QueryOrderBy, mn as UniqueConstraintResolutionException, mo as ModelRelationshipResult, mr as resetRuntimeRegistryForTests, ms as DatabaseTableOptions, mt as getMigrationPlan, n as PivotModel, na as ModelQuerySchemaLike, ni as QueryJoinBoolean, nn as getPersistedPrimaryKeyGeneration, no as ModelAttributes, nr as getRegisteredModels, ns as LengthAwarePaginator, nt as deriveCollectionFieldName, o as resolveRuntimeCompatibilityQuerySchema, oa as PaginationMeta, oi as QueryJoinNullConstraint, on as rebuildPersistedColumnMappingsState, oo as ModelEventDispatcher, or as loadMigrationsFrom, os as FactoryAttributes, ot as deriveSingularFieldName, p as bindAdapterToModels, pa as PrismaLikeInclude, pi as QueryNotCondition, pn as UnsupportedAdapterFeatureException, po as ModelRelationshipKey, pr as registerSeeders, ps as MaybePromise, pt as generateMigrationFile, q as buildFieldLine, qa as AttributeOrderBy, qi as DelegateRows, qn as Arkormx, qo as RelationResultCache, qr as QueryColumnComparisonCondition, qs as SchemaPrimaryKey, qt as PersistedPrimaryKeyGeneration, r as LoadedRuntimeModule, ra as ModelTableCase, ri as QueryJoinColumnConstraint, rn as getPersistedTableMetadata, ro as ModelAttributesOf, rr as getRegisteredPaths, rs as Paginator, rt as deriveInverseRelationAlias, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as PaginationOptions, si as QueryJoinRawConstraint, sn as resetPersistedColumnMappingsCache, so as ModelEventHandler, sr as loadModelsFrom, ss as FactoryCallback, st as escapeRegex, t as URLDriver, ta as GetUserConfig, ti as QueryJoin, tn as getPersistedEnumTsType, to as ModelAttributeValue, tr as getRegisteredMigrations, ts as JoinClause, tt as createMigrationTimestamp, u as createPrismaDelegateMap, ua as PrismaClientLike, ui as QueryJsonCondition, un as syncPersistedColumnMappingsFromState, uo as ModelEventName, ur as registerMigrations, us as FactoryModelConstructor, ut as formatDefaultValue, v as getActiveTransactionAdapter, va as PrismaLikeWhereInput, vi as QueryTarget, vn as QueryExecutionExceptionContext, vo as QuerySchemaForModelInstance, vr as SeederConstructor, vs as ColumnMap, vt as resolvePrismaType, w as getRuntimePaginationCurrentPageResolver, wa as QuerySchemaFindManyArgs, wi as RelationLoadSpec, wn as DB, wr as KyselyDatabaseAdapter, ws as MorphManyRelationMetadata, wt as supportsDatabaseReset, x as getRuntimeAdapter, xa as PrismaTransactionContext, xi as RelationAggregateSpec, xn as MissingDelegateException, xo as InlineFactory, xr as PrismaDelegateNameMapping, xs as HasOneRelationMetadata, xt as stripPrismaSchemaModelsAndEnums, y as getActiveTransactionClient, ya as PrismaTransactionCallback, yi as QueryTimeCondition, yn as QueryConstraintException, yo as RelatedModelClass, yr as SeederInput, ys as HasManyRelationMetadata, yt as runMigrationWithPrisma, z as applyCreateTableOperation, za as TransactionCallback, zi as CastMap, zn as MakeMigrationCommand, zo as RelationAggregateInput, zr as DatabasePrimitive, zs as PrismaMigrationWorkflowOptions, zt as readAppliedMigrationsStateFromStore } from "./index-ufenXVzx.mjs";
|
|
1
|
+
import { $ as buildRelationLine, $a as DelegateForModelSchema, $i as EagerLoadConstraint, $n as RuntimePathMap, $o as RelatedModelFromResult, $r as QueryFullTextCondition, $s as TimestampNames, $t as getPersistedColumnMap, A as isTransactionCapableClient, Aa as QuerySchemaUniqueWhere, Ai as UpsertSpec, An as ForeignKeyBuilder, Ar as AdapterModelFieldStructure, As as RelationMetadataType, At as createEmptyAppliedMigrationsState, B as applyDropTableOperation, Ba as TransactionCapableClient, Bi as CastType, Bn as MakeFactoryCommand, Bo as RelationAggregateType, Br as DatabaseRow, Bs as PrismaSchemaSyncOptions, Bt as removeAppliedMigration, C as getRuntimeDebugHandler, Ca as QuerySchemaCreateData, Ci as RelationLoadPlan, Cn as ArkormException, Co as defineFactory, Cr as createPrismaDatabaseAdapter, Cs as ModelMetadata, Ct as supportsDatabaseMigrationExecution, D as getUserConfig, Da as QuerySchemaRow, Di as SortDirection, Dn as SchemaBuilder, Dr as AdapterCapability, Ds as MorphToRelationMetadata, Dt as buildMigrationIdentity, E as getRuntimePrismaClient, Ea as QuerySchemaOrderBy, Ei as SoftDeleteQueryMode, En as Migration, Er as AdapterCapabilities, Es as MorphToManyRelationMetadata, Et as toModelName, F as PRISMA_ENUM_MEMBER_REGEX, Fa as RuntimeClientLike, Fi as ArkormDebugEvent, Fn as MigrateFreshCommand, Fr as AggregateOperation, Fs as GeneratedMigrationFile, Ft as isMigrationApplied, G as applyOperationsToPrismaSchema, Ga as QueryBuilder, Gi as DelegateOrderBy, Gn as AttributeOptions, Go as RelationMetadataProvider, Gr as InsertManySpec, Gs as SchemaIndex, Gt as PersistedColumnMappingsState, H as applyMigrationRollbackToPrismaSchema, Ha as TransactionOptions, Hi as DelegateCreateData, Hn as CliApp, Ho as RelationConstraint, Hr as DatabaseValue, Hs as SchemaColumnType, Ht as supportsDatabaseMigrationState, I as PRISMA_ENUM_REGEX, Ia as Serializable, Ii as ArkormDebugHandler, In as MigrateCommand, Ir as AggregateSelection, Is as MigrationClass, It as markMigrationApplied, J as buildIndexLine, Ja as AttributeQuerySchema, Ji as DelegateSelect, Jn as RegisteredFactory, Jo as RelationTableLookupSpec, Jr as QueryComparisonCondition, Js as SchemaTableAlterOperation, Jt as PersistedTableMetadata, K as buildEnumBlock, Ka as AttributeCreateInput, Ki as DelegateRow, Kn as Arkorm, Ko as RelationResult, Kr as InsertSpec, Ks as SchemaOperation, Kt as PersistedMetadataFeatures, L as PRISMA_MODEL_REGEX, La as SimplePaginationMeta, Li as CastDefinition, Ln as MakeSeederCommand, Lr as AggregateSpec, Ls as MigrationInstanceLike, Lt as markMigrationRun, M as resetArkormRuntimeForTests, Ma as QuerySchemaUpdateData, Mi as AdapterQueryInspection, Mn as ModelsSyncCommand, Mr as AdapterModelStructure, Ms as AppliedMigrationRun, Mt as findAppliedMigration, N as runArkormTransaction, Na as QuerySchemaWhere, Ni as ArkormBootContext, Nn as MigrationHistoryCommand, Nr as AdapterQueryOperation, Ns as AppliedMigrationsState, Nt as getLastMigrationRun, O as isDelegateLike, Oa as QuerySchemaRows, Oi as UpdateManySpec, On as EnumBuilder, Or as AdapterDatabaseCreationResult, Os as PivotModelStatic, Ot as buildMigrationRunId, P as PrimaryKeyGenerationPlanner, Pa as RawSelectInput, Pi as ArkormConfig, Pn as MigrateRollbackCommand, Pr as AdapterTransactionContext, Ps as GenerateMigrationOptions, Pt as getLatestAppliedMigrations, Q as buildPrimaryKeyLine, Qa as AttributeWhereInput, Qi as DelegateWhere, Qn as RuntimePathKey, Qo as RelatedModelForRelationship, Qr as QueryExistsCondition, Qs as TimestampColumnBehavior, Qt as deletePersistedColumnMappingsState, R as applyAlterTableOperation, Ra as SoftDeleteConfig, Ri as CastHandler, Rn as MakeModelCommand, Ro as RelationAggregateConstraint, Rr as DatabaseAdapter, Rs as PrimaryKeyGeneration, Rt as readAppliedMigrationsState, S as getRuntimeClient, Sa as PrismaTransactionOptions, Si as RelationFilterSpec, Sn as ArkormErrorContext, So as ModelFactory, Sr as createPrismaCompatibilityAdapter, Ss as HasOneThroughRelationMetadata, St as supportsDatabaseCreation, T as getRuntimePaginationURLDriverFactory, Ta as QuerySchemaInclude, Ti as SelectSpec, Tn as MIGRATION_BRAND, Tr as createKyselyAdapter, Ts as MorphOneRelationMetadata, Tt as toMigrationFileSlug, U as applyMigrationToDatabase, Ua as ModelStatic, Ui as DelegateFindManyArgs, Un as resolveCast, Uo as RelationDefaultResolver, Ur as DeleteManySpec, Us as SchemaForeignKey, Ut as writeAppliedMigrationsState, V as applyMigrationRollbackToDatabase, Va as TransactionContext, Vi as ClientResolver, Vn as InitCommand, Vo as RelationColumnLookupSpec, Vr as DatabaseRows, Vs as SchemaColumn, Vt as resolveMigrationStateFilePath, W as applyMigrationToPrismaSchema, Wa as RelationshipModelStatic, Wi as DelegateInclude, Wn as Attribute, Wo as RelationDefaultValue, Wr as DeleteSpec, Ws as SchemaForeignKeyAction, Wt as writeAppliedMigrationsStateToStore, X as buildMigrationSource, Xa as AttributeSelect, Xi as DelegateUpdateArgs, Xn as RuntimeConstructor, Xo as JoinOn, Xr as QueryCondition, Xs as SchemaTableDropOperation, Xt as applyOperationsToPersistedColumnMappingsState, Y as buildInverseRelationLine, Ya as AttributeSchemaDelegate, Yi as DelegateUniqueWhere, Yn as RegisteredModel, Yo as EagerLoadRelations, Yr as QueryComparisonOperator, Ys as SchemaTableCreateOperation, Yt as PersistedTimestampColumn, Z as buildModelBlock, Za as AttributeUpdateInput, Zi as DelegateUpdateData, Zn as RuntimePathInput, Zo as JoinSource, Zr as QueryDayCondition, Zs as SchemaUniqueConstraint, Zt as createEmptyPersistedColumnMappingsState, _ as ensureArkormConfigLoading, _a as PrismaLikeSortOrder, _i as QuerySelectColumn, _n as QueryExecutionException, _o as QuerySchemaForModel, _r as SeederCallArgument, _s as BelongsToRelationMetadata, _t as resolveMigrationClassName, a as getRuntimeCompatibilityAdapter, aa as PaginationCurrentPageResolver, ai as QueryJoinNestedConstraint, an as readPersistedColumnMappingsState, ao as ModelDeclaredAttributeKey, ar as loadFactoriesFrom, as as FactoryAttributeResolver, at as deriveRelationFieldName, b as getDefaultStubsPath, ba as PrismaTransactionCapableClient, bi as RawQuerySpec, bn as ModelNotFoundException, bo as Model, br as PrismaDatabaseAdapter, bs as HasManyThroughRelationMetadata, bt as runPrismaCommand, c as PrismaDelegateMap, ca as PaginationURLDriver, ci as QueryJoinType, cn as resolveColumnMappingsFilePath, co as ModelEventHandlerConstructor, cr as loadSeedersFrom, cs as FactoryDefinition, ct as findEnumBlock, d as inferDelegateName, da as PrismaDelegateLike, di as QueryJsonConditionKind, dn as validatePersistedMetadataFeaturesForMigrations, do as ModelLifecycleState, dr as registerModels, ds as FactoryRelationshipResolver, dt as formatEnumDefaultValue, ea as EagerLoadMap, ec as TimestampNaming, ei as QueryGroupCondition, en as getPersistedEnumMap, eo as GlobalScope, er as getRegisteredFactories, es as WhereCallback, et as buildUniqueConstraintLine, f as awaitConfiguredModelsRegistration, fa as PrismaFindManyArgsLike, fi as QueryLogicalOperator, fn as writePersistedColumnMappingsState, fo as ModelOrderByInput, fr as registerPaths, fs as FactoryState, ft as formatRelationAction, g as emitRuntimeDebugEvent, ga as PrismaLikeSelect, gi as QueryScalarComparisonOperator, gn as RelationResolutionException, go as ModelWhereInput, gr as Seeder, gs as BelongsToManyRelationMetadata, gt as resolveEnumName, h as defineConfig, ha as PrismaLikeScalarFilter, hi as QueryRawCondition, hn as ScopeNotDefinedException, ho as ModelUpdateData, hr as SEEDER_BRAND, hs as DatabaseTablePersistedMetadataOptions, ht as pad, i as RuntimeModuleLoader, ia as NamingCase, ii as QueryJoinConstraint, in as getPersistedTimestampColumns, io as ModelCreateData, ir as getRegisteredSeeders, is as ArkormCollection, it as deriveRelationAlias, j as loadArkormConfig, ja as QuerySchemaUpdateArgs, ji as AdapterBindableModel, jn as SeedCommand, jr as AdapterModelIntrospectionOptions, js as AppliedMigrationEntry, jt as deleteAppliedMigrationsStateFromStore, k as isQuerySchemaLike, ka as QuerySchemaSelect, ki as UpdateSpec, kn as TableBuilder, kr as AdapterInspectionRequest, ks as RelationMetadata, kt as computeMigrationChecksum, l as createPrismaAdapter, la as PaginationURLDriverFactory, li as QueryJoinValueConstraint, ln as resolvePersistedMetadataFeatures, lo as ModelEventListener, lr as registerFactories, ls as FactoryDefinitionAttributes, lt as findModelBlock, m as configureArkormRuntime, ma as PrismaLikeOrderBy, mi as QueryOrderBy, mn as UniqueConstraintResolutionException, mo as ModelRelationshipResult, mr as resetRuntimeRegistryForTests, ms as DatabaseTableOptions, mt as getMigrationPlan, n as PivotModel, na as ModelQuerySchemaLike, ni as QueryJoinBoolean, nn as getPersistedPrimaryKeyGeneration, no as ModelAttributes, nr as getRegisteredModels, ns as LengthAwarePaginator, nt as deriveCollectionFieldName, o as resolveRuntimeCompatibilityQuerySchema, oa as PaginationMeta, oi as QueryJoinNullConstraint, on as rebuildPersistedColumnMappingsState, oo as ModelEventDispatcher, or as loadMigrationsFrom, os as FactoryAttributes, ot as deriveSingularFieldName, p as bindAdapterToModels, pa as PrismaLikeInclude, pi as QueryNotCondition, pn as UnsupportedAdapterFeatureException, po as ModelRelationshipKey, pr as registerSeeders, ps as MaybePromise, pt as generateMigrationFile, q as buildFieldLine, qa as AttributeOrderBy, qi as DelegateRows, qn as Arkormx, qo as RelationResultCache, qr as QueryColumnComparisonCondition, qs as SchemaPrimaryKey, qt as PersistedPrimaryKeyGeneration, r as LoadedRuntimeModule, ra as ModelTableCase, ri as QueryJoinColumnConstraint, rn as getPersistedTableMetadata, ro as ModelAttributesOf, rr as getRegisteredPaths, rs as Paginator, rt as deriveInverseRelationAlias, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as PaginationOptions, si as QueryJoinRawConstraint, sn as resetPersistedColumnMappingsCache, so as ModelEventHandler, sr as loadModelsFrom, ss as FactoryCallback, st as escapeRegex, t as URLDriver, ta as GetUserConfig, ti as QueryJoin, tn as getPersistedEnumTsType, to as ModelAttributeValue, tr as getRegisteredMigrations, ts as JoinClause, tt as createMigrationTimestamp, u as createPrismaDelegateMap, ua as PrismaClientLike, ui as QueryJsonCondition, un as syncPersistedColumnMappingsFromState, uo as ModelEventName, ur as registerMigrations, us as FactoryModelConstructor, ut as formatDefaultValue, v as getActiveTransactionAdapter, va as PrismaLikeWhereInput, vi as QueryTarget, vn as QueryExecutionExceptionContext, vo as QuerySchemaForModelInstance, vr as SeederConstructor, vs as ColumnMap, vt as resolvePrismaType, w as getRuntimePaginationCurrentPageResolver, wa as QuerySchemaFindManyArgs, wi as RelationLoadSpec, wn as DB, wr as KyselyDatabaseAdapter, ws as MorphManyRelationMetadata, wt as supportsDatabaseReset, x as getRuntimeAdapter, xa as PrismaTransactionContext, xi as RelationAggregateSpec, xn as MissingDelegateException, xo as InlineFactory, xr as PrismaDelegateNameMapping, xs as HasOneRelationMetadata, xt as stripPrismaSchemaModelsAndEnums, y as getActiveTransactionClient, ya as PrismaTransactionCallback, yi as QueryTimeCondition, yn as QueryConstraintException, yo as RelatedModelClass, yr as SeederInput, ys as HasManyRelationMetadata, yt as runMigrationWithPrisma, z as applyCreateTableOperation, za as TransactionCallback, zi as CastMap, zn as MakeMigrationCommand, zo as RelationAggregateInput, zr as DatabasePrimitive, zs as PrismaMigrationWorkflowOptions, zt as readAppliedMigrationsStateFromStore } from "./index-ClVzjhGq.mjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, CastDefinition, CastHandler, CastMap, CastType, CliApp, ClientResolver, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EagerLoadConstraint, EagerLoadMap, EagerLoadRelations, EnumBuilder, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, GenerateMigrationOptions, GeneratedMigrationFile, GetUserConfig, GlobalScope, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, KyselyDatabaseAdapter, LengthAwarePaginator, LoadedRuntimeModule, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MaybePromise, MigrateCommand, MigrateFreshCommand, MigrateRollbackCommand, Migration, MigrationClass, MigrationHistoryCommand, MigrationInstanceLike, MissingDelegateException, Model, ModelAttributeValue, ModelAttributes, ModelAttributesOf, ModelCreateData, ModelDeclaredAttributeKey, ModelEventDispatcher, ModelEventHandler, ModelEventHandlerConstructor, ModelEventListener, ModelEventName, ModelFactory, ModelLifecycleState, ModelMetadata, ModelNotFoundException, ModelOrderByInput, ModelQuerySchemaLike, ModelRelationshipKey, ModelRelationshipResult, ModelStatic, ModelTableCase, ModelUpdateData, ModelWhereInput, ModelsSyncCommand, MorphManyRelationMetadata, MorphOneRelationMetadata, MorphToManyRelationMetadata, MorphToRelationMetadata, NamingCase, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PersistedColumnMappingsState, PersistedMetadataFeatures, PersistedPrimaryKeyGeneration, PersistedTableMetadata, PersistedTimestampColumn, PivotModel, PivotModelStatic, PrimaryKeyGeneration, PrimaryKeyGenerationPlanner, PrismaClientLike, PrismaDatabaseAdapter, PrismaDelegateLike, PrismaDelegateMap, PrismaDelegateNameMapping, PrismaFindManyArgsLike, PrismaLikeInclude, PrismaLikeOrderBy, PrismaLikeScalarFilter, PrismaLikeSelect, PrismaLikeSortOrder, PrismaLikeWhereInput, PrismaMigrationWorkflowOptions, PrismaSchemaSyncOptions, PrismaTransactionCallback, PrismaTransactionCapableClient, PrismaTransactionContext, PrismaTransactionOptions, QueryBuilder, QueryColumnComparisonCondition, QueryComparisonCondition, QueryComparisonOperator, QueryCondition, QueryConstraintException, QueryDayCondition, QueryExecutionException, QueryExecutionExceptionContext, QueryExistsCondition, QueryFullTextCondition, QueryGroupCondition, QueryJoin, QueryJoinBoolean, QueryJoinColumnConstraint, QueryJoinConstraint, QueryJoinNestedConstraint, QueryJoinNullConstraint, QueryJoinRawConstraint, QueryJoinType, QueryJoinValueConstraint, QueryJsonCondition, QueryJsonConditionKind, QueryLogicalOperator, QueryNotCondition, QueryOrderBy, QueryRawCondition, QueryScalarComparisonOperator, QuerySchemaCreateData, QuerySchemaFindManyArgs, QuerySchemaForModel, QuerySchemaForModelInstance, QuerySchemaInclude, QuerySchemaOrderBy, QuerySchemaRow, QuerySchemaRows, QuerySchemaSelect, QuerySchemaUniqueWhere, QuerySchemaUpdateArgs, QuerySchemaUpdateData, QuerySchemaWhere, QuerySelectColumn, QueryTarget, QueryTimeCondition, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RelatedModelClass, RelatedModelForRelationship, RelatedModelFromResult, RelationAggregateConstraint, RelationAggregateInput, RelationAggregateSpec, RelationAggregateType, RelationColumnLookupSpec, RelationConstraint, RelationDefaultResolver, RelationDefaultValue, RelationFilterSpec, RelationLoadPlan, RelationLoadSpec, RelationMetadata, RelationMetadataProvider, RelationMetadataType, RelationResolutionException, RelationResult, RelationResultCache, RelationTableLookupSpec, RelationshipModelStatic, RuntimeClientLike, RuntimeConstructor, RuntimeModuleLoader, RuntimePathInput, RuntimePathKey, RuntimePathMap, SEEDER_BRAND, SchemaBuilder, SchemaColumn, SchemaColumnType, SchemaForeignKey, SchemaForeignKeyAction, SchemaIndex, SchemaOperation, SchemaPrimaryKey, SchemaTableAlterOperation, SchemaTableCreateOperation, SchemaTableDropOperation, SchemaUniqueConstraint, ScopeNotDefinedException, SeedCommand, Seeder, SeederCallArgument, SeederConstructor, SeederInput, SelectSpec, Serializable, SimplePaginationMeta, SoftDeleteConfig, SoftDeleteQueryMode, SortDirection, TableBuilder, TimestampColumnBehavior, TimestampNames, TimestampNaming, TransactionCallback, TransactionCapableClient, TransactionContext, TransactionOptions, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, UpdateManySpec, UpdateSpec, UpsertSpec, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, computeMigrationChecksum, configureArkormRuntime, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, findAppliedMigration, findEnumBlock, findModelBlock, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, pad, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, validatePersistedMetadataFeaturesForMigrations, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as applyOperationsToPersistedColumnMappingsState, $t as resolvePrismaType, A as getRuntimePrismaClient, An as writeAppliedMigrationsStateToStore, At as buildInverseRelationLine, B as getRegisteredModels, Bt as deriveRelationFieldName, C as getActiveTransactionClient, Cn as markMigrationRun, Ct as applyMigrationRollbackToPrismaSchema, D as getRuntimeDebugHandler, Dn as resolveMigrationStateFilePath, Dt as buildEnumBlock, E as getRuntimeClient, En as removeAppliedMigration, Et as applyOperationsToPrismaSchema, F as loadArkormConfig, Fn as RelationResolutionException, Ft as buildUniqueConstraintLine, G as loadModelsFrom, Gt as formatDefaultValue, H as getRegisteredSeeders, Ht as escapeRegex, I as resetArkormRuntimeForTests, In as ArkormCollection, It as createMigrationTimestamp, J as registerMigrations, Jt as generateMigrationFile, K as loadSeedersFrom, Kt as formatEnumDefaultValue, L as runArkormTransaction, Ln as ArkormException, Lt as deriveCollectionFieldName, M as isDelegateLike, Mn as UnsupportedAdapterFeatureException, Mt as buildModelBlock, N as isQuerySchemaLike, Nn as SetBasedEagerLoader, Nt as buildPrimaryKeyLine, O as getRuntimePaginationCurrentPageResolver, On as supportsDatabaseMigrationState, Ot as buildFieldLine, P as isTransactionCapableClient, Pt as buildRelationLine, Q as resetRuntimeRegistryForTests, Qt as resolveMigrationClassName, R as getRegisteredFactories, Rt as deriveInverseRelationAlias, S as getActiveTransactionAdapter, Sn as markMigrationApplied, St as applyMigrationRollbackToDatabase, T as getRuntimeAdapter, Tn as readAppliedMigrationsStateFromStore, Tt as applyMigrationToPrismaSchema, U as loadFactoriesFrom, Ut as findEnumBlock, V as getRegisteredPaths, Vt as deriveSingularFieldName, W as loadMigrationsFrom, Wt as findModelBlock, X as registerPaths, Xt as pad, Y as registerModels, Yt as getMigrationPlan, Z as registerSeeders, Zt as resolveEnumName, _ as bindAdapterToModels, _n as deleteAppliedMigrationsStateFromStore, _t as PRISMA_ENUM_REGEX, a as HasOneThroughRelation, an as supportsDatabaseReset, at as getPersistedPrimaryKeyGeneration, b as emitRuntimeDebugEvent, bn as getLatestAppliedMigrations, bt as applyCreateTableOperation, c as HasManyRelation, cn as SchemaBuilder, ct as readPersistedColumnMappingsState, d as BelongsToManyRelation, dn as PrimaryKeyGenerationPlanner, dt as resolveColumnMappingsFilePath, en as runMigrationWithPrisma, et as createEmptyPersistedColumnMappingsState, f as Relation, fn as ForeignKeyBuilder, ft as resolvePersistedMetadataFeatures, g as awaitConfiguredModelsRegistration, gn as createEmptyAppliedMigrationsState, gt as PRISMA_ENUM_MEMBER_REGEX, h as URLDriver, hn as computeMigrationChecksum, ht as writePersistedColumnMappingsState, i as MorphManyRelation, in as supportsDatabaseMigrationExecution, it as getPersistedEnumTsType, j as getUserConfig, jn as RuntimeModuleLoader, jt as buildMigrationSource, k as getRuntimePaginationURLDriverFactory, kn as writeAppliedMigrationsState, kt as buildIndexLine, l as BelongsToRelation, ln as EnumBuilder, lt as rebuildPersistedColumnMappingsState, m as Paginator, mn as buildMigrationRunId, mt as validatePersistedMetadataFeaturesForMigrations, n as MorphToManyRelation, nn as stripPrismaSchemaModelsAndEnums, nt as getPersistedColumnMap, o as HasOneRelation, on as toMigrationFileSlug, ot as getPersistedTableMetadata, p as LengthAwarePaginator, pn as buildMigrationIdentity, pt as syncPersistedColumnMappingsFromState, q as registerFactories, qt as formatRelationAction, r as MorphOneRelation, rn as supportsDatabaseCreation, rt as getPersistedEnumMap, s as HasManyThroughRelation, sn as toModelName, st as getPersistedTimestampColumns, t as MorphToRelation, tn as runPrismaCommand, tt as deletePersistedColumnMappingsState, un as TableBuilder, ut as resetPersistedColumnMappingsCache, v as configureArkormRuntime, vn as findAppliedMigration, vt as PRISMA_MODEL_REGEX, w as getDefaultStubsPath, wn as readAppliedMigrationsState, wt as applyMigrationToDatabase, x as ensureArkormConfigLoading, xn as isMigrationApplied, xt as applyDropTableOperation, y as defineConfig, yn as getLastMigrationRun, yt as applyAlterTableOperation, z as getRegisteredMigrations, zt as deriveRelationAlias } from "./relationship-
|
|
1
|
+
import { $ as applyOperationsToPersistedColumnMappingsState, $t as resolvePrismaType, A as getRuntimePrismaClient, An as writeAppliedMigrationsStateToStore, At as buildInverseRelationLine, B as getRegisteredModels, Bt as deriveRelationFieldName, C as getActiveTransactionClient, Cn as markMigrationRun, Ct as applyMigrationRollbackToPrismaSchema, D as getRuntimeDebugHandler, Dn as resolveMigrationStateFilePath, Dt as buildEnumBlock, E as getRuntimeClient, En as removeAppliedMigration, Et as applyOperationsToPrismaSchema, F as loadArkormConfig, Fn as RelationResolutionException, Ft as buildUniqueConstraintLine, G as loadModelsFrom, Gt as formatDefaultValue, H as getRegisteredSeeders, Ht as escapeRegex, I as resetArkormRuntimeForTests, In as ArkormCollection, It as createMigrationTimestamp, J as registerMigrations, Jt as generateMigrationFile, K as loadSeedersFrom, Kt as formatEnumDefaultValue, L as runArkormTransaction, Ln as ArkormException, Lt as deriveCollectionFieldName, M as isDelegateLike, Mn as UnsupportedAdapterFeatureException, Mt as buildModelBlock, N as isQuerySchemaLike, Nn as SetBasedEagerLoader, Nt as buildPrimaryKeyLine, O as getRuntimePaginationCurrentPageResolver, On as supportsDatabaseMigrationState, Ot as buildFieldLine, P as isTransactionCapableClient, Pt as buildRelationLine, Q as resetRuntimeRegistryForTests, Qt as resolveMigrationClassName, R as getRegisteredFactories, Rt as deriveInverseRelationAlias, S as getActiveTransactionAdapter, Sn as markMigrationApplied, St as applyMigrationRollbackToDatabase, T as getRuntimeAdapter, Tn as readAppliedMigrationsStateFromStore, Tt as applyMigrationToPrismaSchema, U as loadFactoriesFrom, Ut as findEnumBlock, V as getRegisteredPaths, Vt as deriveSingularFieldName, W as loadMigrationsFrom, Wt as findModelBlock, X as registerPaths, Xt as pad, Y as registerModels, Yt as getMigrationPlan, Z as registerSeeders, Zt as resolveEnumName, _ as bindAdapterToModels, _n as deleteAppliedMigrationsStateFromStore, _t as PRISMA_ENUM_REGEX, a as HasOneThroughRelation, an as supportsDatabaseReset, at as getPersistedPrimaryKeyGeneration, b as emitRuntimeDebugEvent, bn as getLatestAppliedMigrations, bt as applyCreateTableOperation, c as HasManyRelation, cn as SchemaBuilder, ct as readPersistedColumnMappingsState, d as BelongsToManyRelation, dn as PrimaryKeyGenerationPlanner, dt as resolveColumnMappingsFilePath, en as runMigrationWithPrisma, et as createEmptyPersistedColumnMappingsState, f as Relation, fn as ForeignKeyBuilder, ft as resolvePersistedMetadataFeatures, g as awaitConfiguredModelsRegistration, gn as createEmptyAppliedMigrationsState, gt as PRISMA_ENUM_MEMBER_REGEX, h as URLDriver, hn as computeMigrationChecksum, ht as writePersistedColumnMappingsState, i as MorphManyRelation, in as supportsDatabaseMigrationExecution, it as getPersistedEnumTsType, j as getUserConfig, jn as RuntimeModuleLoader, jt as buildMigrationSource, k as getRuntimePaginationURLDriverFactory, kn as writeAppliedMigrationsState, kt as buildIndexLine, l as BelongsToRelation, ln as EnumBuilder, lt as rebuildPersistedColumnMappingsState, m as Paginator, mn as buildMigrationRunId, mt as validatePersistedMetadataFeaturesForMigrations, n as MorphToManyRelation, nn as stripPrismaSchemaModelsAndEnums, nt as getPersistedColumnMap, o as HasOneRelation, on as toMigrationFileSlug, ot as getPersistedTableMetadata, p as LengthAwarePaginator, pn as buildMigrationIdentity, pt as syncPersistedColumnMappingsFromState, q as registerFactories, qt as formatRelationAction, r as MorphOneRelation, rn as supportsDatabaseCreation, rt as getPersistedEnumMap, s as HasManyThroughRelation, sn as toModelName, st as getPersistedTimestampColumns, t as MorphToRelation, tn as runPrismaCommand, tt as deletePersistedColumnMappingsState, un as TableBuilder, ut as resetPersistedColumnMappingsCache, v as configureArkormRuntime, vn as findAppliedMigration, vt as PRISMA_MODEL_REGEX, w as getDefaultStubsPath, wn as readAppliedMigrationsState, wt as applyMigrationToDatabase, x as ensureArkormConfigLoading, xn as isMigrationApplied, xt as applyDropTableOperation, y as defineConfig, yn as getLastMigrationRun, yt as applyAlterTableOperation, z as getRegisteredMigrations, zt as deriveRelationAlias } from "./relationship-SFhKrphd.mjs";
|
|
2
2
|
import { Pool } from "pg";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { createRequire } from "module";
|
|
@@ -450,12 +450,60 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
450
450
|
const table = this.resolveMappedTable(operation.table);
|
|
451
451
|
await this.ensureEnumTypes(table, operation.addColumns, executor);
|
|
452
452
|
for (const column of operation.addColumns) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add column if not exists ${this.buildSchemaColumnDefinition(table, column)}`, executor);
|
|
453
|
+
for (const column of operation.changeColumns ?? []) await this.executeChangeColumn(table, column, executor);
|
|
453
454
|
for (const column of operation.dropColumns) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} drop column if exists ${this.quoteIdentifier(column)}`, executor);
|
|
454
455
|
for (const foreignKey of operation.addForeignKeys ?? []) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaForeignKeyConstraint(table, foreignKey, operation.addColumns)}`, executor);
|
|
455
456
|
if (operation.addPrimaryKey) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaPrimaryKeyConstraint(table, operation.addPrimaryKey, operation.addColumns)}`, executor);
|
|
456
457
|
for (const constraint of operation.addUniqueConstraints ?? []) await this.executeRawStatement(`alter table ${this.quoteIdentifier(table)} add ${this.buildSchemaUniqueConstraint(table, constraint, operation.addColumns)}`, executor);
|
|
457
458
|
for (const index of operation.addIndexes ?? []) await this.executeRawStatement(this.buildSchemaIndexStatement(table, index, operation.addColumns), executor);
|
|
458
459
|
}
|
|
460
|
+
async enumTypeExists(enumName, executor) {
|
|
461
|
+
const result = await sql`
|
|
462
|
+
select exists(select 1 from pg_type where typname = ${enumName}) as exists
|
|
463
|
+
`.execute(executor);
|
|
464
|
+
return Boolean(result.rows[0]?.exists);
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Redefine an existing column in place using ALTER COLUMN statements: the
|
|
468
|
+
* column type (recreating the enum type when enum values change), nullability,
|
|
469
|
+
* default, and a conventionally-named unique constraint.
|
|
470
|
+
*
|
|
471
|
+
* @param table
|
|
472
|
+
* @param column
|
|
473
|
+
* @param executor
|
|
474
|
+
*/
|
|
475
|
+
async executeChangeColumn(table, column, executor) {
|
|
476
|
+
const quotedTable = this.quoteIdentifier(table);
|
|
477
|
+
const physicalName = column.map ?? column.name;
|
|
478
|
+
const physical = this.quoteIdentifier(physicalName);
|
|
479
|
+
if (column.type === "enum") {
|
|
480
|
+
const enumName = this.resolveSchemaEnumName(table, column);
|
|
481
|
+
const values = column.enumValues ?? [];
|
|
482
|
+
if (values.length === 0) throw new ArkormException(`Enum column [${column.name}] requires enum values to change its definition.`);
|
|
483
|
+
const quotedEnum = this.quoteIdentifier(enumName);
|
|
484
|
+
const enumLiterals = values.map((value) => this.quoteLiteral(value)).join(", ");
|
|
485
|
+
if (await this.enumTypeExists(enumName, executor)) {
|
|
486
|
+
const tempEnum = this.quoteIdentifier(`${enumName}__arkorm_change`);
|
|
487
|
+
await this.executeRawStatement(`drop type if exists ${tempEnum}`, executor);
|
|
488
|
+
await this.executeRawStatement(`alter type ${quotedEnum} rename to ${tempEnum}`, executor);
|
|
489
|
+
await this.executeRawStatement(`create type ${quotedEnum} as enum (${enumLiterals})`, executor);
|
|
490
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${quotedEnum} using ${physical}::text::${quotedEnum}`, executor);
|
|
491
|
+
await this.executeRawStatement(`drop type ${tempEnum}`, executor);
|
|
492
|
+
} else {
|
|
493
|
+
await this.executeRawStatement(`create type ${quotedEnum} as enum (${enumLiterals})`, executor);
|
|
494
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${quotedEnum} using ${physical}::text::${quotedEnum}`, executor);
|
|
495
|
+
}
|
|
496
|
+
} else {
|
|
497
|
+
const targetType = this.resolveSchemaColumnType(table, column);
|
|
498
|
+
await this.executeRawStatement(`alter table ${quotedTable} alter column ${physical} type ${targetType} using ${physical}::${targetType}`, executor);
|
|
499
|
+
}
|
|
500
|
+
await this.executeRawStatement(column.nullable ? `alter table ${quotedTable} alter column ${physical} drop not null` : `alter table ${quotedTable} alter column ${physical} set not null`, executor);
|
|
501
|
+
const defaultValue = this.resolveSchemaColumnDefault(column);
|
|
502
|
+
await this.executeRawStatement(defaultValue ? `alter table ${quotedTable} alter column ${physical} set default ${defaultValue}` : `alter table ${quotedTable} alter column ${physical} drop default`, executor);
|
|
503
|
+
const constraint = this.quoteIdentifier(`${table}_${physicalName}_key`);
|
|
504
|
+
await this.executeRawStatement(`alter table ${quotedTable} drop constraint if exists ${constraint}`, executor);
|
|
505
|
+
if (column.unique) await this.executeRawStatement(`alter table ${quotedTable} add constraint ${constraint} unique (${physical})`, executor);
|
|
506
|
+
}
|
|
459
507
|
async executeDropTableOperation(operation, executor) {
|
|
460
508
|
const table = this.resolveMappedTable(operation.table);
|
|
461
509
|
await this.executeRawStatement(`drop table if exists ${this.quoteIdentifier(table)} cascade`, executor);
|
|
@@ -3325,6 +3373,14 @@ var Migration = class {
|
|
|
3325
3373
|
static {
|
|
3326
3374
|
this[MIGRATION_BRAND] = true;
|
|
3327
3375
|
}
|
|
3376
|
+
/**
|
|
3377
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
3378
|
+
* have been applied to the database, for either direction. Override it to run
|
|
3379
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
3380
|
+
*
|
|
3381
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
3382
|
+
*/
|
|
3383
|
+
done(_direction) {}
|
|
3328
3384
|
};
|
|
3329
3385
|
|
|
3330
3386
|
//#endregion
|
|
@@ -8190,6 +8246,22 @@ var Model = class Model {
|
|
|
8190
8246
|
});
|
|
8191
8247
|
return this;
|
|
8192
8248
|
}
|
|
8249
|
+
/**
|
|
8250
|
+
* Merge already-stored (database representation) attribute values into the
|
|
8251
|
+
* model without running set mutators or casts. Used to refresh the instance
|
|
8252
|
+
* from a row returned by a write, where the values are already in storage
|
|
8253
|
+
* form and must not be re-cast (re-applying a non-idempotent set-cast such as
|
|
8254
|
+
* a money or array cast would corrupt the value).
|
|
8255
|
+
*
|
|
8256
|
+
* @param attributes
|
|
8257
|
+
* @returns
|
|
8258
|
+
*/
|
|
8259
|
+
fillRawAttributes(attributes) {
|
|
8260
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
8261
|
+
this.attributes[key] = Model.cloneAttributeValue(value);
|
|
8262
|
+
});
|
|
8263
|
+
return this;
|
|
8264
|
+
}
|
|
8193
8265
|
async update(attributes) {
|
|
8194
8266
|
try {
|
|
8195
8267
|
const primaryKey = this.constructor.getPrimaryKey();
|
|
@@ -8245,7 +8317,7 @@ var Model = class Model {
|
|
|
8245
8317
|
await Model.dispatchEvent(constructor, "creating", this);
|
|
8246
8318
|
const payload = this.normalizePersistenceAttributes(this.getRawAttributes());
|
|
8247
8319
|
const model = await constructor.query().create(payload);
|
|
8248
|
-
this.
|
|
8320
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8249
8321
|
this.syncChanges(previousOriginal);
|
|
8250
8322
|
this.syncPrevious(previousOriginal);
|
|
8251
8323
|
this.syncOriginal();
|
|
@@ -8262,7 +8334,7 @@ var Model = class Model {
|
|
|
8262
8334
|
const payload = this.normalizePersistenceAttributes(this.getDirtyAttributes());
|
|
8263
8335
|
delete payload[primaryKey];
|
|
8264
8336
|
const model = await constructor.query().where({ [primaryKey]: identifier }).update(payload);
|
|
8265
|
-
this.
|
|
8337
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8266
8338
|
this.syncChanges(previousOriginal);
|
|
8267
8339
|
this.syncPrevious(previousOriginal);
|
|
8268
8340
|
this.syncOriginal();
|
|
@@ -8305,7 +8377,7 @@ var Model = class Model {
|
|
|
8305
8377
|
const softDeleteConfig = constructor.getSoftDeleteConfig();
|
|
8306
8378
|
if (softDeleteConfig.enabled) {
|
|
8307
8379
|
const model = await constructor.query().where({ [primaryKey]: identifier }).update({ [softDeleteConfig.column]: /* @__PURE__ */ new Date() });
|
|
8308
|
-
this.
|
|
8380
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8309
8381
|
this.syncChanges(previousOriginal);
|
|
8310
8382
|
this.syncOriginal();
|
|
8311
8383
|
await Model.dispatchEvent(constructor, "deleted", this);
|
|
@@ -8380,7 +8452,7 @@ var Model = class Model {
|
|
|
8380
8452
|
const previousOriginal = this.getOriginal();
|
|
8381
8453
|
await Model.dispatchEvent(constructor, "restoring", this);
|
|
8382
8454
|
const model = await constructor.query().withTrashed().where({ [primaryKey]: identifier }).update({ [softDeleteConfig.column]: null });
|
|
8383
|
-
this.
|
|
8455
|
+
this.fillRawAttributes(model.getRawAttributes());
|
|
8384
8456
|
this.syncChanges(previousOriginal);
|
|
8385
8457
|
this.syncOriginal();
|
|
8386
8458
|
await Model.dispatchEvent(constructor, "restored", this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_relationship = require('../relationship-
|
|
2
|
+
const require_relationship = require('../relationship-DWtfgLfh.cjs');
|
|
3
3
|
|
|
4
4
|
exports.BelongsToManyRelation = require_relationship.BelongsToManyRelation;
|
|
5
5
|
exports.BelongsToRelation = require_relationship.BelongsToRelation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ao as HasOneRelation, Do as MorphOneRelation, Eo as MorphToManyRelation, Fo as BelongsToManyRelation, Io as Relation, Lo as RelationTableLoader, Mo as HasManyRelation, No as BelongsToRelation, Oo as MorphManyRelation, Po as SingleResultRelation, To as MorphToRelation, jo as HasManyThroughRelation, ko as HasOneThroughRelation, wo as SetBasedEagerLoader } from "../index-
|
|
1
|
+
import { Ao as HasOneRelation, Do as MorphOneRelation, Eo as MorphToManyRelation, Fo as BelongsToManyRelation, Io as Relation, Lo as RelationTableLoader, Mo as HasManyRelation, No as BelongsToRelation, Oo as MorphManyRelation, Po as SingleResultRelation, To as MorphToRelation, jo as HasManyThroughRelation, ko as HasOneThroughRelation, wo as SetBasedEagerLoader } from "../index-CGawfwb8.cjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ao as HasOneRelation, Do as MorphOneRelation, Eo as MorphToManyRelation, Fo as BelongsToManyRelation, Io as Relation, Lo as RelationTableLoader, Mo as HasManyRelation, No as BelongsToRelation, Oo as MorphManyRelation, Po as SingleResultRelation, To as MorphToRelation, jo as HasManyThroughRelation, ko as HasOneThroughRelation, wo as SetBasedEagerLoader } from "../index-
|
|
1
|
+
import { Ao as HasOneRelation, Do as MorphOneRelation, Eo as MorphToManyRelation, Fo as BelongsToManyRelation, Io as Relation, Lo as RelationTableLoader, Mo as HasManyRelation, No as BelongsToRelation, Oo as MorphManyRelation, Po as SingleResultRelation, To as MorphToRelation, jo as HasManyThroughRelation, ko as HasOneThroughRelation, wo as SetBasedEagerLoader } from "../index-ClVzjhGq.mjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Nn as SetBasedEagerLoader, Pn as RelationTableLoader, a as HasOneThroughRelation, c as HasManyRelation, d as BelongsToManyRelation, f as Relation, i as MorphManyRelation, l as BelongsToRelation, n as MorphToManyRelation, o as HasOneRelation, r as MorphOneRelation, s as HasManyThroughRelation, t as MorphToRelation, u as SingleResultRelation } from "../relationship-
|
|
1
|
+
import { Nn as SetBasedEagerLoader, Pn as RelationTableLoader, a as HasOneThroughRelation, c as HasManyRelation, d as BelongsToManyRelation, f as Relation, i as MorphManyRelation, l as BelongsToRelation, n as MorphToManyRelation, o as HasOneRelation, r as MorphOneRelation, s as HasManyThroughRelation, t as MorphToRelation, u as SingleResultRelation } from "../relationship-SFhKrphd.mjs";
|
|
2
2
|
|
|
3
3
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1218,6 +1218,15 @@ var EnumBuilder = class {
|
|
|
1218
1218
|
this.tableBuilder.map(name, this.columnName);
|
|
1219
1219
|
return this;
|
|
1220
1220
|
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
1223
|
+
*
|
|
1224
|
+
* @returns
|
|
1225
|
+
*/
|
|
1226
|
+
change() {
|
|
1227
|
+
this.tableBuilder.change(this.columnName);
|
|
1228
|
+
return this;
|
|
1229
|
+
}
|
|
1221
1230
|
};
|
|
1222
1231
|
/**
|
|
1223
1232
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -1230,6 +1239,7 @@ var TableBuilder = class {
|
|
|
1230
1239
|
constructor() {
|
|
1231
1240
|
this.columns = [];
|
|
1232
1241
|
this.dropColumnNames = [];
|
|
1242
|
+
this.changeColumnNames = /* @__PURE__ */ new Set();
|
|
1233
1243
|
this.indexes = [];
|
|
1234
1244
|
this.foreignKeys = [];
|
|
1235
1245
|
this.compositeUniqueConstraints = [];
|
|
@@ -1543,6 +1553,24 @@ var TableBuilder = class {
|
|
|
1543
1553
|
return this;
|
|
1544
1554
|
}
|
|
1545
1555
|
/**
|
|
1556
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
1557
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
1558
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
1559
|
+
*
|
|
1560
|
+
* ```ts
|
|
1561
|
+
* table.string('status').default('active').change()
|
|
1562
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
1563
|
+
* ```
|
|
1564
|
+
*
|
|
1565
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
1566
|
+
* @returns The current TableBuilder instance for chaining.
|
|
1567
|
+
*/
|
|
1568
|
+
change(columnName) {
|
|
1569
|
+
const column = this.resolveColumn(columnName);
|
|
1570
|
+
this.changeColumnNames.add(column.name);
|
|
1571
|
+
return this;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1546
1574
|
* Marks a column as nullable.
|
|
1547
1575
|
*
|
|
1548
1576
|
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
@@ -1651,7 +1679,18 @@ var TableBuilder = class {
|
|
|
1651
1679
|
* @returns
|
|
1652
1680
|
*/
|
|
1653
1681
|
getColumns() {
|
|
1654
|
-
return this.columns.map((column) => ({
|
|
1682
|
+
return this.columns.filter((column) => !this.changeColumnNames.has(column.name)).map((column) => ({
|
|
1683
|
+
...column,
|
|
1684
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1685
|
+
}));
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
1689
|
+
*
|
|
1690
|
+
* @returns
|
|
1691
|
+
*/
|
|
1692
|
+
getChangeColumns() {
|
|
1693
|
+
return this.columns.filter((column) => this.changeColumnNames.has(column.name)).map((column) => ({
|
|
1655
1694
|
...column,
|
|
1656
1695
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1657
1696
|
}));
|
|
@@ -1873,6 +1912,7 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1873
1912
|
type: "alterTable",
|
|
1874
1913
|
table,
|
|
1875
1914
|
addColumns: builder.getColumns(),
|
|
1915
|
+
changeColumns: builder.getChangeColumns(),
|
|
1876
1916
|
dropColumns: builder.getDropColumns(),
|
|
1877
1917
|
addIndexes: builder.getIndexes(),
|
|
1878
1918
|
addForeignKeys: builder.getForeignKeys(),
|
|
@@ -1927,6 +1967,10 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1927
1967
|
...column,
|
|
1928
1968
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1929
1969
|
})),
|
|
1970
|
+
changeColumns: operation.changeColumns?.map((column) => ({
|
|
1971
|
+
...column,
|
|
1972
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1973
|
+
})),
|
|
1930
1974
|
dropColumns: [...operation.dropColumns],
|
|
1931
1975
|
addIndexes: operation.addIndexes.map((index) => ({
|
|
1932
1976
|
...index,
|
|
@@ -2431,11 +2475,18 @@ const applyCreateTableOperation = (schema, operation) => {
|
|
|
2431
2475
|
const applyAlterTableOperation = (schema, operation) => {
|
|
2432
2476
|
const model = findModelBlock(schema, operation.table);
|
|
2433
2477
|
if (!model) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
2434
|
-
const schemaWithEnums = ensureEnumBlocks(schema, operation.addColumns);
|
|
2478
|
+
const schemaWithEnums = ensureEnumBlocks(schema, [...operation.addColumns, ...operation.changeColumns ?? []]);
|
|
2435
2479
|
const refreshedModel = findModelBlock(schemaWithEnums, operation.table);
|
|
2436
2480
|
if (!refreshedModel) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
2437
2481
|
let block = refreshedModel.block;
|
|
2438
2482
|
const bodyLines = block.split("\n");
|
|
2483
|
+
(operation.changeColumns ?? []).forEach((column) => {
|
|
2484
|
+
const fieldLine = buildFieldLine(column);
|
|
2485
|
+
const columnRegex = new RegExp(`^\\s*${escapeRegex(column.name)}\\s+`);
|
|
2486
|
+
const index = bodyLines.findIndex((line) => columnRegex.test(line));
|
|
2487
|
+
if (index >= 0) bodyLines.splice(index, 1, fieldLine);
|
|
2488
|
+
else bodyLines.splice(Math.max(1, bodyLines.length - 1), 0, fieldLine);
|
|
2489
|
+
});
|
|
2439
2490
|
operation.dropColumns.forEach((column) => {
|
|
2440
2491
|
const columnRegex = new RegExp(`^\\s*${escapeRegex(column)}\\s+`);
|
|
2441
2492
|
for (let index = 0; index < bodyLines.length; index += 1) if (columnRegex.test(bodyLines[index])) {
|
|
@@ -2660,14 +2711,18 @@ const stripPrismaSchemaModelsAndEnums = (schema) => {
|
|
|
2660
2711
|
};
|
|
2661
2712
|
const applyMigrationToDatabase = async (adapter, migration) => {
|
|
2662
2713
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
2663
|
-
const
|
|
2714
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
2715
|
+
const operations = await getMigrationPlan(instance, "up");
|
|
2664
2716
|
await adapter.executeSchemaOperations(operations);
|
|
2717
|
+
await instance.done?.("up");
|
|
2665
2718
|
return { operations };
|
|
2666
2719
|
};
|
|
2667
2720
|
const applyMigrationRollbackToDatabase = async (adapter, migration) => {
|
|
2668
2721
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
2669
|
-
const
|
|
2722
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
2723
|
+
const operations = await getMigrationPlan(instance, "down");
|
|
2670
2724
|
await adapter.executeSchemaOperations(operations);
|
|
2725
|
+
await instance.done?.("down");
|
|
2671
2726
|
return { operations };
|
|
2672
2727
|
};
|
|
2673
2728
|
/**
|
|
@@ -1190,6 +1190,15 @@ var EnumBuilder = class {
|
|
|
1190
1190
|
this.tableBuilder.map(name, this.columnName);
|
|
1191
1191
|
return this;
|
|
1192
1192
|
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
1195
|
+
*
|
|
1196
|
+
* @returns
|
|
1197
|
+
*/
|
|
1198
|
+
change() {
|
|
1199
|
+
this.tableBuilder.change(this.columnName);
|
|
1200
|
+
return this;
|
|
1201
|
+
}
|
|
1193
1202
|
};
|
|
1194
1203
|
/**
|
|
1195
1204
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -1202,6 +1211,7 @@ var TableBuilder = class {
|
|
|
1202
1211
|
constructor() {
|
|
1203
1212
|
this.columns = [];
|
|
1204
1213
|
this.dropColumnNames = [];
|
|
1214
|
+
this.changeColumnNames = /* @__PURE__ */ new Set();
|
|
1205
1215
|
this.indexes = [];
|
|
1206
1216
|
this.foreignKeys = [];
|
|
1207
1217
|
this.compositeUniqueConstraints = [];
|
|
@@ -1515,6 +1525,24 @@ var TableBuilder = class {
|
|
|
1515
1525
|
return this;
|
|
1516
1526
|
}
|
|
1517
1527
|
/**
|
|
1528
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
1529
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
1530
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
1531
|
+
*
|
|
1532
|
+
* ```ts
|
|
1533
|
+
* table.string('status').default('active').change()
|
|
1534
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
1535
|
+
* ```
|
|
1536
|
+
*
|
|
1537
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
1538
|
+
* @returns The current TableBuilder instance for chaining.
|
|
1539
|
+
*/
|
|
1540
|
+
change(columnName) {
|
|
1541
|
+
const column = this.resolveColumn(columnName);
|
|
1542
|
+
this.changeColumnNames.add(column.name);
|
|
1543
|
+
return this;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1518
1546
|
* Marks a column as nullable.
|
|
1519
1547
|
*
|
|
1520
1548
|
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
@@ -1623,7 +1651,18 @@ var TableBuilder = class {
|
|
|
1623
1651
|
* @returns
|
|
1624
1652
|
*/
|
|
1625
1653
|
getColumns() {
|
|
1626
|
-
return this.columns.map((column) => ({
|
|
1654
|
+
return this.columns.filter((column) => !this.changeColumnNames.has(column.name)).map((column) => ({
|
|
1655
|
+
...column,
|
|
1656
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1657
|
+
}));
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
1661
|
+
*
|
|
1662
|
+
* @returns
|
|
1663
|
+
*/
|
|
1664
|
+
getChangeColumns() {
|
|
1665
|
+
return this.columns.filter((column) => this.changeColumnNames.has(column.name)).map((column) => ({
|
|
1627
1666
|
...column,
|
|
1628
1667
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1629
1668
|
}));
|
|
@@ -1845,6 +1884,7 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1845
1884
|
type: "alterTable",
|
|
1846
1885
|
table,
|
|
1847
1886
|
addColumns: builder.getColumns(),
|
|
1887
|
+
changeColumns: builder.getChangeColumns(),
|
|
1848
1888
|
dropColumns: builder.getDropColumns(),
|
|
1849
1889
|
addIndexes: builder.getIndexes(),
|
|
1850
1890
|
addForeignKeys: builder.getForeignKeys(),
|
|
@@ -1899,6 +1939,10 @@ var SchemaBuilder = class SchemaBuilder {
|
|
|
1899
1939
|
...column,
|
|
1900
1940
|
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1901
1941
|
})),
|
|
1942
|
+
changeColumns: operation.changeColumns?.map((column) => ({
|
|
1943
|
+
...column,
|
|
1944
|
+
enumValues: column.enumValues ? [...column.enumValues] : void 0
|
|
1945
|
+
})),
|
|
1902
1946
|
dropColumns: [...operation.dropColumns],
|
|
1903
1947
|
addIndexes: operation.addIndexes.map((index) => ({
|
|
1904
1948
|
...index,
|
|
@@ -2403,11 +2447,18 @@ const applyCreateTableOperation = (schema, operation) => {
|
|
|
2403
2447
|
const applyAlterTableOperation = (schema, operation) => {
|
|
2404
2448
|
const model = findModelBlock(schema, operation.table);
|
|
2405
2449
|
if (!model) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
2406
|
-
const schemaWithEnums = ensureEnumBlocks(schema, operation.addColumns);
|
|
2450
|
+
const schemaWithEnums = ensureEnumBlocks(schema, [...operation.addColumns, ...operation.changeColumns ?? []]);
|
|
2407
2451
|
const refreshedModel = findModelBlock(schemaWithEnums, operation.table);
|
|
2408
2452
|
if (!refreshedModel) throw new ArkormException(`Prisma model for table [${operation.table}] was not found.`);
|
|
2409
2453
|
let block = refreshedModel.block;
|
|
2410
2454
|
const bodyLines = block.split("\n");
|
|
2455
|
+
(operation.changeColumns ?? []).forEach((column) => {
|
|
2456
|
+
const fieldLine = buildFieldLine(column);
|
|
2457
|
+
const columnRegex = new RegExp(`^\\s*${escapeRegex(column.name)}\\s+`);
|
|
2458
|
+
const index = bodyLines.findIndex((line) => columnRegex.test(line));
|
|
2459
|
+
if (index >= 0) bodyLines.splice(index, 1, fieldLine);
|
|
2460
|
+
else bodyLines.splice(Math.max(1, bodyLines.length - 1), 0, fieldLine);
|
|
2461
|
+
});
|
|
2411
2462
|
operation.dropColumns.forEach((column) => {
|
|
2412
2463
|
const columnRegex = new RegExp(`^\\s*${escapeRegex(column)}\\s+`);
|
|
2413
2464
|
for (let index = 0; index < bodyLines.length; index += 1) if (columnRegex.test(bodyLines[index])) {
|
|
@@ -2632,14 +2683,18 @@ const stripPrismaSchemaModelsAndEnums = (schema) => {
|
|
|
2632
2683
|
};
|
|
2633
2684
|
const applyMigrationToDatabase = async (adapter, migration) => {
|
|
2634
2685
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
2635
|
-
const
|
|
2686
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
2687
|
+
const operations = await getMigrationPlan(instance, "up");
|
|
2636
2688
|
await adapter.executeSchemaOperations(operations);
|
|
2689
|
+
await instance.done?.("up");
|
|
2637
2690
|
return { operations };
|
|
2638
2691
|
};
|
|
2639
2692
|
const applyMigrationRollbackToDatabase = async (adapter, migration) => {
|
|
2640
2693
|
if (!supportsDatabaseMigrationExecution(adapter)) throw new ArkormException("The configured adapter does not support database-backed migration execution.");
|
|
2641
|
-
const
|
|
2694
|
+
const instance = typeof migration === "function" ? new migration() : migration;
|
|
2695
|
+
const operations = await getMigrationPlan(instance, "down");
|
|
2642
2696
|
await adapter.executeSchemaOperations(operations);
|
|
2697
|
+
await instance.done?.("down");
|
|
2643
2698
|
return { operations };
|
|
2644
2699
|
};
|
|
2645
2700
|
/**
|