arkormx 2.12.9 → 2.12.10
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 +87 -31
- package/dist/{index-Lxl6NdHS.d.cts → index-BYL9S6st.d.mts} +26 -2
- package/dist/{index-O3-Mi7hj.d.mts → index-CDSTYl6q.d.cts} +26 -2
- package/dist/index.cjs +78 -27
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +78 -27
- 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-D7MhPUIX.cjs → relationship-ChCzFqO1.cjs} +42 -10
- package/dist/{relationship-DZ4WJ0Si.mjs → relationship-PB57C4Pt.mjs} +42 -10
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -242,6 +242,9 @@ const readAppliedMigrationsState = (stateFilePath) => {
|
|
|
242
242
|
version: 1,
|
|
243
243
|
migrations: parsed.migrations.filter((migration) => {
|
|
244
244
|
return typeof migration?.id === "string" && typeof migration?.file === "string" && typeof migration?.className === "string" && typeof migration?.appliedAt === "string" && (migration?.checksum === void 0 || typeof migration?.checksum === "string");
|
|
245
|
+
}).map((migration) => migration.operations === void 0 || Array.isArray(migration.operations) ? migration : {
|
|
246
|
+
...migration,
|
|
247
|
+
operations: void 0
|
|
245
248
|
}),
|
|
246
249
|
runs: Array.isArray(parsed.runs) ? parsed.runs.filter((run) => {
|
|
247
250
|
return typeof run?.id === "string" && typeof run?.appliedAt === "string" && Array.isArray(run?.migrationIds) && run.migrationIds.every((item) => typeof item === "string");
|
|
@@ -267,6 +270,20 @@ const writeAppliedMigrationsStateToStore = async (adapter, stateFilePath, state)
|
|
|
267
270
|
}
|
|
268
271
|
writeAppliedMigrationsState(stateFilePath, state);
|
|
269
272
|
};
|
|
273
|
+
/**
|
|
274
|
+
* Whether `identity` counts as applied in `state`.
|
|
275
|
+
*
|
|
276
|
+
* Passing a `checksum` makes an edited migration file count as *not* applied so
|
|
277
|
+
* it is re-run. That only suits the Prisma/file-backed flow, where re-applying a
|
|
278
|
+
* migration just rewrites the generated schema. Adapter-backed runtimes must
|
|
279
|
+
* omit the checksum and let the state store alone decide, since replaying an
|
|
280
|
+
* already-applied `up()` would run its SQL a second time.
|
|
281
|
+
*
|
|
282
|
+
* @param state
|
|
283
|
+
* @param identity
|
|
284
|
+
* @param checksum
|
|
285
|
+
* @returns
|
|
286
|
+
*/
|
|
270
287
|
const isMigrationApplied = (state, identity, checksum) => {
|
|
271
288
|
const matched = state.migrations.find((migration) => migration.id === identity);
|
|
272
289
|
if (!matched) return false;
|
|
@@ -622,6 +639,30 @@ const applyOperationsToPersistedColumnMappingsState = (state, operations, featur
|
|
|
622
639
|
tables: nextTables
|
|
623
640
|
};
|
|
624
641
|
};
|
|
642
|
+
/**
|
|
643
|
+
* Replays an applied migration's `up()` from the current file to recover its
|
|
644
|
+
* schema plan.
|
|
645
|
+
*
|
|
646
|
+
* Only used for entries recorded before the plan was stored alongside them; the
|
|
647
|
+
* result reflects the file as it stands now, which is why a recorded plan always
|
|
648
|
+
* wins over this.
|
|
649
|
+
*
|
|
650
|
+
* @param migration
|
|
651
|
+
* @param availableByIdentity
|
|
652
|
+
* @returns
|
|
653
|
+
*/
|
|
654
|
+
const replayAppliedMigrationPlan = async (migration, availableByIdentity) => {
|
|
655
|
+
const migrationClass = availableByIdentity.get(migration.id);
|
|
656
|
+
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
657
|
+
operation: "migration.columnMappings",
|
|
658
|
+
meta: {
|
|
659
|
+
migrationId: migration.id,
|
|
660
|
+
file: migration.file,
|
|
661
|
+
className: migration.className
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
return await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
665
|
+
};
|
|
625
666
|
const rebuildPersistedColumnMappingsState = async (state, availableMigrations, features = resolvePersistedMetadataFeatures()) => {
|
|
626
667
|
const availableByIdentity = new Map(availableMigrations.map(([migrationClass, file]) => [buildMigrationIdentity(file, migrationClass.name), migrationClass]));
|
|
627
668
|
let nextState = createEmptyPersistedColumnMappingsState();
|
|
@@ -634,16 +675,7 @@ const rebuildPersistedColumnMappingsState = async (state, availableMigrations, f
|
|
|
634
675
|
return left.index - right.index;
|
|
635
676
|
});
|
|
636
677
|
for (const { migration } of orderedMigrations) {
|
|
637
|
-
const
|
|
638
|
-
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
639
|
-
operation: "migration.columnMappings",
|
|
640
|
-
meta: {
|
|
641
|
-
migrationId: migration.id,
|
|
642
|
-
file: migration.file,
|
|
643
|
-
className: migration.className
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
const operations = await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
678
|
+
const operations = migration.operations ?? await replayAppliedMigrationPlan(migration, availableByIdentity);
|
|
647
679
|
nextState = applyOperationsToPersistedColumnMappingsState(nextState, operations, features);
|
|
648
680
|
}
|
|
649
681
|
return nextState;
|
|
@@ -5117,13 +5149,18 @@ var MigrateCommand = class extends Command {
|
|
|
5117
5149
|
if (!appliedMigrationState) return true;
|
|
5118
5150
|
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
5119
5151
|
const checksum = computeMigrationChecksum(file);
|
|
5120
|
-
const
|
|
5121
|
-
|
|
5122
|
-
|
|
5152
|
+
const recorded = findAppliedMigration(appliedMigrationState, identity);
|
|
5153
|
+
const alreadyApplied = useDatabaseMigrations ? Boolean(recorded) : isMigrationApplied(appliedMigrationState, identity, checksum);
|
|
5154
|
+
if (alreadyApplied) skipped.push([
|
|
5155
|
+
migrationClass,
|
|
5156
|
+
file,
|
|
5157
|
+
Boolean(recorded?.checksum) && recorded?.checksum !== checksum
|
|
5158
|
+
]);
|
|
5159
|
+
else if (recorded) changed.push([migrationClass, file]);
|
|
5123
5160
|
return !alreadyApplied;
|
|
5124
5161
|
});
|
|
5125
|
-
skipped.forEach(([migrationClass, file]) => {
|
|
5126
|
-
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})`));
|
|
5162
|
+
skipped.forEach(([migrationClass, file, drifted]) => {
|
|
5163
|
+
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})${drifted ? " [changed since applied]" : ""}`));
|
|
5127
5164
|
});
|
|
5128
5165
|
changed.forEach(([migrationClass, file]) => {
|
|
5129
5166
|
this.success(this.app.splitLogger("Changed", `${file} (${migrationClass.name})`));
|
|
@@ -5140,7 +5177,9 @@ var MigrateCommand = class extends Command {
|
|
|
5140
5177
|
return;
|
|
5141
5178
|
}
|
|
5142
5179
|
let columnMappingsState = createEmptyPersistedColumnMappingsState();
|
|
5143
|
-
|
|
5180
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
5181
|
+
for (const [MigrationClassItem, file] of pending) {
|
|
5182
|
+
const identity = buildMigrationIdentity(file, MigrationClassItem.name);
|
|
5144
5183
|
if (useDatabaseMigrations) {
|
|
5145
5184
|
const planned = await this.runWithDatabaseCreationRetry(adapter, () => getMigrationPlan(MigrationClassItem, "up", { inert: true }));
|
|
5146
5185
|
if (!planned.ok) return;
|
|
@@ -5150,13 +5189,16 @@ var MigrateCommand = class extends Command {
|
|
|
5150
5189
|
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
5151
5190
|
return;
|
|
5152
5191
|
}
|
|
5153
|
-
|
|
5192
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
5193
|
+
if (!applied.ok) return;
|
|
5194
|
+
executedPlans.set(identity, applied.value.operations);
|
|
5154
5195
|
continue;
|
|
5155
5196
|
}
|
|
5156
|
-
await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
5197
|
+
const applied = await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
5157
5198
|
schemaPath,
|
|
5158
5199
|
write: true
|
|
5159
5200
|
});
|
|
5201
|
+
executedPlans.set(identity, applied.operations);
|
|
5160
5202
|
}
|
|
5161
5203
|
if (appliedMigrationState) {
|
|
5162
5204
|
const runAppliedIds = [];
|
|
@@ -5167,7 +5209,8 @@ var MigrateCommand = class extends Command {
|
|
|
5167
5209
|
file,
|
|
5168
5210
|
className: migrationClass.name,
|
|
5169
5211
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5170
|
-
checksum: computeMigrationChecksum(file)
|
|
5212
|
+
checksum: computeMigrationChecksum(file),
|
|
5213
|
+
operations: executedPlans.get(identity)
|
|
5171
5214
|
});
|
|
5172
5215
|
runAppliedIds.push(identity);
|
|
5173
5216
|
}
|
|
@@ -5356,23 +5399,32 @@ var MigrateFreshCommand = class extends Command {
|
|
|
5356
5399
|
}
|
|
5357
5400
|
let appliedState = createEmptyAppliedMigrationsState();
|
|
5358
5401
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState))).ok) return;
|
|
5359
|
-
|
|
5402
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
5403
|
+
for (const [MigrationClassItem, file] of migrations) {
|
|
5404
|
+
const identity = buildMigrationIdentity(file, MigrationClassItem.name);
|
|
5360
5405
|
if (useDatabaseMigrations) {
|
|
5361
|
-
|
|
5406
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
5407
|
+
if (!applied.ok) return;
|
|
5408
|
+
executedPlans.set(identity, applied.value.operations);
|
|
5362
5409
|
continue;
|
|
5363
5410
|
}
|
|
5364
|
-
await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
5411
|
+
const applied = await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
5365
5412
|
schemaPath,
|
|
5366
5413
|
write: true
|
|
5367
5414
|
});
|
|
5415
|
+
executedPlans.set(identity, applied.operations);
|
|
5416
|
+
}
|
|
5417
|
+
for (const [migrationClass, file] of migrations) {
|
|
5418
|
+
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
5419
|
+
appliedState = markMigrationApplied(appliedState, {
|
|
5420
|
+
id: identity,
|
|
5421
|
+
file,
|
|
5422
|
+
className: migrationClass.name,
|
|
5423
|
+
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5424
|
+
checksum: computeMigrationChecksum(file),
|
|
5425
|
+
operations: executedPlans.get(identity)
|
|
5426
|
+
});
|
|
5368
5427
|
}
|
|
5369
|
-
for (const [migrationClass, file] of migrations) appliedState = markMigrationApplied(appliedState, {
|
|
5370
|
-
id: buildMigrationIdentity(file, migrationClass.name),
|
|
5371
|
-
file,
|
|
5372
|
-
className: migrationClass.name,
|
|
5373
|
-
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5374
|
-
checksum: computeMigrationChecksum(file)
|
|
5375
|
-
});
|
|
5376
5428
|
appliedState = markMigrationRun(appliedState, {
|
|
5377
5429
|
id: buildMigrationRunId(),
|
|
5378
5430
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5582,7 +5634,7 @@ var MigrationHistoryCommand = class extends Command {
|
|
|
5582
5634
|
{--state-file= : Path to applied migration state file}
|
|
5583
5635
|
{--reset : Clear tracked migration history file}
|
|
5584
5636
|
{--delete : Delete tracked migration history file}
|
|
5585
|
-
{--json : Print
|
|
5637
|
+
{--json : Print JSON output (without each migration's recorded schema plan)}
|
|
5586
5638
|
`;
|
|
5587
5639
|
this.description = "Inspect or reset tracked migration history";
|
|
5588
5640
|
}
|
|
@@ -5618,7 +5670,11 @@ var MigrationHistoryCommand = class extends Command {
|
|
|
5618
5670
|
if (this.option("json")) {
|
|
5619
5671
|
this.success(JSON.stringify({
|
|
5620
5672
|
path: usesDatabaseState ? "database" : stateFilePath,
|
|
5621
|
-
...state
|
|
5673
|
+
...state,
|
|
5674
|
+
migrations: state.migrations.map(({ operations: _operations, ...migration }) => ({
|
|
5675
|
+
...migration,
|
|
5676
|
+
hasRecordedPlan: Array.isArray(_operations)
|
|
5677
|
+
}))
|
|
5622
5678
|
}, null, 2));
|
|
5623
5679
|
return;
|
|
5624
5680
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Kysely, Transaction } from "kysely";
|
|
2
|
-
import { PrismaClient } from "@prisma/client";
|
|
3
1
|
import { Collection } from "@h3ravel/collect.js";
|
|
2
|
+
import { Kysely, Transaction } from "kysely";
|
|
4
3
|
import { Application, Command, Musket } from "@h3ravel/musket";
|
|
4
|
+
import { PrismaClient } from "@prisma/client";
|
|
5
5
|
//#region src/types/migrations.d.ts
|
|
6
6
|
type SchemaColumnType = 'id' | 'uuid' | 'enum' | 'string' | 'text' | 'integer' | 'bigInteger' | 'float' | 'decimal' | 'boolean' | 'json' | 'date' | 'dateTime' | 'timestamp';
|
|
7
7
|
interface PrimaryKeyGeneration {
|
|
@@ -122,6 +122,16 @@ interface AppliedMigrationEntry {
|
|
|
122
122
|
className: string;
|
|
123
123
|
appliedAt: string;
|
|
124
124
|
checksum?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The schema plan this migration actually executed when it was applied.
|
|
127
|
+
*
|
|
128
|
+
* Recorded so derived metadata (persisted column mappings, enums) can be
|
|
129
|
+
* rebuilt from what ran rather than from the migration file's current
|
|
130
|
+
* contents, which may have been edited since. Absent on entries written
|
|
131
|
+
* before this was recorded, and on migrations applied through a backend that
|
|
132
|
+
* does not produce a plan; consumers fall back to replaying the file.
|
|
133
|
+
*/
|
|
134
|
+
operations?: SchemaOperation[];
|
|
125
135
|
}
|
|
126
136
|
interface AppliedMigrationRun {
|
|
127
137
|
id: string;
|
|
@@ -8494,6 +8504,20 @@ declare const readAppliedMigrationsStateFromStore: (adapter: DatabaseAdapter | u
|
|
|
8494
8504
|
declare const writeAppliedMigrationsState: (stateFilePath: string, state: AppliedMigrationsState) => void;
|
|
8495
8505
|
declare const writeAppliedMigrationsStateToStore: (adapter: DatabaseAdapter | undefined, stateFilePath: string, state: AppliedMigrationsState) => Promise<void>;
|
|
8496
8506
|
declare const deleteAppliedMigrationsStateFromStore: (adapter: DatabaseAdapter | undefined, stateFilePath: string) => Promise<"database" | "file" | "missing-file">;
|
|
8507
|
+
/**
|
|
8508
|
+
* Whether `identity` counts as applied in `state`.
|
|
8509
|
+
*
|
|
8510
|
+
* Passing a `checksum` makes an edited migration file count as *not* applied so
|
|
8511
|
+
* it is re-run. That only suits the Prisma/file-backed flow, where re-applying a
|
|
8512
|
+
* migration just rewrites the generated schema. Adapter-backed runtimes must
|
|
8513
|
+
* omit the checksum and let the state store alone decide, since replaying an
|
|
8514
|
+
* already-applied `up()` would run its SQL a second time.
|
|
8515
|
+
*
|
|
8516
|
+
* @param state
|
|
8517
|
+
* @param identity
|
|
8518
|
+
* @param checksum
|
|
8519
|
+
* @returns
|
|
8520
|
+
*/
|
|
8497
8521
|
declare const isMigrationApplied: (state: AppliedMigrationsState, identity: string, checksum?: string) => boolean;
|
|
8498
8522
|
declare const findAppliedMigration: (state: AppliedMigrationsState, identity: string) => AppliedMigrationEntry | undefined;
|
|
8499
8523
|
declare const markMigrationApplied: (state: AppliedMigrationsState, entry: AppliedMigrationEntry) => AppliedMigrationsState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Collection } from "@h3ravel/collect.js";
|
|
2
1
|
import { Kysely, Transaction } from "kysely";
|
|
3
|
-
import { Application, Command, Musket } from "@h3ravel/musket";
|
|
4
2
|
import { PrismaClient } from "@prisma/client";
|
|
3
|
+
import { Collection } from "@h3ravel/collect.js";
|
|
4
|
+
import { Application, Command, Musket } from "@h3ravel/musket";
|
|
5
5
|
//#region src/types/migrations.d.ts
|
|
6
6
|
type SchemaColumnType = 'id' | 'uuid' | 'enum' | 'string' | 'text' | 'integer' | 'bigInteger' | 'float' | 'decimal' | 'boolean' | 'json' | 'date' | 'dateTime' | 'timestamp';
|
|
7
7
|
interface PrimaryKeyGeneration {
|
|
@@ -122,6 +122,16 @@ interface AppliedMigrationEntry {
|
|
|
122
122
|
className: string;
|
|
123
123
|
appliedAt: string;
|
|
124
124
|
checksum?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The schema plan this migration actually executed when it was applied.
|
|
127
|
+
*
|
|
128
|
+
* Recorded so derived metadata (persisted column mappings, enums) can be
|
|
129
|
+
* rebuilt from what ran rather than from the migration file's current
|
|
130
|
+
* contents, which may have been edited since. Absent on entries written
|
|
131
|
+
* before this was recorded, and on migrations applied through a backend that
|
|
132
|
+
* does not produce a plan; consumers fall back to replaying the file.
|
|
133
|
+
*/
|
|
134
|
+
operations?: SchemaOperation[];
|
|
125
135
|
}
|
|
126
136
|
interface AppliedMigrationRun {
|
|
127
137
|
id: string;
|
|
@@ -8494,6 +8504,20 @@ declare const readAppliedMigrationsStateFromStore: (adapter: DatabaseAdapter | u
|
|
|
8494
8504
|
declare const writeAppliedMigrationsState: (stateFilePath: string, state: AppliedMigrationsState) => void;
|
|
8495
8505
|
declare const writeAppliedMigrationsStateToStore: (adapter: DatabaseAdapter | undefined, stateFilePath: string, state: AppliedMigrationsState) => Promise<void>;
|
|
8496
8506
|
declare const deleteAppliedMigrationsStateFromStore: (adapter: DatabaseAdapter | undefined, stateFilePath: string) => Promise<"database" | "file" | "missing-file">;
|
|
8507
|
+
/**
|
|
8508
|
+
* Whether `identity` counts as applied in `state`.
|
|
8509
|
+
*
|
|
8510
|
+
* Passing a `checksum` makes an edited migration file count as *not* applied so
|
|
8511
|
+
* it is re-run. That only suits the Prisma/file-backed flow, where re-applying a
|
|
8512
|
+
* migration just rewrites the generated schema. Adapter-backed runtimes must
|
|
8513
|
+
* omit the checksum and let the state store alone decide, since replaying an
|
|
8514
|
+
* already-applied `up()` would run its SQL a second time.
|
|
8515
|
+
*
|
|
8516
|
+
* @param state
|
|
8517
|
+
* @param identity
|
|
8518
|
+
* @param checksum
|
|
8519
|
+
* @returns
|
|
8520
|
+
*/
|
|
8497
8521
|
declare const isMigrationApplied: (state: AppliedMigrationsState, identity: string, checksum?: string) => boolean;
|
|
8498
8522
|
declare const findAppliedMigration: (state: AppliedMigrationsState, identity: string) => AppliedMigrationEntry | undefined;
|
|
8499
8523
|
declare const markMigrationApplied: (state: AppliedMigrationsState, entry: AppliedMigrationEntry) => AppliedMigrationsState;
|
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-ChCzFqO1.cjs');
|
|
3
3
|
let pg = require("pg");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
@@ -36,6 +36,27 @@ var QueryExecutionException = class extends require_relationship.ArkormException
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/adapters/KyselyDatabaseAdapter.ts
|
|
38
38
|
/**
|
|
39
|
+
* Reads back the schema plan recorded against an applied migration.
|
|
40
|
+
*
|
|
41
|
+
* The driver hands `jsonb` back already parsed, but a `json`/`text` column (or
|
|
42
|
+
* an older pg driver) yields a string, so both are accepted. Anything else
|
|
43
|
+
* including rows written before the column existed resolves to `undefined`,
|
|
44
|
+
* which makes the consumer fall back to replaying the migration file.
|
|
45
|
+
*
|
|
46
|
+
* @param value
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
const parseRecordedMigrationOperations = (value) => {
|
|
50
|
+
if (Array.isArray(value)) return value;
|
|
51
|
+
if (typeof value !== "string") return void 0;
|
|
52
|
+
try {
|
|
53
|
+
const parsed = JSON.parse(value);
|
|
54
|
+
return Array.isArray(parsed) ? parsed : void 0;
|
|
55
|
+
} catch {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
39
60
|
* Database adapter implementation for Kysely, allowing Arkorm to execute queries using Kysely
|
|
40
61
|
* as the underlying query builder and executor.
|
|
41
62
|
*
|
|
@@ -535,8 +556,13 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
535
556
|
file text not null,
|
|
536
557
|
class_name text not null,
|
|
537
558
|
applied_at timestamptz not null,
|
|
538
|
-
checksum text null
|
|
559
|
+
checksum text null,
|
|
560
|
+
operations jsonb null
|
|
539
561
|
)
|
|
562
|
+
`, executor);
|
|
563
|
+
await this.executeRawStatement(`
|
|
564
|
+
alter table ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationStateTable)}
|
|
565
|
+
add column if not exists operations jsonb null
|
|
540
566
|
`, executor);
|
|
541
567
|
await this.executeRawStatement(`
|
|
542
568
|
create table if not exists ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationRunTable)} (
|
|
@@ -551,8 +577,8 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
551
577
|
await this.executeRawStatement(`delete from ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationRunTable)}`, executor);
|
|
552
578
|
await this.executeRawStatement(`delete from ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationStateTable)}`, executor);
|
|
553
579
|
for (const migration of state.migrations) await kysely.sql`
|
|
554
|
-
insert into ${kysely.sql.table(KyselyDatabaseAdapter.migrationStateTable)} (id, file, class_name, applied_at, checksum)
|
|
555
|
-
values (${migration.id}, ${migration.file}, ${migration.className}, ${migration.appliedAt}, ${migration.checksum ?? null})
|
|
580
|
+
insert into ${kysely.sql.table(KyselyDatabaseAdapter.migrationStateTable)} (id, file, class_name, applied_at, checksum, operations)
|
|
581
|
+
values (${migration.id}, ${migration.file}, ${migration.className}, ${migration.appliedAt}, ${migration.checksum ?? null}, cast(${migration.operations ? JSON.stringify(migration.operations) : null} as jsonb))
|
|
556
582
|
`.execute(executor);
|
|
557
583
|
for (const run of state.runs ?? []) await kysely.sql`
|
|
558
584
|
insert into ${kysely.sql.table(KyselyDatabaseAdapter.migrationRunTable)} (id, applied_at, migration_ids)
|
|
@@ -1752,7 +1778,7 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
1752
1778
|
async readAppliedMigrationsState() {
|
|
1753
1779
|
await this.ensureMigrationStateTables();
|
|
1754
1780
|
const migrationsResult = await kysely.sql`
|
|
1755
|
-
select id, file, class_name, applied_at, checksum
|
|
1781
|
+
select id, file, class_name, applied_at, checksum, operations
|
|
1756
1782
|
from ${kysely.sql.table(KyselyDatabaseAdapter.migrationStateTable)}
|
|
1757
1783
|
order by applied_at asc, id asc
|
|
1758
1784
|
`.execute(this.db);
|
|
@@ -1768,7 +1794,8 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
1768
1794
|
file: row.file,
|
|
1769
1795
|
className: row.class_name,
|
|
1770
1796
|
appliedAt: row.applied_at instanceof Date ? row.applied_at.toISOString() : String(row.applied_at),
|
|
1771
|
-
checksum: row.checksum ?? void 0
|
|
1797
|
+
checksum: row.checksum ?? void 0,
|
|
1798
|
+
operations: parseRecordedMigrationOperations(row.operations)
|
|
1772
1799
|
})),
|
|
1773
1800
|
runs: runsResult.rows.map((row) => ({
|
|
1774
1801
|
id: row.id,
|
|
@@ -4017,13 +4044,18 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
4017
4044
|
if (!appliedMigrationState) return true;
|
|
4018
4045
|
const identity = require_relationship.buildMigrationIdentity(file, migrationClass.name);
|
|
4019
4046
|
const checksum = require_relationship.computeMigrationChecksum(file);
|
|
4020
|
-
const
|
|
4021
|
-
|
|
4022
|
-
|
|
4047
|
+
const recorded = require_relationship.findAppliedMigration(appliedMigrationState, identity);
|
|
4048
|
+
const alreadyApplied = useDatabaseMigrations ? Boolean(recorded) : require_relationship.isMigrationApplied(appliedMigrationState, identity, checksum);
|
|
4049
|
+
if (alreadyApplied) skipped.push([
|
|
4050
|
+
migrationClass,
|
|
4051
|
+
file,
|
|
4052
|
+
Boolean(recorded?.checksum) && recorded?.checksum !== checksum
|
|
4053
|
+
]);
|
|
4054
|
+
else if (recorded) changed.push([migrationClass, file]);
|
|
4023
4055
|
return !alreadyApplied;
|
|
4024
4056
|
});
|
|
4025
|
-
skipped.forEach(([migrationClass, file]) => {
|
|
4026
|
-
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})`));
|
|
4057
|
+
skipped.forEach(([migrationClass, file, drifted]) => {
|
|
4058
|
+
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})${drifted ? " [changed since applied]" : ""}`));
|
|
4027
4059
|
});
|
|
4028
4060
|
changed.forEach(([migrationClass, file]) => {
|
|
4029
4061
|
this.success(this.app.splitLogger("Changed", `${file} (${migrationClass.name})`));
|
|
@@ -4040,7 +4072,9 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
4040
4072
|
return;
|
|
4041
4073
|
}
|
|
4042
4074
|
let columnMappingsState = require_relationship.createEmptyPersistedColumnMappingsState();
|
|
4043
|
-
|
|
4075
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
4076
|
+
for (const [MigrationClassItem, file] of pending) {
|
|
4077
|
+
const identity = require_relationship.buildMigrationIdentity(file, MigrationClassItem.name);
|
|
4044
4078
|
if (useDatabaseMigrations) {
|
|
4045
4079
|
const planned = await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.getMigrationPlan(MigrationClassItem, "up", { inert: true }));
|
|
4046
4080
|
if (!planned.ok) return;
|
|
@@ -4050,13 +4084,16 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
4050
4084
|
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4051
4085
|
return;
|
|
4052
4086
|
}
|
|
4053
|
-
|
|
4087
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
4088
|
+
if (!applied.ok) return;
|
|
4089
|
+
executedPlans.set(identity, applied.value.operations);
|
|
4054
4090
|
continue;
|
|
4055
4091
|
}
|
|
4056
|
-
await require_relationship.applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4092
|
+
const applied = await require_relationship.applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4057
4093
|
schemaPath,
|
|
4058
4094
|
write: true
|
|
4059
4095
|
});
|
|
4096
|
+
executedPlans.set(identity, applied.operations);
|
|
4060
4097
|
}
|
|
4061
4098
|
if (appliedMigrationState) {
|
|
4062
4099
|
const runAppliedIds = [];
|
|
@@ -4067,7 +4104,8 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
4067
4104
|
file,
|
|
4068
4105
|
className: migrationClass.name,
|
|
4069
4106
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4070
|
-
checksum: require_relationship.computeMigrationChecksum(file)
|
|
4107
|
+
checksum: require_relationship.computeMigrationChecksum(file),
|
|
4108
|
+
operations: executedPlans.get(identity)
|
|
4071
4109
|
});
|
|
4072
4110
|
runAppliedIds.push(identity);
|
|
4073
4111
|
}
|
|
@@ -4256,23 +4294,32 @@ var MigrateFreshCommand = class extends _h3ravel_musket.Command {
|
|
|
4256
4294
|
}
|
|
4257
4295
|
let appliedState = require_relationship.createEmptyAppliedMigrationsState();
|
|
4258
4296
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState))).ok) return;
|
|
4259
|
-
|
|
4297
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
4298
|
+
for (const [MigrationClassItem, file] of migrations) {
|
|
4299
|
+
const identity = require_relationship.buildMigrationIdentity(file, MigrationClassItem.name);
|
|
4260
4300
|
if (useDatabaseMigrations) {
|
|
4261
|
-
|
|
4301
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
4302
|
+
if (!applied.ok) return;
|
|
4303
|
+
executedPlans.set(identity, applied.value.operations);
|
|
4262
4304
|
continue;
|
|
4263
4305
|
}
|
|
4264
|
-
await require_relationship.applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4306
|
+
const applied = await require_relationship.applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4265
4307
|
schemaPath,
|
|
4266
4308
|
write: true
|
|
4267
4309
|
});
|
|
4310
|
+
executedPlans.set(identity, applied.operations);
|
|
4311
|
+
}
|
|
4312
|
+
for (const [migrationClass, file] of migrations) {
|
|
4313
|
+
const identity = require_relationship.buildMigrationIdentity(file, migrationClass.name);
|
|
4314
|
+
appliedState = require_relationship.markMigrationApplied(appliedState, {
|
|
4315
|
+
id: identity,
|
|
4316
|
+
file,
|
|
4317
|
+
className: migrationClass.name,
|
|
4318
|
+
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4319
|
+
checksum: require_relationship.computeMigrationChecksum(file),
|
|
4320
|
+
operations: executedPlans.get(identity)
|
|
4321
|
+
});
|
|
4268
4322
|
}
|
|
4269
|
-
for (const [migrationClass, file] of migrations) appliedState = require_relationship.markMigrationApplied(appliedState, {
|
|
4270
|
-
id: require_relationship.buildMigrationIdentity(file, migrationClass.name),
|
|
4271
|
-
file,
|
|
4272
|
-
className: migrationClass.name,
|
|
4273
|
-
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4274
|
-
checksum: require_relationship.computeMigrationChecksum(file)
|
|
4275
|
-
});
|
|
4276
4323
|
appliedState = require_relationship.markMigrationRun(appliedState, {
|
|
4277
4324
|
id: require_relationship.buildMigrationRunId(),
|
|
4278
4325
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4482,7 +4529,7 @@ var MigrationHistoryCommand = class extends _h3ravel_musket.Command {
|
|
|
4482
4529
|
{--state-file= : Path to applied migration state file}
|
|
4483
4530
|
{--reset : Clear tracked migration history file}
|
|
4484
4531
|
{--delete : Delete tracked migration history file}
|
|
4485
|
-
{--json : Print
|
|
4532
|
+
{--json : Print JSON output (without each migration's recorded schema plan)}
|
|
4486
4533
|
`;
|
|
4487
4534
|
this.description = "Inspect or reset tracked migration history";
|
|
4488
4535
|
}
|
|
@@ -4518,7 +4565,11 @@ var MigrationHistoryCommand = class extends _h3ravel_musket.Command {
|
|
|
4518
4565
|
if (this.option("json")) {
|
|
4519
4566
|
this.success(JSON.stringify({
|
|
4520
4567
|
path: usesDatabaseState ? "database" : stateFilePath,
|
|
4521
|
-
...state
|
|
4568
|
+
...state,
|
|
4569
|
+
migrations: state.migrations.map(({ operations: _operations, ...migration }) => ({
|
|
4570
|
+
...migration,
|
|
4571
|
+
hasRecordedPlan: Array.isArray(_operations)
|
|
4572
|
+
}))
|
|
4522
4573
|
}, null, 2));
|
|
4523
4574
|
return;
|
|
4524
4575
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildPrimaryKeyLine, $a as ModelStatic, $c as SchemaTableDropOperation, $i as DelegateFindManyArgs, $n as getModel, $o as fromExpressionNode, $r as InsertSpec, $s as FactoryRelationshipResolver, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCapableClient, Ac as MorphedByManyRelationMetadata, Ai as RawQuerySpec, An as EnumBuilder, Ao as ModelRelationshipKey, Ar as createPrismaDatabaseAdapter, As as RelationDefaultResolver, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaUniqueWhere, Bc as MigrationInstanceLike, Bi as UpsertSpec, Bn as MigrateCommand, Bo as Model, Br as AdapterQueryOperation, Bs as RelatedModelForRelationship, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaLikeInclude, Cc as HasOneRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelEventDispatcher, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSortOrder, Dc as MorphOneRelationMetadata, Di as QuerySelectColumn, Dn as MIGRATION_BRAND, Do as ModelEventName, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateType, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeSelect, Ec as MorphManyRelationMetadata, Ei as QueryScalarComparisonOperator, En as DB, Eo as ModelEventListener, Er as SeederInput, Es as RelationAggregateInput, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaInclude, Fc as AppliedMigrationRun, Fi as SelectSpec, Fn as SeedCommand, Fo as QuerySchemaForModelInstance, Fr as AdapterDatabaseCreationResult, Fs as RelationTableLookupSpec, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RuntimeClientLike, Gc as SchemaColumnType, Gi as ArkormDebugEvent, Gn as InitCommand, Go as JsonExpression, Gr as DatabaseAdapter, Gs as Paginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateData, Hc as PrismaMigrationWorkflowOptions, Hi as AdapterQueryInspection, Hn as MakeModelCommand, Ho as CaseExpression, Hr as AggregateOperation, Hs as WhereCallback, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaOrderBy, Ic as AppliedMigrationsState, Ii as SoftDeleteQueryMode, In as ModelsSyncCommand, Io as RegisteredModelClass, Ir as AdapterInspectionRequest, Is as EagerLoadQueryForRelationship, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SoftDeleteConfig, Jc as SchemaIndex, Ji as CastHandler, Jn as resolveCast, Jo as coalesce, Jr as DatabaseRows, Js as FactoryAttributes, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as Serializable, Kc as SchemaForeignKey, Ki as ArkormDebugHandler, Kn as DbCommand, Ko as avg, Kr as DatabasePrimitive, Ks as ArkormCollection, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaRow, Lc as GenerateMigrationOptions, Li as SortDirection, Ln as MigrationHistoryCommand, Lo as RegisteredModelInstance, Lr as AdapterModelFieldStructure, Ls as EagerLoadRelations, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionOptions, Mc as RelationMetadata, Mi as RelationFilterSpec, Mn as GeneratedColumnExpression, Mo as ModelUpdateData, Mr as createKyselyAdapter, Ms as RelationMetadataProvider, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as QuerySchemaCreateData, Nc as RelationMetadataType, Ni as RelationLoadPlan, Nn as resolveGeneratedExpression, No as ModelWhereInput, Nr as AdapterCapabilities, Ns as RelationResult, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeWhereInput, Oc as MorphToManyRelationMetadata, Oi as QueryTarget, On as Migration, Oo as ModelLifecycleState, Or as PrismaDelegateNameMapping, Os as RelationColumnLookupSpec, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaFindManyArgs, Pc as AppliedMigrationEntry, Pi as RelationLoadSpec, Pn as ForeignKeyBuilder, Po as QuerySchemaForModel, Pr as AdapterCapability, Ps as RelationResultCache, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionOptions, Qc as SchemaTableCreateOperation, Qi as DelegateCreateData, Qn as Arkormx, Qo as fn, Qr as InsertManySpec, Qs as FactoryModelConstructor, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRows, Rc as GeneratedMigrationFile, Ri as UpdateManySpec, Rn as MigrateRollbackCommand, Ro as RegisteredModelName, Rr as AdapterModelIntrospectionOptions, Rs as JoinOn, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaFindManyArgsLike, Sc as HasManyThroughRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelDeclaredAttributeKey, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeScalarFilter, Tc as ModelMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandlerConstructor, Tr as SeederConstructor, Ts as RelationAggregateConstraint, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaWhere, Uc as PrismaSchemaSyncOptions, Ui as ArkormBootContext, Un as MakeMigrationCommand, Uo as Expression, Ur as AggregateSelection, Us as JoinClause, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUpdateArgs, Vc as PrimaryKeyGeneration, Vi as AdapterBindableModel, Vn as MakeSeederCommand, Vo as AggregateExpression, Vr as AdapterTransactionContext, Vs as RelatedModelFromResult, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as RawSelectInput, Wc as SchemaColumn, Wi as ArkormConfig, Wn as MakeFactoryCommand, Wo as ExpressionBuilder, Wr as AggregateSpec, Ws as LengthAwarePaginator, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCapableClient, Xc as SchemaPrimaryKey, Xi as CastType, Xn as AttributeOptions, Xo as count, Xr as DeleteManySpec, Xs as FactoryDefinition, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as TransactionCallback, Yc as SchemaOperation, Yi as CastMap, Yn as Attribute, Yo as col, Yr as DatabaseValue, Ys as FactoryCallback, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionContext, Zc as SchemaTableAlterOperation, Zi as ClientResolver, Zn as Arkorm, Zo as expressionBuilder, Zr as DeleteSpec, Zs as FactoryDefinitionAttributes, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationOptions, _c as DatabaseTablePersistedMetadataOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as GlobalScope, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateUniqueWhere, ac as CaseExpressionNode, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateSpec, ar as RuntimePathMap, as as val, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PrismaClientLike, bc as ColumnMap, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributesOf, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateWhere, cc as ExpressionJsonCast, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelRegistry, cr as getRegisteredModels, cs as ModelFactory, ct as escapeRegex, d as inferDelegateName, da as GetUserConfig, dc as InExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeQuerySchema, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateInclude, ec as FactoryState, ei as PartitionedSelectSpec, el as SchemaUniqueConstraint, en as deletePersistedColumnMappingsState, eo as RelationshipModelStatic, er as RegisteredFactory, es as json, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as ModelQuerySchemaLike, fc as JsonExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeSchemaDelegate, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationMeta, gc as DatabaseTableOptions, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as DelegateForModelSchema, gr as registerMigrations, gt as pad, h as defineConfig, ha as PaginationCurrentPageResolver, hc as ValueExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeWhereInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateSelect, ic as CaseExpressionBranch, ii as QueryCondition, in as getPersistedPrimaryKeyGeneration, io as GroupByAggregateRow, ir as RuntimePathKey, is as sum, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionContext, jc as PivotModelStatic, ji as RelationAggregateSpec, jn as TableBuilder, jo as ModelRelationshipResult, jr as KyselyDatabaseAdapter, js as RelationDefaultValue, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaTransactionCallback, kc as MorphToRelationMetadata, ki as QueryTimeCondition, kn as SchemaBuilder, ko as ModelOrderByInput, kr as createPrismaCompatibilityAdapter, ks as RelationConstraint, kt as buildMigrationRunId, l as createPrismaAdapter, la as EagerLoadConstraint, lc as ExpressionNode, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as AttributeCreateInput, lr as getRegisteredPaths, ls as defineFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as NamingCase, mc as RawExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeUpdateInput, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateRow, nc as AggregateExpressionNode, ni as QueryComparisonCondition, nl as TimestampNames, nn as getPersistedEnumMap, no as EachCallback, nr as RuntimeConstructor, ns as min, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUpdateArgs, oc as ColumnExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as QueryBuilder, or as getRegisteredFactories, os as where, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelTableCase, pc as NullCheckExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSelect, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as SimplePaginationMeta, qc as SchemaForeignKeyAction, qi as CastDefinition, qn as CliApp, qo as caseWhen, qr as DatabaseRow, qs as FactoryAttributeResolver, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRows, rc as BinaryExpressionNode, ri as QueryComparisonOperator, rl as TimestampNaming, rn as getPersistedEnumTsType, ro as ExpressionSelectMap, rr as RuntimePathInput, rs as raw, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateData, sc as ExpressionBinaryOperator, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as ArkormModelNameRegistry, sr as getRegisteredMigrations, ss as InlineFactory, st as deriveSingularFieldName, t as URLDriver, ta as DelegateOrderBy, tc as MaybePromise, ti as QueryColumnComparisonCondition, tl as TimestampColumnBehavior, tn as getPersistedColumnMap, to as ChunkCallback, tr as RegisteredModel, ts as max, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadMap, uc as FunctionExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeOrderBy, ur as getRegisteredSeeders, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationURLDriver, vc as BelongsToManyRelationMetadata, vi as QueryJoinType, vn as RelationResolutionException, vo as ModelAttributeValue, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeOrderBy, wc as HasOneThroughRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventHandler, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaDelegateLike, xc as HasManyRelationMetadata, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelCreateData, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriverFactory, yc as BelongsToRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributes, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaSelect, zc as MigrationClass, zi as UpdateSpec, zn as MigrateFreshCommand, zo as RelatedModelClass, zr as AdapterModelStructure, zs as JoinSource, zt as markMigrationRun } from "./index-Lxl6NdHS.cjs";
|
|
1
|
+
import { $ as buildPrimaryKeyLine, $a as ModelStatic, $c as SchemaTableDropOperation, $i as DelegateFindManyArgs, $n as getModel, $o as fromExpressionNode, $r as InsertSpec, $s as FactoryRelationshipResolver, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCapableClient, Ac as MorphedByManyRelationMetadata, Ai as RawQuerySpec, An as EnumBuilder, Ao as ModelRelationshipKey, Ar as createPrismaDatabaseAdapter, As as RelationDefaultResolver, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaUniqueWhere, Bc as MigrationInstanceLike, Bi as UpsertSpec, Bn as MigrateCommand, Bo as Model, Br as AdapterQueryOperation, Bs as RelatedModelForRelationship, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaLikeInclude, Cc as HasOneRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelEventDispatcher, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSortOrder, Dc as MorphOneRelationMetadata, Di as QuerySelectColumn, Dn as MIGRATION_BRAND, Do as ModelEventName, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateType, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeSelect, Ec as MorphManyRelationMetadata, Ei as QueryScalarComparisonOperator, En as DB, Eo as ModelEventListener, Er as SeederInput, Es as RelationAggregateInput, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaInclude, Fc as AppliedMigrationRun, Fi as SelectSpec, Fn as SeedCommand, Fo as QuerySchemaForModelInstance, Fr as AdapterDatabaseCreationResult, Fs as RelationTableLookupSpec, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RuntimeClientLike, Gc as SchemaColumnType, Gi as ArkormDebugEvent, Gn as InitCommand, Go as JsonExpression, Gr as DatabaseAdapter, Gs as Paginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateData, Hc as PrismaMigrationWorkflowOptions, Hi as AdapterQueryInspection, Hn as MakeModelCommand, Ho as CaseExpression, Hr as AggregateOperation, Hs as WhereCallback, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaOrderBy, Ic as AppliedMigrationsState, Ii as SoftDeleteQueryMode, In as ModelsSyncCommand, Io as RegisteredModelClass, Ir as AdapterInspectionRequest, Is as EagerLoadQueryForRelationship, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SoftDeleteConfig, Jc as SchemaIndex, Ji as CastHandler, Jn as resolveCast, Jo as coalesce, Jr as DatabaseRows, Js as FactoryAttributes, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as Serializable, Kc as SchemaForeignKey, Ki as ArkormDebugHandler, Kn as DbCommand, Ko as avg, Kr as DatabasePrimitive, Ks as ArkormCollection, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaRow, Lc as GenerateMigrationOptions, Li as SortDirection, Ln as MigrationHistoryCommand, Lo as RegisteredModelInstance, Lr as AdapterModelFieldStructure, Ls as EagerLoadRelations, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionOptions, Mc as RelationMetadata, Mi as RelationFilterSpec, Mn as GeneratedColumnExpression, Mo as ModelUpdateData, Mr as createKyselyAdapter, Ms as RelationMetadataProvider, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as QuerySchemaCreateData, Nc as RelationMetadataType, Ni as RelationLoadPlan, Nn as resolveGeneratedExpression, No as ModelWhereInput, Nr as AdapterCapabilities, Ns as RelationResult, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeWhereInput, Oc as MorphToManyRelationMetadata, Oi as QueryTarget, On as Migration, Oo as ModelLifecycleState, Or as PrismaDelegateNameMapping, Os as RelationColumnLookupSpec, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaFindManyArgs, Pc as AppliedMigrationEntry, Pi as RelationLoadSpec, Pn as ForeignKeyBuilder, Po as QuerySchemaForModel, Pr as AdapterCapability, Ps as RelationResultCache, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionOptions, Qc as SchemaTableCreateOperation, Qi as DelegateCreateData, Qn as Arkormx, Qo as fn, Qr as InsertManySpec, Qs as FactoryModelConstructor, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRows, Rc as GeneratedMigrationFile, Ri as UpdateManySpec, Rn as MigrateRollbackCommand, Ro as RegisteredModelName, Rr as AdapterModelIntrospectionOptions, Rs as JoinOn, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaFindManyArgsLike, Sc as HasManyThroughRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelDeclaredAttributeKey, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeScalarFilter, Tc as ModelMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandlerConstructor, Tr as SeederConstructor, Ts as RelationAggregateConstraint, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaWhere, Uc as PrismaSchemaSyncOptions, Ui as ArkormBootContext, Un as MakeMigrationCommand, Uo as Expression, Ur as AggregateSelection, Us as JoinClause, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUpdateArgs, Vc as PrimaryKeyGeneration, Vi as AdapterBindableModel, Vn as MakeSeederCommand, Vo as AggregateExpression, Vr as AdapterTransactionContext, Vs as RelatedModelFromResult, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as RawSelectInput, Wc as SchemaColumn, Wi as ArkormConfig, Wn as MakeFactoryCommand, Wo as ExpressionBuilder, Wr as AggregateSpec, Ws as LengthAwarePaginator, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCapableClient, Xc as SchemaPrimaryKey, Xi as CastType, Xn as AttributeOptions, Xo as count, Xr as DeleteManySpec, Xs as FactoryDefinition, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as TransactionCallback, Yc as SchemaOperation, Yi as CastMap, Yn as Attribute, Yo as col, Yr as DatabaseValue, Ys as FactoryCallback, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionContext, Zc as SchemaTableAlterOperation, Zi as ClientResolver, Zn as Arkorm, Zo as expressionBuilder, Zr as DeleteSpec, Zs as FactoryDefinitionAttributes, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationOptions, _c as DatabaseTablePersistedMetadataOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as GlobalScope, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateUniqueWhere, ac as CaseExpressionNode, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateSpec, ar as RuntimePathMap, as as val, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PrismaClientLike, bc as ColumnMap, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributesOf, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateWhere, cc as ExpressionJsonCast, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelRegistry, cr as getRegisteredModels, cs as ModelFactory, ct as escapeRegex, d as inferDelegateName, da as GetUserConfig, dc as InExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeQuerySchema, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateInclude, ec as FactoryState, ei as PartitionedSelectSpec, el as SchemaUniqueConstraint, en as deletePersistedColumnMappingsState, eo as RelationshipModelStatic, er as RegisteredFactory, es as json, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as ModelQuerySchemaLike, fc as JsonExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeSchemaDelegate, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationMeta, gc as DatabaseTableOptions, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as DelegateForModelSchema, gr as registerMigrations, gt as pad, h as defineConfig, ha as PaginationCurrentPageResolver, hc as ValueExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeWhereInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateSelect, ic as CaseExpressionBranch, ii as QueryCondition, in as getPersistedPrimaryKeyGeneration, io as GroupByAggregateRow, ir as RuntimePathKey, is as sum, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionContext, jc as PivotModelStatic, ji as RelationAggregateSpec, jn as TableBuilder, jo as ModelRelationshipResult, jr as KyselyDatabaseAdapter, js as RelationDefaultValue, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaTransactionCallback, kc as MorphToRelationMetadata, ki as QueryTimeCondition, kn as SchemaBuilder, ko as ModelOrderByInput, kr as createPrismaCompatibilityAdapter, ks as RelationConstraint, kt as buildMigrationRunId, l as createPrismaAdapter, la as EagerLoadConstraint, lc as ExpressionNode, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as AttributeCreateInput, lr as getRegisteredPaths, ls as defineFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as NamingCase, mc as RawExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeUpdateInput, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateRow, nc as AggregateExpressionNode, ni as QueryComparisonCondition, nl as TimestampNames, nn as getPersistedEnumMap, no as EachCallback, nr as RuntimeConstructor, ns as min, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUpdateArgs, oc as ColumnExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as QueryBuilder, or as getRegisteredFactories, os as where, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelTableCase, pc as NullCheckExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSelect, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as SimplePaginationMeta, qc as SchemaForeignKeyAction, qi as CastDefinition, qn as CliApp, qo as caseWhen, qr as DatabaseRow, qs as FactoryAttributeResolver, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRows, rc as BinaryExpressionNode, ri as QueryComparisonOperator, rl as TimestampNaming, rn as getPersistedEnumTsType, ro as ExpressionSelectMap, rr as RuntimePathInput, rs as raw, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateData, sc as ExpressionBinaryOperator, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as ArkormModelNameRegistry, sr as getRegisteredMigrations, ss as InlineFactory, st as deriveSingularFieldName, t as URLDriver, ta as DelegateOrderBy, tc as MaybePromise, ti as QueryColumnComparisonCondition, tl as TimestampColumnBehavior, tn as getPersistedColumnMap, to as ChunkCallback, tr as RegisteredModel, ts as max, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadMap, uc as FunctionExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeOrderBy, ur as getRegisteredSeeders, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationURLDriver, vc as BelongsToManyRelationMetadata, vi as QueryJoinType, vn as RelationResolutionException, vo as ModelAttributeValue, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeOrderBy, wc as HasOneThroughRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventHandler, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaDelegateLike, xc as HasManyRelationMetadata, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelCreateData, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriverFactory, yc as BelongsToRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributes, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaSelect, zc as MigrationClass, zi as UpdateSpec, zn as MigrateFreshCommand, zo as RelatedModelClass, zr as AdapterModelStructure, zs as JoinSource, zt as markMigrationRun } from "./index-CDSTYl6q.cjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateExpression, AggregateExpressionNode, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, ArkormModelNameRegistry, ArkormModelRegistry, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, BinaryExpressionNode, CaseExpression, CaseExpressionBranch, CaseExpressionNode, CastDefinition, CastHandler, CastMap, CastType, ChunkCallback, CliApp, ClientResolver, ColumnExpressionNode, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DbCommand, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EachCallback, EagerLoadConstraint, EagerLoadMap, EagerLoadQueryForRelationship, EagerLoadRelations, EnumBuilder, Expression, ExpressionBinaryOperator, ExpressionBuilder, ExpressionJsonCast, ExpressionNode, ExpressionSelectMap, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, FunctionExpressionNode, GenerateMigrationOptions, GeneratedColumnExpression, GeneratedMigrationFile, GetUserConfig, GlobalScope, GroupByAggregateRow, GroupByAggregateSpec, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InExpressionNode, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, JsonExpression, JsonExpressionNode, 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, MorphedByManyRelationMetadata, NamingCase, NullCheckExpressionNode, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PartitionedSelectSpec, 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, QueryExpressionCondition, QueryFullTextCondition, QueryGroupByItem, 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, RawExpressionNode, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RegisteredModelClass, RegisteredModelInstance, RegisteredModelName, 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, ValueExpressionNode, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, avg, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, caseWhen, coalesce, col, computeMigrationChecksum, configureArkormRuntime, count, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, disposeArkormRuntime, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, expressionBuilder, findAppliedMigration, findEnumBlock, findModelBlock, fn, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, fromExpressionNode, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastBatchMigrations, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getModel, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, json, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, max, min, pad, raw, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveGeneratedExpression, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRegisteredModel, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, sum, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, val, validatePersistedMetadataFeaturesForMigrations, where, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildPrimaryKeyLine, $a as ModelStatic, $c as SchemaTableDropOperation, $i as DelegateFindManyArgs, $n as getModel, $o as fromExpressionNode, $r as InsertSpec, $s as FactoryRelationshipResolver, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCapableClient, Ac as MorphedByManyRelationMetadata, Ai as RawQuerySpec, An as EnumBuilder, Ao as ModelRelationshipKey, Ar as createPrismaDatabaseAdapter, As as RelationDefaultResolver, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaUniqueWhere, Bc as MigrationInstanceLike, Bi as UpsertSpec, Bn as MigrateCommand, Bo as Model, Br as AdapterQueryOperation, Bs as RelatedModelForRelationship, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaLikeInclude, Cc as HasOneRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelEventDispatcher, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSortOrder, Dc as MorphOneRelationMetadata, Di as QuerySelectColumn, Dn as MIGRATION_BRAND, Do as ModelEventName, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateType, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeSelect, Ec as MorphManyRelationMetadata, Ei as QueryScalarComparisonOperator, En as DB, Eo as ModelEventListener, Er as SeederInput, Es as RelationAggregateInput, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaInclude, Fc as AppliedMigrationRun, Fi as SelectSpec, Fn as SeedCommand, Fo as QuerySchemaForModelInstance, Fr as AdapterDatabaseCreationResult, Fs as RelationTableLookupSpec, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RuntimeClientLike, Gc as SchemaColumnType, Gi as ArkormDebugEvent, Gn as InitCommand, Go as JsonExpression, Gr as DatabaseAdapter, Gs as Paginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateData, Hc as PrismaMigrationWorkflowOptions, Hi as AdapterQueryInspection, Hn as MakeModelCommand, Ho as CaseExpression, Hr as AggregateOperation, Hs as WhereCallback, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaOrderBy, Ic as AppliedMigrationsState, Ii as SoftDeleteQueryMode, In as ModelsSyncCommand, Io as RegisteredModelClass, Ir as AdapterInspectionRequest, Is as EagerLoadQueryForRelationship, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SoftDeleteConfig, Jc as SchemaIndex, Ji as CastHandler, Jn as resolveCast, Jo as coalesce, Jr as DatabaseRows, Js as FactoryAttributes, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as Serializable, Kc as SchemaForeignKey, Ki as ArkormDebugHandler, Kn as DbCommand, Ko as avg, Kr as DatabasePrimitive, Ks as ArkormCollection, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaRow, Lc as GenerateMigrationOptions, Li as SortDirection, Ln as MigrationHistoryCommand, Lo as RegisteredModelInstance, Lr as AdapterModelFieldStructure, Ls as EagerLoadRelations, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionOptions, Mc as RelationMetadata, Mi as RelationFilterSpec, Mn as GeneratedColumnExpression, Mo as ModelUpdateData, Mr as createKyselyAdapter, Ms as RelationMetadataProvider, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as QuerySchemaCreateData, Nc as RelationMetadataType, Ni as RelationLoadPlan, Nn as resolveGeneratedExpression, No as ModelWhereInput, Nr as AdapterCapabilities, Ns as RelationResult, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeWhereInput, Oc as MorphToManyRelationMetadata, Oi as QueryTarget, On as Migration, Oo as ModelLifecycleState, Or as PrismaDelegateNameMapping, Os as RelationColumnLookupSpec, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaFindManyArgs, Pc as AppliedMigrationEntry, Pi as RelationLoadSpec, Pn as ForeignKeyBuilder, Po as QuerySchemaForModel, Pr as AdapterCapability, Ps as RelationResultCache, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionOptions, Qc as SchemaTableCreateOperation, Qi as DelegateCreateData, Qn as Arkormx, Qo as fn, Qr as InsertManySpec, Qs as FactoryModelConstructor, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRows, Rc as GeneratedMigrationFile, Ri as UpdateManySpec, Rn as MigrateRollbackCommand, Ro as RegisteredModelName, Rr as AdapterModelIntrospectionOptions, Rs as JoinOn, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaFindManyArgsLike, Sc as HasManyThroughRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelDeclaredAttributeKey, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeScalarFilter, Tc as ModelMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandlerConstructor, Tr as SeederConstructor, Ts as RelationAggregateConstraint, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaWhere, Uc as PrismaSchemaSyncOptions, Ui as ArkormBootContext, Un as MakeMigrationCommand, Uo as Expression, Ur as AggregateSelection, Us as JoinClause, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUpdateArgs, Vc as PrimaryKeyGeneration, Vi as AdapterBindableModel, Vn as MakeSeederCommand, Vo as AggregateExpression, Vr as AdapterTransactionContext, Vs as RelatedModelFromResult, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as RawSelectInput, Wc as SchemaColumn, Wi as ArkormConfig, Wn as MakeFactoryCommand, Wo as ExpressionBuilder, Wr as AggregateSpec, Ws as LengthAwarePaginator, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCapableClient, Xc as SchemaPrimaryKey, Xi as CastType, Xn as AttributeOptions, Xo as count, Xr as DeleteManySpec, Xs as FactoryDefinition, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as TransactionCallback, Yc as SchemaOperation, Yi as CastMap, Yn as Attribute, Yo as col, Yr as DatabaseValue, Ys as FactoryCallback, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionContext, Zc as SchemaTableAlterOperation, Zi as ClientResolver, Zn as Arkorm, Zo as expressionBuilder, Zr as DeleteSpec, Zs as FactoryDefinitionAttributes, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationOptions, _c as DatabaseTablePersistedMetadataOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as GlobalScope, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateUniqueWhere, ac as CaseExpressionNode, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateSpec, ar as RuntimePathMap, as as val, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PrismaClientLike, bc as ColumnMap, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributesOf, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateWhere, cc as ExpressionJsonCast, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelRegistry, cr as getRegisteredModels, cs as ModelFactory, ct as escapeRegex, d as inferDelegateName, da as GetUserConfig, dc as InExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeQuerySchema, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateInclude, ec as FactoryState, ei as PartitionedSelectSpec, el as SchemaUniqueConstraint, en as deletePersistedColumnMappingsState, eo as RelationshipModelStatic, er as RegisteredFactory, es as json, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as ModelQuerySchemaLike, fc as JsonExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeSchemaDelegate, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationMeta, gc as DatabaseTableOptions, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as DelegateForModelSchema, gr as registerMigrations, gt as pad, h as defineConfig, ha as PaginationCurrentPageResolver, hc as ValueExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeWhereInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateSelect, ic as CaseExpressionBranch, ii as QueryCondition, in as getPersistedPrimaryKeyGeneration, io as GroupByAggregateRow, ir as RuntimePathKey, is as sum, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionContext, jc as PivotModelStatic, ji as RelationAggregateSpec, jn as TableBuilder, jo as ModelRelationshipResult, jr as KyselyDatabaseAdapter, js as RelationDefaultValue, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaTransactionCallback, kc as MorphToRelationMetadata, ki as QueryTimeCondition, kn as SchemaBuilder, ko as ModelOrderByInput, kr as createPrismaCompatibilityAdapter, ks as RelationConstraint, kt as buildMigrationRunId, l as createPrismaAdapter, la as EagerLoadConstraint, lc as ExpressionNode, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as AttributeCreateInput, lr as getRegisteredPaths, ls as defineFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as NamingCase, mc as RawExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeUpdateInput, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateRow, nc as AggregateExpressionNode, ni as QueryComparisonCondition, nl as TimestampNames, nn as getPersistedEnumMap, no as EachCallback, nr as RuntimeConstructor, ns as min, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUpdateArgs, oc as ColumnExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as QueryBuilder, or as getRegisteredFactories, os as where, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelTableCase, pc as NullCheckExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSelect, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as SimplePaginationMeta, qc as SchemaForeignKeyAction, qi as CastDefinition, qn as CliApp, qo as caseWhen, qr as DatabaseRow, qs as FactoryAttributeResolver, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRows, rc as BinaryExpressionNode, ri as QueryComparisonOperator, rl as TimestampNaming, rn as getPersistedEnumTsType, ro as ExpressionSelectMap, rr as RuntimePathInput, rs as raw, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateData, sc as ExpressionBinaryOperator, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as ArkormModelNameRegistry, sr as getRegisteredMigrations, ss as InlineFactory, st as deriveSingularFieldName, t as URLDriver, ta as DelegateOrderBy, tc as MaybePromise, ti as QueryColumnComparisonCondition, tl as TimestampColumnBehavior, tn as getPersistedColumnMap, to as ChunkCallback, tr as RegisteredModel, ts as max, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadMap, uc as FunctionExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeOrderBy, ur as getRegisteredSeeders, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationURLDriver, vc as BelongsToManyRelationMetadata, vi as QueryJoinType, vn as RelationResolutionException, vo as ModelAttributeValue, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeOrderBy, wc as HasOneThroughRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventHandler, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaDelegateLike, xc as HasManyRelationMetadata, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelCreateData, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriverFactory, yc as BelongsToRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributes, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaSelect, zc as MigrationClass, zi as UpdateSpec, zn as MigrateFreshCommand, zo as RelatedModelClass, zr as AdapterModelStructure, zs as JoinSource, zt as markMigrationRun } from "./index-O3-Mi7hj.mjs";
|
|
1
|
+
import { $ as buildPrimaryKeyLine, $a as ModelStatic, $c as SchemaTableDropOperation, $i as DelegateFindManyArgs, $n as getModel, $o as fromExpressionNode, $r as InsertSpec, $s as FactoryRelationshipResolver, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCapableClient, Ac as MorphedByManyRelationMetadata, Ai as RawQuerySpec, An as EnumBuilder, Ao as ModelRelationshipKey, Ar as createPrismaDatabaseAdapter, As as RelationDefaultResolver, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaUniqueWhere, Bc as MigrationInstanceLike, Bi as UpsertSpec, Bn as MigrateCommand, Bo as Model, Br as AdapterQueryOperation, Bs as RelatedModelForRelationship, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaLikeInclude, Cc as HasOneRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelEventDispatcher, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSortOrder, Dc as MorphOneRelationMetadata, Di as QuerySelectColumn, Dn as MIGRATION_BRAND, Do as ModelEventName, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateType, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeSelect, Ec as MorphManyRelationMetadata, Ei as QueryScalarComparisonOperator, En as DB, Eo as ModelEventListener, Er as SeederInput, Es as RelationAggregateInput, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaInclude, Fc as AppliedMigrationRun, Fi as SelectSpec, Fn as SeedCommand, Fo as QuerySchemaForModelInstance, Fr as AdapterDatabaseCreationResult, Fs as RelationTableLookupSpec, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RuntimeClientLike, Gc as SchemaColumnType, Gi as ArkormDebugEvent, Gn as InitCommand, Go as JsonExpression, Gr as DatabaseAdapter, Gs as Paginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateData, Hc as PrismaMigrationWorkflowOptions, Hi as AdapterQueryInspection, Hn as MakeModelCommand, Ho as CaseExpression, Hr as AggregateOperation, Hs as WhereCallback, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaOrderBy, Ic as AppliedMigrationsState, Ii as SoftDeleteQueryMode, In as ModelsSyncCommand, Io as RegisteredModelClass, Ir as AdapterInspectionRequest, Is as EagerLoadQueryForRelationship, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SoftDeleteConfig, Jc as SchemaIndex, Ji as CastHandler, Jn as resolveCast, Jo as coalesce, Jr as DatabaseRows, Js as FactoryAttributes, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as Serializable, Kc as SchemaForeignKey, Ki as ArkormDebugHandler, Kn as DbCommand, Ko as avg, Kr as DatabasePrimitive, Ks as ArkormCollection, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaRow, Lc as GenerateMigrationOptions, Li as SortDirection, Ln as MigrationHistoryCommand, Lo as RegisteredModelInstance, Lr as AdapterModelFieldStructure, Ls as EagerLoadRelations, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionOptions, Mc as RelationMetadata, Mi as RelationFilterSpec, Mn as GeneratedColumnExpression, Mo as ModelUpdateData, Mr as createKyselyAdapter, Ms as RelationMetadataProvider, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as QuerySchemaCreateData, Nc as RelationMetadataType, Ni as RelationLoadPlan, Nn as resolveGeneratedExpression, No as ModelWhereInput, Nr as AdapterCapabilities, Ns as RelationResult, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeWhereInput, Oc as MorphToManyRelationMetadata, Oi as QueryTarget, On as Migration, Oo as ModelLifecycleState, Or as PrismaDelegateNameMapping, Os as RelationColumnLookupSpec, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaFindManyArgs, Pc as AppliedMigrationEntry, Pi as RelationLoadSpec, Pn as ForeignKeyBuilder, Po as QuerySchemaForModel, Pr as AdapterCapability, Ps as RelationResultCache, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionOptions, Qc as SchemaTableCreateOperation, Qi as DelegateCreateData, Qn as Arkormx, Qo as fn, Qr as InsertManySpec, Qs as FactoryModelConstructor, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRows, Rc as GeneratedMigrationFile, Ri as UpdateManySpec, Rn as MigrateRollbackCommand, Ro as RegisteredModelName, Rr as AdapterModelIntrospectionOptions, Rs as JoinOn, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaFindManyArgsLike, Sc as HasManyThroughRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelDeclaredAttributeKey, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeScalarFilter, Tc as ModelMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandlerConstructor, Tr as SeederConstructor, Ts as RelationAggregateConstraint, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaWhere, Uc as PrismaSchemaSyncOptions, Ui as ArkormBootContext, Un as MakeMigrationCommand, Uo as Expression, Ur as AggregateSelection, Us as JoinClause, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUpdateArgs, Vc as PrimaryKeyGeneration, Vi as AdapterBindableModel, Vn as MakeSeederCommand, Vo as AggregateExpression, Vr as AdapterTransactionContext, Vs as RelatedModelFromResult, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as RawSelectInput, Wc as SchemaColumn, Wi as ArkormConfig, Wn as MakeFactoryCommand, Wo as ExpressionBuilder, Wr as AggregateSpec, Ws as LengthAwarePaginator, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCapableClient, Xc as SchemaPrimaryKey, Xi as CastType, Xn as AttributeOptions, Xo as count, Xr as DeleteManySpec, Xs as FactoryDefinition, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as TransactionCallback, Yc as SchemaOperation, Yi as CastMap, Yn as Attribute, Yo as col, Yr as DatabaseValue, Ys as FactoryCallback, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionContext, Zc as SchemaTableAlterOperation, Zi as ClientResolver, Zn as Arkorm, Zo as expressionBuilder, Zr as DeleteSpec, Zs as FactoryDefinitionAttributes, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationOptions, _c as DatabaseTablePersistedMetadataOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as GlobalScope, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateUniqueWhere, ac as CaseExpressionNode, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateSpec, ar as RuntimePathMap, as as val, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PrismaClientLike, bc as ColumnMap, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributesOf, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateWhere, cc as ExpressionJsonCast, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelRegistry, cr as getRegisteredModels, cs as ModelFactory, ct as escapeRegex, d as inferDelegateName, da as GetUserConfig, dc as InExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeQuerySchema, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateInclude, ec as FactoryState, ei as PartitionedSelectSpec, el as SchemaUniqueConstraint, en as deletePersistedColumnMappingsState, eo as RelationshipModelStatic, er as RegisteredFactory, es as json, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as ModelQuerySchemaLike, fc as JsonExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeSchemaDelegate, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationMeta, gc as DatabaseTableOptions, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as DelegateForModelSchema, gr as registerMigrations, gt as pad, h as defineConfig, ha as PaginationCurrentPageResolver, hc as ValueExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeWhereInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateSelect, ic as CaseExpressionBranch, ii as QueryCondition, in as getPersistedPrimaryKeyGeneration, io as GroupByAggregateRow, ir as RuntimePathKey, is as sum, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionContext, jc as PivotModelStatic, ji as RelationAggregateSpec, jn as TableBuilder, jo as ModelRelationshipResult, jr as KyselyDatabaseAdapter, js as RelationDefaultValue, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaTransactionCallback, kc as MorphToRelationMetadata, ki as QueryTimeCondition, kn as SchemaBuilder, ko as ModelOrderByInput, kr as createPrismaCompatibilityAdapter, ks as RelationConstraint, kt as buildMigrationRunId, l as createPrismaAdapter, la as EagerLoadConstraint, lc as ExpressionNode, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as AttributeCreateInput, lr as getRegisteredPaths, ls as defineFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as NamingCase, mc as RawExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeUpdateInput, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateRow, nc as AggregateExpressionNode, ni as QueryComparisonCondition, nl as TimestampNames, nn as getPersistedEnumMap, no as EachCallback, nr as RuntimeConstructor, ns as min, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUpdateArgs, oc as ColumnExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as QueryBuilder, or as getRegisteredFactories, os as where, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelTableCase, pc as NullCheckExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSelect, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as SimplePaginationMeta, qc as SchemaForeignKeyAction, qi as CastDefinition, qn as CliApp, qo as caseWhen, qr as DatabaseRow, qs as FactoryAttributeResolver, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRows, rc as BinaryExpressionNode, ri as QueryComparisonOperator, rl as TimestampNaming, rn as getPersistedEnumTsType, ro as ExpressionSelectMap, rr as RuntimePathInput, rs as raw, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateData, sc as ExpressionBinaryOperator, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as ArkormModelNameRegistry, sr as getRegisteredMigrations, ss as InlineFactory, st as deriveSingularFieldName, t as URLDriver, ta as DelegateOrderBy, tc as MaybePromise, ti as QueryColumnComparisonCondition, tl as TimestampColumnBehavior, tn as getPersistedColumnMap, to as ChunkCallback, tr as RegisteredModel, ts as max, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadMap, uc as FunctionExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeOrderBy, ur as getRegisteredSeeders, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationURLDriver, vc as BelongsToManyRelationMetadata, vi as QueryJoinType, vn as RelationResolutionException, vo as ModelAttributeValue, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeOrderBy, wc as HasOneThroughRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventHandler, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaDelegateLike, xc as HasManyRelationMetadata, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelCreateData, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriverFactory, yc as BelongsToRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributes, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaSelect, zc as MigrationClass, zi as UpdateSpec, zn as MigrateFreshCommand, zo as RelatedModelClass, zr as AdapterModelStructure, zs as JoinSource, zt as markMigrationRun } from "./index-BYL9S6st.mjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateExpression, AggregateExpressionNode, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, ArkormModelNameRegistry, ArkormModelRegistry, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, BinaryExpressionNode, CaseExpression, CaseExpressionBranch, CaseExpressionNode, CastDefinition, CastHandler, CastMap, CastType, ChunkCallback, CliApp, ClientResolver, ColumnExpressionNode, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DbCommand, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EachCallback, EagerLoadConstraint, EagerLoadMap, EagerLoadQueryForRelationship, EagerLoadRelations, EnumBuilder, Expression, ExpressionBinaryOperator, ExpressionBuilder, ExpressionJsonCast, ExpressionNode, ExpressionSelectMap, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, FunctionExpressionNode, GenerateMigrationOptions, GeneratedColumnExpression, GeneratedMigrationFile, GetUserConfig, GlobalScope, GroupByAggregateRow, GroupByAggregateSpec, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InExpressionNode, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, JsonExpression, JsonExpressionNode, 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, MorphedByManyRelationMetadata, NamingCase, NullCheckExpressionNode, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PartitionedSelectSpec, 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, QueryExpressionCondition, QueryFullTextCondition, QueryGroupByItem, 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, RawExpressionNode, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RegisteredModelClass, RegisteredModelInstance, RegisteredModelName, 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, ValueExpressionNode, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, avg, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, caseWhen, coalesce, col, computeMigrationChecksum, configureArkormRuntime, count, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, disposeArkormRuntime, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, expressionBuilder, findAppliedMigration, findEnumBlock, findModelBlock, fn, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, fromExpressionNode, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastBatchMigrations, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getModel, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, json, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, max, min, pad, raw, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveGeneratedExpression, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRegisteredModel, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, sum, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, val, validatePersistedMetadataFeaturesForMigrations, where, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as buildPrimaryKeyLine, $n as readAppliedMigrationsState, $t as bindAdapterToModels, A as resetPersistedColumnMappingsCache, An as registerFactories, At as EnumBuilder, B as applyCreateTableOperation, Bn as ForeignKeyBuilder, Bt as col, C as getPersistedEnumMap, Cn as getRegisteredModels, Ct as supportsDatabaseCreation, D as getPersistedTimestampColumns, Dn as loadMigrationsFrom, Dt as toModelName, E as getPersistedTableMetadata, En as loadFactoriesFrom, Et as toMigrationFileSlug, F as writePersistedColumnMappingsState, Fn as resetRuntimeRegistryForTests, Ft as Expression, G as applyMigrationToPrismaSchema, Gn as deleteAppliedMigrationsStateFromStore, Gt as json, H as applyMigrationRollbackToDatabase, Hn as buildMigrationRunId, Ht as expressionBuilder, I as PRISMA_ENUM_MEMBER_REGEX, In as resolveRegisteredModel, It as JsonExpression, J as buildFieldLine, Jn as getLastMigrationRun, Jt as raw, K as applyOperationsToPrismaSchema, Kn as findAppliedMigration, Kt as max, L as PRISMA_ENUM_REGEX, Ln as UnsupportedAdapterFeatureException, Lt as avg, M as resolvePersistedMetadataFeatures, Mn as registerModels, Mt as resolveGeneratedExpression, N as syncPersistedColumnMappingsFromState, Nn as registerPaths, Nt as AggregateExpression, O as readPersistedColumnMappingsState, On as loadModelsFrom, Ot as isMigrationPlanningActive, P as validatePersistedMetadataFeaturesForMigrations, Pn as registerSeeders, Pt as CaseExpression, Q as buildModelBlock, Qn as markMigrationRun, Qt as awaitConfiguredModelsRegistration, R as PRISMA_MODEL_REGEX, Rn as RuntimeModuleLoader, Rt as caseWhen, S as getPersistedColumnMap, Sn as getRegisteredMigrations, St as stripPrismaSchemaModelsAndEnums, T as getPersistedPrimaryKeyGeneration, Tn as getRegisteredSeeders, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Un as computeMigrationChecksum, Ut as fn, V as applyDropTableOperation, Vn as buildMigrationIdentity, Vt as count, W as applyMigrationToDatabase, Wn as createEmptyAppliedMigrationsState, Wt as fromExpressionNode, X as buildInverseRelationLine, Xn as isMigrationApplied, Xt as val, Y as buildIndexLine, Yn as getLatestAppliedMigrations, Yt as sum, Z as buildMigrationSource, Zn as markMigrationApplied, Zt as where, _ as SetBasedEagerLoader, _n as isTransactionCapableClient, _t as resolveEnumName, a as MorphManyRelation, an as getActiveTransactionAdapter, ar as writeAppliedMigrationsStateToStore, at as deriveRelationAlias, b as createEmptyPersistedColumnMappingsState, bn as runArkormTransaction, bt as runMigrationWithPrisma, c as HasManyThroughRelation, cn as getRuntimeAdapter, cr as ArkormException, ct as escapeRegex, dn as getRuntimePaginationCurrentPageResolver, dt as formatDefaultValue, en as configureArkormRuntime, er as readAppliedMigrationsStateFromStore, et as buildRelationLine, f as BelongsToManyRelation, fn as getRuntimePaginationURLDriverFactory, ft as formatEnumDefaultValue, g as URLDriver, gn as isQuerySchemaLike, gt as pad, h as Paginator, hn as isDelegateLike, ht as getMigrationPlan, i as MorphOneRelation, in as ensureArkormConfigLoading, ir as writeAppliedMigrationsState, it as deriveInverseRelationAlias, j as resolveColumnMappingsFilePath, jn as registerMigrations, jt as TableBuilder, k as rebuildPersistedColumnMappingsState, kn as loadSeedersFrom, kt as SchemaBuilder, l as HasManyRelation, ln as getRuntimeClient, lt as findEnumBlock, m as LengthAwarePaginator, mn as getUserConfig, mt as generateMigrationFile, n as MorphedByManyRelation, nn as disposeArkormRuntime, nr as resolveMigrationStateFilePath, nt as createMigrationTimestamp, o as HasOneThroughRelation, on as getActiveTransactionClient, or as RelationResolutionException, ot as deriveRelationFieldName, p as Relation, pn as getRuntimePrismaClient, pt as formatRelationAction, q as buildEnumBlock, qn as getLastBatchMigrations, qt as min, r as MorphToManyRelation, rn as emitRuntimeDebugEvent, rr as supportsDatabaseMigrationState, rt as deriveCollectionFieldName, s as HasOneRelation, sn as getDefaultStubsPath, sr as ArkormCollection, st as deriveSingularFieldName, t as MorphToRelation, tn as defineConfig, tr as removeAppliedMigration, tt as buildUniqueConstraintLine, u as BelongsToRelation, un as getRuntimeDebugHandler, ut as findModelBlock, vn as loadArkormConfig, vt as resolveMigrationClassName, w as getPersistedEnumTsType, wn as getRegisteredPaths, wt as supportsDatabaseMigrationExecution, x as deletePersistedColumnMappingsState, xn as getRegisteredFactories, xt as runPrismaCommand, y as applyOperationsToPersistedColumnMappingsState, yn as resetArkormRuntimeForTests, yt as resolvePrismaType, z as applyAlterTableOperation, zn as PrimaryKeyGenerationPlanner, zt as coalesce } from "./relationship-
|
|
1
|
+
import { $ as buildPrimaryKeyLine, $n as readAppliedMigrationsState, $t as bindAdapterToModels, A as resetPersistedColumnMappingsCache, An as registerFactories, At as EnumBuilder, B as applyCreateTableOperation, Bn as ForeignKeyBuilder, Bt as col, C as getPersistedEnumMap, Cn as getRegisteredModels, Ct as supportsDatabaseCreation, D as getPersistedTimestampColumns, Dn as loadMigrationsFrom, Dt as toModelName, E as getPersistedTableMetadata, En as loadFactoriesFrom, Et as toMigrationFileSlug, F as writePersistedColumnMappingsState, Fn as resetRuntimeRegistryForTests, Ft as Expression, G as applyMigrationToPrismaSchema, Gn as deleteAppliedMigrationsStateFromStore, Gt as json, H as applyMigrationRollbackToDatabase, Hn as buildMigrationRunId, Ht as expressionBuilder, I as PRISMA_ENUM_MEMBER_REGEX, In as resolveRegisteredModel, It as JsonExpression, J as buildFieldLine, Jn as getLastMigrationRun, Jt as raw, K as applyOperationsToPrismaSchema, Kn as findAppliedMigration, Kt as max, L as PRISMA_ENUM_REGEX, Ln as UnsupportedAdapterFeatureException, Lt as avg, M as resolvePersistedMetadataFeatures, Mn as registerModels, Mt as resolveGeneratedExpression, N as syncPersistedColumnMappingsFromState, Nn as registerPaths, Nt as AggregateExpression, O as readPersistedColumnMappingsState, On as loadModelsFrom, Ot as isMigrationPlanningActive, P as validatePersistedMetadataFeaturesForMigrations, Pn as registerSeeders, Pt as CaseExpression, Q as buildModelBlock, Qn as markMigrationRun, Qt as awaitConfiguredModelsRegistration, R as PRISMA_MODEL_REGEX, Rn as RuntimeModuleLoader, Rt as caseWhen, S as getPersistedColumnMap, Sn as getRegisteredMigrations, St as stripPrismaSchemaModelsAndEnums, T as getPersistedPrimaryKeyGeneration, Tn as getRegisteredSeeders, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Un as computeMigrationChecksum, Ut as fn, V as applyDropTableOperation, Vn as buildMigrationIdentity, Vt as count, W as applyMigrationToDatabase, Wn as createEmptyAppliedMigrationsState, Wt as fromExpressionNode, X as buildInverseRelationLine, Xn as isMigrationApplied, Xt as val, Y as buildIndexLine, Yn as getLatestAppliedMigrations, Yt as sum, Z as buildMigrationSource, Zn as markMigrationApplied, Zt as where, _ as SetBasedEagerLoader, _n as isTransactionCapableClient, _t as resolveEnumName, a as MorphManyRelation, an as getActiveTransactionAdapter, ar as writeAppliedMigrationsStateToStore, at as deriveRelationAlias, b as createEmptyPersistedColumnMappingsState, bn as runArkormTransaction, bt as runMigrationWithPrisma, c as HasManyThroughRelation, cn as getRuntimeAdapter, cr as ArkormException, ct as escapeRegex, dn as getRuntimePaginationCurrentPageResolver, dt as formatDefaultValue, en as configureArkormRuntime, er as readAppliedMigrationsStateFromStore, et as buildRelationLine, f as BelongsToManyRelation, fn as getRuntimePaginationURLDriverFactory, ft as formatEnumDefaultValue, g as URLDriver, gn as isQuerySchemaLike, gt as pad, h as Paginator, hn as isDelegateLike, ht as getMigrationPlan, i as MorphOneRelation, in as ensureArkormConfigLoading, ir as writeAppliedMigrationsState, it as deriveInverseRelationAlias, j as resolveColumnMappingsFilePath, jn as registerMigrations, jt as TableBuilder, k as rebuildPersistedColumnMappingsState, kn as loadSeedersFrom, kt as SchemaBuilder, l as HasManyRelation, ln as getRuntimeClient, lt as findEnumBlock, m as LengthAwarePaginator, mn as getUserConfig, mt as generateMigrationFile, n as MorphedByManyRelation, nn as disposeArkormRuntime, nr as resolveMigrationStateFilePath, nt as createMigrationTimestamp, o as HasOneThroughRelation, on as getActiveTransactionClient, or as RelationResolutionException, ot as deriveRelationFieldName, p as Relation, pn as getRuntimePrismaClient, pt as formatRelationAction, q as buildEnumBlock, qn as getLastBatchMigrations, qt as min, r as MorphToManyRelation, rn as emitRuntimeDebugEvent, rr as supportsDatabaseMigrationState, rt as deriveCollectionFieldName, s as HasOneRelation, sn as getDefaultStubsPath, sr as ArkormCollection, st as deriveSingularFieldName, t as MorphToRelation, tn as defineConfig, tr as removeAppliedMigration, tt as buildUniqueConstraintLine, u as BelongsToRelation, un as getRuntimeDebugHandler, ut as findModelBlock, vn as loadArkormConfig, vt as resolveMigrationClassName, w as getPersistedEnumTsType, wn as getRegisteredPaths, wt as supportsDatabaseMigrationExecution, x as deletePersistedColumnMappingsState, xn as getRegisteredFactories, xt as runPrismaCommand, y as applyOperationsToPersistedColumnMappingsState, yn as resetArkormRuntimeForTests, yt as resolvePrismaType, z as applyAlterTableOperation, zn as PrimaryKeyGenerationPlanner, zt as coalesce } from "./relationship-PB57C4Pt.mjs";
|
|
2
2
|
import { Pool } from "pg";
|
|
3
3
|
import { extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -35,6 +35,27 @@ var QueryExecutionException = class extends ArkormException {
|
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/adapters/KyselyDatabaseAdapter.ts
|
|
37
37
|
/**
|
|
38
|
+
* Reads back the schema plan recorded against an applied migration.
|
|
39
|
+
*
|
|
40
|
+
* The driver hands `jsonb` back already parsed, but a `json`/`text` column (or
|
|
41
|
+
* an older pg driver) yields a string, so both are accepted. Anything else
|
|
42
|
+
* including rows written before the column existed resolves to `undefined`,
|
|
43
|
+
* which makes the consumer fall back to replaying the migration file.
|
|
44
|
+
*
|
|
45
|
+
* @param value
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
const parseRecordedMigrationOperations = (value) => {
|
|
49
|
+
if (Array.isArray(value)) return value;
|
|
50
|
+
if (typeof value !== "string") return void 0;
|
|
51
|
+
try {
|
|
52
|
+
const parsed = JSON.parse(value);
|
|
53
|
+
return Array.isArray(parsed) ? parsed : void 0;
|
|
54
|
+
} catch {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
38
59
|
* Database adapter implementation for Kysely, allowing Arkorm to execute queries using Kysely
|
|
39
60
|
* as the underlying query builder and executor.
|
|
40
61
|
*
|
|
@@ -534,8 +555,13 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
534
555
|
file text not null,
|
|
535
556
|
class_name text not null,
|
|
536
557
|
applied_at timestamptz not null,
|
|
537
|
-
checksum text null
|
|
558
|
+
checksum text null,
|
|
559
|
+
operations jsonb null
|
|
538
560
|
)
|
|
561
|
+
`, executor);
|
|
562
|
+
await this.executeRawStatement(`
|
|
563
|
+
alter table ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationStateTable)}
|
|
564
|
+
add column if not exists operations jsonb null
|
|
539
565
|
`, executor);
|
|
540
566
|
await this.executeRawStatement(`
|
|
541
567
|
create table if not exists ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationRunTable)} (
|
|
@@ -550,8 +576,8 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
550
576
|
await this.executeRawStatement(`delete from ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationRunTable)}`, executor);
|
|
551
577
|
await this.executeRawStatement(`delete from ${this.quoteIdentifier(KyselyDatabaseAdapter.migrationStateTable)}`, executor);
|
|
552
578
|
for (const migration of state.migrations) await sql`
|
|
553
|
-
insert into ${sql.table(KyselyDatabaseAdapter.migrationStateTable)} (id, file, class_name, applied_at, checksum)
|
|
554
|
-
values (${migration.id}, ${migration.file}, ${migration.className}, ${migration.appliedAt}, ${migration.checksum ?? null})
|
|
579
|
+
insert into ${sql.table(KyselyDatabaseAdapter.migrationStateTable)} (id, file, class_name, applied_at, checksum, operations)
|
|
580
|
+
values (${migration.id}, ${migration.file}, ${migration.className}, ${migration.appliedAt}, ${migration.checksum ?? null}, cast(${migration.operations ? JSON.stringify(migration.operations) : null} as jsonb))
|
|
555
581
|
`.execute(executor);
|
|
556
582
|
for (const run of state.runs ?? []) await sql`
|
|
557
583
|
insert into ${sql.table(KyselyDatabaseAdapter.migrationRunTable)} (id, applied_at, migration_ids)
|
|
@@ -1751,7 +1777,7 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
1751
1777
|
async readAppliedMigrationsState() {
|
|
1752
1778
|
await this.ensureMigrationStateTables();
|
|
1753
1779
|
const migrationsResult = await sql`
|
|
1754
|
-
select id, file, class_name, applied_at, checksum
|
|
1780
|
+
select id, file, class_name, applied_at, checksum, operations
|
|
1755
1781
|
from ${sql.table(KyselyDatabaseAdapter.migrationStateTable)}
|
|
1756
1782
|
order by applied_at asc, id asc
|
|
1757
1783
|
`.execute(this.db);
|
|
@@ -1767,7 +1793,8 @@ var KyselyDatabaseAdapter = class KyselyDatabaseAdapter {
|
|
|
1767
1793
|
file: row.file,
|
|
1768
1794
|
className: row.class_name,
|
|
1769
1795
|
appliedAt: row.applied_at instanceof Date ? row.applied_at.toISOString() : String(row.applied_at),
|
|
1770
|
-
checksum: row.checksum ?? void 0
|
|
1796
|
+
checksum: row.checksum ?? void 0,
|
|
1797
|
+
operations: parseRecordedMigrationOperations(row.operations)
|
|
1771
1798
|
})),
|
|
1772
1799
|
runs: runsResult.rows.map((row) => ({
|
|
1773
1800
|
id: row.id,
|
|
@@ -4016,13 +4043,18 @@ var MigrateCommand = class extends Command {
|
|
|
4016
4043
|
if (!appliedMigrationState) return true;
|
|
4017
4044
|
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
4018
4045
|
const checksum = computeMigrationChecksum(file);
|
|
4019
|
-
const
|
|
4020
|
-
|
|
4021
|
-
|
|
4046
|
+
const recorded = findAppliedMigration(appliedMigrationState, identity);
|
|
4047
|
+
const alreadyApplied = useDatabaseMigrations ? Boolean(recorded) : isMigrationApplied(appliedMigrationState, identity, checksum);
|
|
4048
|
+
if (alreadyApplied) skipped.push([
|
|
4049
|
+
migrationClass,
|
|
4050
|
+
file,
|
|
4051
|
+
Boolean(recorded?.checksum) && recorded?.checksum !== checksum
|
|
4052
|
+
]);
|
|
4053
|
+
else if (recorded) changed.push([migrationClass, file]);
|
|
4022
4054
|
return !alreadyApplied;
|
|
4023
4055
|
});
|
|
4024
|
-
skipped.forEach(([migrationClass, file]) => {
|
|
4025
|
-
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})`));
|
|
4056
|
+
skipped.forEach(([migrationClass, file, drifted]) => {
|
|
4057
|
+
this.success(this.app.splitLogger("Skipped", `${file} (${migrationClass.name})${drifted ? " [changed since applied]" : ""}`));
|
|
4026
4058
|
});
|
|
4027
4059
|
changed.forEach(([migrationClass, file]) => {
|
|
4028
4060
|
this.success(this.app.splitLogger("Changed", `${file} (${migrationClass.name})`));
|
|
@@ -4039,7 +4071,9 @@ var MigrateCommand = class extends Command {
|
|
|
4039
4071
|
return;
|
|
4040
4072
|
}
|
|
4041
4073
|
let columnMappingsState = createEmptyPersistedColumnMappingsState();
|
|
4042
|
-
|
|
4074
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
4075
|
+
for (const [MigrationClassItem, file] of pending) {
|
|
4076
|
+
const identity = buildMigrationIdentity(file, MigrationClassItem.name);
|
|
4043
4077
|
if (useDatabaseMigrations) {
|
|
4044
4078
|
const planned = await this.runWithDatabaseCreationRetry(adapter, () => getMigrationPlan(MigrationClassItem, "up", { inert: true }));
|
|
4045
4079
|
if (!planned.ok) return;
|
|
@@ -4049,13 +4083,16 @@ var MigrateCommand = class extends Command {
|
|
|
4049
4083
|
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4050
4084
|
return;
|
|
4051
4085
|
}
|
|
4052
|
-
|
|
4086
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
4087
|
+
if (!applied.ok) return;
|
|
4088
|
+
executedPlans.set(identity, applied.value.operations);
|
|
4053
4089
|
continue;
|
|
4054
4090
|
}
|
|
4055
|
-
await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4091
|
+
const applied = await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4056
4092
|
schemaPath,
|
|
4057
4093
|
write: true
|
|
4058
4094
|
});
|
|
4095
|
+
executedPlans.set(identity, applied.operations);
|
|
4059
4096
|
}
|
|
4060
4097
|
if (appliedMigrationState) {
|
|
4061
4098
|
const runAppliedIds = [];
|
|
@@ -4066,7 +4103,8 @@ var MigrateCommand = class extends Command {
|
|
|
4066
4103
|
file,
|
|
4067
4104
|
className: migrationClass.name,
|
|
4068
4105
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4069
|
-
checksum: computeMigrationChecksum(file)
|
|
4106
|
+
checksum: computeMigrationChecksum(file),
|
|
4107
|
+
operations: executedPlans.get(identity)
|
|
4070
4108
|
});
|
|
4071
4109
|
runAppliedIds.push(identity);
|
|
4072
4110
|
}
|
|
@@ -4255,23 +4293,32 @@ var MigrateFreshCommand = class extends Command {
|
|
|
4255
4293
|
}
|
|
4256
4294
|
let appliedState = createEmptyAppliedMigrationsState();
|
|
4257
4295
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState))).ok) return;
|
|
4258
|
-
|
|
4296
|
+
const executedPlans = /* @__PURE__ */ new Map();
|
|
4297
|
+
for (const [MigrationClassItem, file] of migrations) {
|
|
4298
|
+
const identity = buildMigrationIdentity(file, MigrationClassItem.name);
|
|
4259
4299
|
if (useDatabaseMigrations) {
|
|
4260
|
-
|
|
4300
|
+
const applied = await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem));
|
|
4301
|
+
if (!applied.ok) return;
|
|
4302
|
+
executedPlans.set(identity, applied.value.operations);
|
|
4261
4303
|
continue;
|
|
4262
4304
|
}
|
|
4263
|
-
await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4305
|
+
const applied = await applyMigrationToPrismaSchema(MigrationClassItem, {
|
|
4264
4306
|
schemaPath,
|
|
4265
4307
|
write: true
|
|
4266
4308
|
});
|
|
4309
|
+
executedPlans.set(identity, applied.operations);
|
|
4310
|
+
}
|
|
4311
|
+
for (const [migrationClass, file] of migrations) {
|
|
4312
|
+
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
4313
|
+
appliedState = markMigrationApplied(appliedState, {
|
|
4314
|
+
id: identity,
|
|
4315
|
+
file,
|
|
4316
|
+
className: migrationClass.name,
|
|
4317
|
+
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4318
|
+
checksum: computeMigrationChecksum(file),
|
|
4319
|
+
operations: executedPlans.get(identity)
|
|
4320
|
+
});
|
|
4267
4321
|
}
|
|
4268
|
-
for (const [migrationClass, file] of migrations) appliedState = markMigrationApplied(appliedState, {
|
|
4269
|
-
id: buildMigrationIdentity(file, migrationClass.name),
|
|
4270
|
-
file,
|
|
4271
|
-
className: migrationClass.name,
|
|
4272
|
-
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4273
|
-
checksum: computeMigrationChecksum(file)
|
|
4274
|
-
});
|
|
4275
4322
|
appliedState = markMigrationRun(appliedState, {
|
|
4276
4323
|
id: buildMigrationRunId(),
|
|
4277
4324
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4481,7 +4528,7 @@ var MigrationHistoryCommand = class extends Command {
|
|
|
4481
4528
|
{--state-file= : Path to applied migration state file}
|
|
4482
4529
|
{--reset : Clear tracked migration history file}
|
|
4483
4530
|
{--delete : Delete tracked migration history file}
|
|
4484
|
-
{--json : Print
|
|
4531
|
+
{--json : Print JSON output (without each migration's recorded schema plan)}
|
|
4485
4532
|
`;
|
|
4486
4533
|
this.description = "Inspect or reset tracked migration history";
|
|
4487
4534
|
}
|
|
@@ -4517,7 +4564,11 @@ var MigrationHistoryCommand = class extends Command {
|
|
|
4517
4564
|
if (this.option("json")) {
|
|
4518
4565
|
this.success(JSON.stringify({
|
|
4519
4566
|
path: usesDatabaseState ? "database" : stateFilePath,
|
|
4520
|
-
...state
|
|
4567
|
+
...state,
|
|
4568
|
+
migrations: state.migrations.map(({ operations: _operations, ...migration }) => ({
|
|
4569
|
+
...migration,
|
|
4570
|
+
hasRecordedPlan: Array.isArray(_operations)
|
|
4571
|
+
}))
|
|
4521
4572
|
}, null, 2));
|
|
4522
4573
|
return;
|
|
4523
4574
|
}
|
|
@@ -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-ChCzFqO1.cjs');
|
|
3
3
|
|
|
4
4
|
exports.BelongsToManyRelation = require_relationship.BelongsToManyRelation;
|
|
5
5
|
exports.BelongsToRelation = require_relationship.BelongsToRelation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Cs as Relation, Ss as BelongsToManyRelation, _s as HasOneRelation, bs as BelongsToRelation, ds as MorphToRelation, fs as MorphedByManyRelation, gs as HasOneThroughRelation, hs as MorphManyRelation, ms as MorphOneRelation, ps as MorphToManyRelation, us as SetBasedEagerLoader, vs as HasManyThroughRelation, ws as RelationTableLoader, xs as SingleResultRelation, ys as HasManyRelation } from "../index-
|
|
1
|
+
import { Cs as Relation, Ss as BelongsToManyRelation, _s as HasOneRelation, bs as BelongsToRelation, ds as MorphToRelation, fs as MorphedByManyRelation, gs as HasOneThroughRelation, hs as MorphManyRelation, ms as MorphOneRelation, ps as MorphToManyRelation, us as SetBasedEagerLoader, vs as HasManyThroughRelation, ws as RelationTableLoader, xs as SingleResultRelation, ys as HasManyRelation } from "../index-CDSTYl6q.cjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, MorphedByManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Cs as Relation, Ss as BelongsToManyRelation, _s as HasOneRelation, bs as BelongsToRelation, ds as MorphToRelation, fs as MorphedByManyRelation, gs as HasOneThroughRelation, hs as MorphManyRelation, ms as MorphOneRelation, ps as MorphToManyRelation, us as SetBasedEagerLoader, vs as HasManyThroughRelation, ws as RelationTableLoader, xs as SingleResultRelation, ys as HasManyRelation } from "../index-
|
|
1
|
+
import { Cs as Relation, Ss as BelongsToManyRelation, _s as HasOneRelation, bs as BelongsToRelation, ds as MorphToRelation, fs as MorphedByManyRelation, gs as HasOneThroughRelation, hs as MorphManyRelation, ms as MorphOneRelation, ps as MorphToManyRelation, us as SetBasedEagerLoader, vs as HasManyThroughRelation, ws as RelationTableLoader, xs as SingleResultRelation, ys as HasManyRelation } from "../index-BYL9S6st.mjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, MorphedByManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as SetBasedEagerLoader, a as MorphManyRelation, c as HasManyThroughRelation, d as SingleResultRelation, f as BelongsToManyRelation, i as MorphOneRelation, l as HasManyRelation, n as MorphedByManyRelation, o as HasOneThroughRelation, p as Relation, r as MorphToManyRelation, s as HasOneRelation, t as MorphToRelation, u as BelongsToRelation, v as RelationTableLoader } from "../relationship-
|
|
1
|
+
import { _ as SetBasedEagerLoader, a as MorphManyRelation, c as HasManyThroughRelation, d as SingleResultRelation, f as BelongsToManyRelation, i as MorphOneRelation, l as HasManyRelation, n as MorphedByManyRelation, o as HasOneThroughRelation, p as Relation, r as MorphToManyRelation, s as HasOneRelation, t as MorphToRelation, u as BelongsToRelation, v as RelationTableLoader } from "../relationship-PB57C4Pt.mjs";
|
|
2
2
|
|
|
3
3
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, MorphedByManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -123,6 +123,9 @@ const readAppliedMigrationsState = (stateFilePath) => {
|
|
|
123
123
|
version: 1,
|
|
124
124
|
migrations: parsed.migrations.filter((migration) => {
|
|
125
125
|
return typeof migration?.id === "string" && typeof migration?.file === "string" && typeof migration?.className === "string" && typeof migration?.appliedAt === "string" && (migration?.checksum === void 0 || typeof migration?.checksum === "string");
|
|
126
|
+
}).map((migration) => migration.operations === void 0 || Array.isArray(migration.operations) ? migration : {
|
|
127
|
+
...migration,
|
|
128
|
+
operations: void 0
|
|
126
129
|
}),
|
|
127
130
|
runs: Array.isArray(parsed.runs) ? parsed.runs.filter((run) => {
|
|
128
131
|
return typeof run?.id === "string" && typeof run?.appliedAt === "string" && Array.isArray(run?.migrationIds) && run.migrationIds.every((item) => typeof item === "string");
|
|
@@ -157,6 +160,20 @@ const deleteAppliedMigrationsStateFromStore = async (adapter, stateFilePath) =>
|
|
|
157
160
|
writeAppliedMigrationsState(stateFilePath, createEmptyAppliedMigrationsState());
|
|
158
161
|
return "file";
|
|
159
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Whether `identity` counts as applied in `state`.
|
|
165
|
+
*
|
|
166
|
+
* Passing a `checksum` makes an edited migration file count as *not* applied so
|
|
167
|
+
* it is re-run. That only suits the Prisma/file-backed flow, where re-applying a
|
|
168
|
+
* migration just rewrites the generated schema. Adapter-backed runtimes must
|
|
169
|
+
* omit the checksum and let the state store alone decide, since replaying an
|
|
170
|
+
* already-applied `up()` would run its SQL a second time.
|
|
171
|
+
*
|
|
172
|
+
* @param state
|
|
173
|
+
* @param identity
|
|
174
|
+
* @param checksum
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
160
177
|
const isMigrationApplied = (state, identity, checksum) => {
|
|
161
178
|
const matched = state.migrations.find((migration) => migration.id === identity);
|
|
162
179
|
if (!matched) return false;
|
|
@@ -3537,6 +3554,30 @@ const applyOperationsToPersistedColumnMappingsState = (state, operations, featur
|
|
|
3537
3554
|
tables: nextTables
|
|
3538
3555
|
};
|
|
3539
3556
|
};
|
|
3557
|
+
/**
|
|
3558
|
+
* Replays an applied migration's `up()` from the current file to recover its
|
|
3559
|
+
* schema plan.
|
|
3560
|
+
*
|
|
3561
|
+
* Only used for entries recorded before the plan was stored alongside them; the
|
|
3562
|
+
* result reflects the file as it stands now, which is why a recorded plan always
|
|
3563
|
+
* wins over this.
|
|
3564
|
+
*
|
|
3565
|
+
* @param migration
|
|
3566
|
+
* @param availableByIdentity
|
|
3567
|
+
* @returns
|
|
3568
|
+
*/
|
|
3569
|
+
const replayAppliedMigrationPlan = async (migration, availableByIdentity) => {
|
|
3570
|
+
const migrationClass = availableByIdentity.get(migration.id);
|
|
3571
|
+
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
3572
|
+
operation: "migration.columnMappings",
|
|
3573
|
+
meta: {
|
|
3574
|
+
migrationId: migration.id,
|
|
3575
|
+
file: migration.file,
|
|
3576
|
+
className: migration.className
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
return await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
3580
|
+
};
|
|
3540
3581
|
const rebuildPersistedColumnMappingsState = async (state, availableMigrations, features = resolvePersistedMetadataFeatures()) => {
|
|
3541
3582
|
const availableByIdentity = new Map(availableMigrations.map(([migrationClass, file]) => [buildMigrationIdentity(file, migrationClass.name), migrationClass]));
|
|
3542
3583
|
let nextState = createEmptyPersistedColumnMappingsState();
|
|
@@ -3549,16 +3590,7 @@ const rebuildPersistedColumnMappingsState = async (state, availableMigrations, f
|
|
|
3549
3590
|
return left.index - right.index;
|
|
3550
3591
|
});
|
|
3551
3592
|
for (const { migration } of orderedMigrations) {
|
|
3552
|
-
const
|
|
3553
|
-
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
3554
|
-
operation: "migration.columnMappings",
|
|
3555
|
-
meta: {
|
|
3556
|
-
migrationId: migration.id,
|
|
3557
|
-
file: migration.file,
|
|
3558
|
-
className: migration.className
|
|
3559
|
-
}
|
|
3560
|
-
});
|
|
3561
|
-
const operations = await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
3593
|
+
const operations = migration.operations ?? await replayAppliedMigrationPlan(migration, availableByIdentity);
|
|
3562
3594
|
nextState = applyOperationsToPersistedColumnMappingsState(nextState, operations, features);
|
|
3563
3595
|
}
|
|
3564
3596
|
return nextState;
|
|
@@ -95,6 +95,9 @@ const readAppliedMigrationsState = (stateFilePath) => {
|
|
|
95
95
|
version: 1,
|
|
96
96
|
migrations: parsed.migrations.filter((migration) => {
|
|
97
97
|
return typeof migration?.id === "string" && typeof migration?.file === "string" && typeof migration?.className === "string" && typeof migration?.appliedAt === "string" && (migration?.checksum === void 0 || typeof migration?.checksum === "string");
|
|
98
|
+
}).map((migration) => migration.operations === void 0 || Array.isArray(migration.operations) ? migration : {
|
|
99
|
+
...migration,
|
|
100
|
+
operations: void 0
|
|
98
101
|
}),
|
|
99
102
|
runs: Array.isArray(parsed.runs) ? parsed.runs.filter((run) => {
|
|
100
103
|
return typeof run?.id === "string" && typeof run?.appliedAt === "string" && Array.isArray(run?.migrationIds) && run.migrationIds.every((item) => typeof item === "string");
|
|
@@ -129,6 +132,20 @@ const deleteAppliedMigrationsStateFromStore = async (adapter, stateFilePath) =>
|
|
|
129
132
|
writeAppliedMigrationsState(stateFilePath, createEmptyAppliedMigrationsState());
|
|
130
133
|
return "file";
|
|
131
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* Whether `identity` counts as applied in `state`.
|
|
137
|
+
*
|
|
138
|
+
* Passing a `checksum` makes an edited migration file count as *not* applied so
|
|
139
|
+
* it is re-run. That only suits the Prisma/file-backed flow, where re-applying a
|
|
140
|
+
* migration just rewrites the generated schema. Adapter-backed runtimes must
|
|
141
|
+
* omit the checksum and let the state store alone decide, since replaying an
|
|
142
|
+
* already-applied `up()` would run its SQL a second time.
|
|
143
|
+
*
|
|
144
|
+
* @param state
|
|
145
|
+
* @param identity
|
|
146
|
+
* @param checksum
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
132
149
|
const isMigrationApplied = (state, identity, checksum) => {
|
|
133
150
|
const matched = state.migrations.find((migration) => migration.id === identity);
|
|
134
151
|
if (!matched) return false;
|
|
@@ -3509,6 +3526,30 @@ const applyOperationsToPersistedColumnMappingsState = (state, operations, featur
|
|
|
3509
3526
|
tables: nextTables
|
|
3510
3527
|
};
|
|
3511
3528
|
};
|
|
3529
|
+
/**
|
|
3530
|
+
* Replays an applied migration's `up()` from the current file to recover its
|
|
3531
|
+
* schema plan.
|
|
3532
|
+
*
|
|
3533
|
+
* Only used for entries recorded before the plan was stored alongside them; the
|
|
3534
|
+
* result reflects the file as it stands now, which is why a recorded plan always
|
|
3535
|
+
* wins over this.
|
|
3536
|
+
*
|
|
3537
|
+
* @param migration
|
|
3538
|
+
* @param availableByIdentity
|
|
3539
|
+
* @returns
|
|
3540
|
+
*/
|
|
3541
|
+
const replayAppliedMigrationPlan = async (migration, availableByIdentity) => {
|
|
3542
|
+
const migrationClass = availableByIdentity.get(migration.id);
|
|
3543
|
+
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
3544
|
+
operation: "migration.columnMappings",
|
|
3545
|
+
meta: {
|
|
3546
|
+
migrationId: migration.id,
|
|
3547
|
+
file: migration.file,
|
|
3548
|
+
className: migration.className
|
|
3549
|
+
}
|
|
3550
|
+
});
|
|
3551
|
+
return await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
3552
|
+
};
|
|
3512
3553
|
const rebuildPersistedColumnMappingsState = async (state, availableMigrations, features = resolvePersistedMetadataFeatures()) => {
|
|
3513
3554
|
const availableByIdentity = new Map(availableMigrations.map(([migrationClass, file]) => [buildMigrationIdentity(file, migrationClass.name), migrationClass]));
|
|
3514
3555
|
let nextState = createEmptyPersistedColumnMappingsState();
|
|
@@ -3521,16 +3562,7 @@ const rebuildPersistedColumnMappingsState = async (state, availableMigrations, f
|
|
|
3521
3562
|
return left.index - right.index;
|
|
3522
3563
|
});
|
|
3523
3564
|
for (const { migration } of orderedMigrations) {
|
|
3524
|
-
const
|
|
3525
|
-
if (!migrationClass) throw new ArkormException(`Unable to rebuild persisted column mappings because migration [${migration.id}] could not be resolved from the current migration files.`, {
|
|
3526
|
-
operation: "migration.columnMappings",
|
|
3527
|
-
meta: {
|
|
3528
|
-
migrationId: migration.id,
|
|
3529
|
-
file: migration.file,
|
|
3530
|
-
className: migration.className
|
|
3531
|
-
}
|
|
3532
|
-
});
|
|
3533
|
-
const operations = await getMigrationPlan(migrationClass, "up", { inert: true });
|
|
3565
|
+
const operations = migration.operations ?? await replayAppliedMigrationPlan(migration, availableByIdentity);
|
|
3534
3566
|
nextState = applyOperationsToPersistedColumnMappingsState(nextState, operations, features);
|
|
3535
3567
|
}
|
|
3536
3568
|
return nextState;
|