arkormx 2.11.0 → 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +257 -44
- package/dist/{index-DggXDBiD.d.cts → index-KPekH7gI.d.mts} +155 -3
- package/dist/{index-DoqUdah-.d.mts → index-WJEmy3Yu.d.cts} +155 -3
- package/dist/index.cjs +349 -49
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +347 -50
- 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-CP1xbMOa.mjs → relationship-4S2yHPIH.mjs} +67 -1
- package/dist/{relationship-IC-TAFyG.cjs → relationship-CQbj9Ahg.cjs} +78 -0
- package/package.json +5 -5
package/dist/cli.mjs
CHANGED
|
@@ -251,27 +251,48 @@ const markMigrationRun = (state, run) => {
|
|
|
251
251
|
runs: nextRuns
|
|
252
252
|
};
|
|
253
253
|
};
|
|
254
|
-
|
|
254
|
+
/**
|
|
255
|
+
* Groups the applied migrations into batches, oldest batch first, each batch
|
|
256
|
+
* holding its migration ids in application order.
|
|
257
|
+
*
|
|
258
|
+
* A "batch" is one `migrate` run. When no runs were recorded (e.g. legacy state
|
|
259
|
+
* written before run tracking), each applied migration is treated as its own
|
|
260
|
+
* batch so `--step` still behaves predictably.
|
|
261
|
+
*
|
|
262
|
+
* @param state
|
|
263
|
+
* @returns
|
|
264
|
+
*/
|
|
265
|
+
const resolveAppliedBatches = (state) => {
|
|
255
266
|
const runs = state.runs ?? [];
|
|
256
|
-
if (runs.length
|
|
257
|
-
return runs.map((run, index) => ({
|
|
267
|
+
if (runs.length > 0) return runs.map((run, index) => ({
|
|
258
268
|
run,
|
|
259
269
|
index
|
|
260
270
|
})).sort((left, right) => {
|
|
261
|
-
const appliedAtOrder =
|
|
271
|
+
const appliedAtOrder = left.run.appliedAt.localeCompare(right.run.appliedAt);
|
|
262
272
|
if (appliedAtOrder !== 0) return appliedAtOrder;
|
|
263
|
-
return
|
|
264
|
-
})
|
|
273
|
+
return left.index - right.index;
|
|
274
|
+
}).map((entry) => entry.run.migrationIds);
|
|
275
|
+
return state.migrations.map((migration) => [migration.id]);
|
|
265
276
|
};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Resolves the migrations belonging to the most recent `batches` batches, ordered
|
|
279
|
+
* for rollback — **reverse of the order they were applied** (most recent batch
|
|
280
|
+
* first, and within each batch the migration that ran `up()` last runs `down()`
|
|
281
|
+
* first), so a rollback exactly reverses how the migrations were applied.
|
|
282
|
+
*
|
|
283
|
+
* Defaults to a single batch (`migrate:rollback` with no `--step`); `--step=N`
|
|
284
|
+
* rolls back the last N batches.
|
|
285
|
+
*
|
|
286
|
+
* @param state
|
|
287
|
+
* @param batches
|
|
288
|
+
* @returns
|
|
289
|
+
*/
|
|
290
|
+
const getLastBatchMigrations = (state, batches = 1) => {
|
|
291
|
+
if (batches < 1) return [];
|
|
292
|
+
const allBatches = resolveAppliedBatches(state);
|
|
293
|
+
const selected = allBatches.slice(Math.max(0, allBatches.length - batches));
|
|
294
|
+
const byId = new Map(state.migrations.map((migration) => [migration.id, migration]));
|
|
295
|
+
return selected.reverse().flatMap((migrationIds) => [...migrationIds].reverse()).map((id) => byId.get(id)).filter((migration) => Boolean(migration));
|
|
275
296
|
};
|
|
276
297
|
|
|
277
298
|
//#endregion
|
|
@@ -3148,6 +3169,32 @@ const getRuntimeAdapter = () => {
|
|
|
3148
3169
|
if (!runtimeConfigLoaded) loadRuntimeConfigSync();
|
|
3149
3170
|
return runtimeAdapter;
|
|
3150
3171
|
};
|
|
3172
|
+
/**
|
|
3173
|
+
* Releases the database resources held by the configured runtime — the adapter's
|
|
3174
|
+
* connection pool and/or the configured client. Intended for short-lived
|
|
3175
|
+
* processes (the CLI) so the Node event loop drains and the process exits
|
|
3176
|
+
* promptly instead of hanging on pool idle timeouts. Teardown failures are
|
|
3177
|
+
* swallowed because the process is shutting down anyway.
|
|
3178
|
+
*/
|
|
3179
|
+
const disposeArkormRuntime = async () => {
|
|
3180
|
+
let adapterDisposed = false;
|
|
3181
|
+
try {
|
|
3182
|
+
if (runtimeAdapter && typeof runtimeAdapter.dispose === "function") {
|
|
3183
|
+
await runtimeAdapter.dispose();
|
|
3184
|
+
adapterDisposed = true;
|
|
3185
|
+
}
|
|
3186
|
+
} catch {}
|
|
3187
|
+
const client = getRuntimeClient();
|
|
3188
|
+
if (!client) return;
|
|
3189
|
+
try {
|
|
3190
|
+
if (typeof client.$disconnect === "function") await client.$disconnect();
|
|
3191
|
+
else if (!adapterDisposed && typeof client.destroy === "function") await client.destroy();
|
|
3192
|
+
else if (!adapterDisposed && typeof client.end === "function") await client.end();
|
|
3193
|
+
} catch {}
|
|
3194
|
+
};
|
|
3195
|
+
const getActiveTransactionClient = () => {
|
|
3196
|
+
return transactionClientStorage.getStore();
|
|
3197
|
+
};
|
|
3151
3198
|
const isTransactionCapableClient = (value) => {
|
|
3152
3199
|
if (!value || typeof value !== "object") return false;
|
|
3153
3200
|
return typeof value.$transaction === "function";
|
|
@@ -3263,6 +3310,14 @@ var PrismaDatabaseAdapter = class PrismaDatabaseAdapter {
|
|
|
3263
3310
|
returning: false
|
|
3264
3311
|
};
|
|
3265
3312
|
}
|
|
3313
|
+
/**
|
|
3314
|
+
* Disconnects the underlying Prisma client so a short-lived process (e.g. the
|
|
3315
|
+
* CLI) can exit promptly instead of waiting for the connection to idle out.
|
|
3316
|
+
*/
|
|
3317
|
+
async dispose() {
|
|
3318
|
+
const disconnectable = this.prisma;
|
|
3319
|
+
if (typeof disconnectable.$disconnect === "function") await disconnectable.$disconnect();
|
|
3320
|
+
}
|
|
3266
3321
|
hasTransactionSupport(client) {
|
|
3267
3322
|
return Boolean(client) && typeof client.$transaction === "function";
|
|
3268
3323
|
}
|
|
@@ -3722,6 +3777,26 @@ var PrismaDatabaseAdapter = class PrismaDatabaseAdapter {
|
|
|
3722
3777
|
});
|
|
3723
3778
|
}
|
|
3724
3779
|
};
|
|
3780
|
+
/**
|
|
3781
|
+
* Factory function to create a PrismaDatabaseAdapter instance with the given
|
|
3782
|
+
* Prisma client and optional delegate name mapping.
|
|
3783
|
+
*
|
|
3784
|
+
* @param prisma The Prisma client instance to be used by the adapter.
|
|
3785
|
+
* @param mapping Optional mapping of delegate names.
|
|
3786
|
+
* @returns A new instance of PrismaDatabaseAdapter.
|
|
3787
|
+
*/
|
|
3788
|
+
const createPrismaDatabaseAdapter = (prisma, mapping = {}) => {
|
|
3789
|
+
return new PrismaDatabaseAdapter(prisma, mapping);
|
|
3790
|
+
};
|
|
3791
|
+
/**
|
|
3792
|
+
* Alias for createPrismaDatabaseAdapter to maintain backward compatibility with
|
|
3793
|
+
* previous versions of Arkorm that exported the adapter factory under a different name.
|
|
3794
|
+
*
|
|
3795
|
+
* @param prisma The Prisma client instance to be used by the adapter.
|
|
3796
|
+
* @param mapping Optional mapping of delegate names.
|
|
3797
|
+
* @returns A new instance of PrismaDatabaseAdapter.
|
|
3798
|
+
*/
|
|
3799
|
+
const createPrismaCompatibilityAdapter = createPrismaDatabaseAdapter;
|
|
3725
3800
|
|
|
3726
3801
|
//#endregion
|
|
3727
3802
|
//#region src/cli/CliApp.ts
|
|
@@ -4493,6 +4568,143 @@ var CliApp = class {
|
|
|
4493
4568
|
}
|
|
4494
4569
|
};
|
|
4495
4570
|
|
|
4571
|
+
//#endregion
|
|
4572
|
+
//#region src/helpers/runtime-compatibility.ts
|
|
4573
|
+
const isCompatibilityClient = (value) => {
|
|
4574
|
+
return Boolean(value) && typeof value === "object";
|
|
4575
|
+
};
|
|
4576
|
+
const getCompatibilitySources = (preferredClient) => {
|
|
4577
|
+
const activeTransactionClient = getActiveTransactionClient();
|
|
4578
|
+
const runtimeClient = getRuntimeClient();
|
|
4579
|
+
return activeTransactionClient ? [
|
|
4580
|
+
activeTransactionClient,
|
|
4581
|
+
preferredClient,
|
|
4582
|
+
runtimeClient
|
|
4583
|
+
] : [preferredClient, runtimeClient];
|
|
4584
|
+
};
|
|
4585
|
+
const getRuntimeCompatibilityAdapter = (preferredClient) => {
|
|
4586
|
+
const client = getCompatibilitySources(preferredClient).find((source) => isCompatibilityClient(source));
|
|
4587
|
+
if (!client) return void 0;
|
|
4588
|
+
return createPrismaCompatibilityAdapter(client);
|
|
4589
|
+
};
|
|
4590
|
+
|
|
4591
|
+
//#endregion
|
|
4592
|
+
//#region src/cli/commands/DbCommand.ts
|
|
4593
|
+
/**
|
|
4594
|
+
* Executes a raw SQL statement against the configured database adapter and prints
|
|
4595
|
+
* the result — Arkorm's equivalent of `artisan db`.
|
|
4596
|
+
*
|
|
4597
|
+
* @author Legacy (3m1n3nc3)
|
|
4598
|
+
*/
|
|
4599
|
+
var DbCommand = class extends Command {
|
|
4600
|
+
constructor(..._args) {
|
|
4601
|
+
super(..._args);
|
|
4602
|
+
this.signature = `db
|
|
4603
|
+
{sql? : Raw SQL statement to execute (prompts for it when omitted)}
|
|
4604
|
+
{--file= : Read the SQL statement from a file instead of the argument}
|
|
4605
|
+
{--bindings= : JSON array of positional bindings for ? placeholders}
|
|
4606
|
+
{--json : Print result rows as JSON instead of a table}
|
|
4607
|
+
`;
|
|
4608
|
+
this.description = "Execute a raw SQL statement against the configured database";
|
|
4609
|
+
}
|
|
4610
|
+
async handle() {
|
|
4611
|
+
this.app.command = this;
|
|
4612
|
+
await loadArkormConfig();
|
|
4613
|
+
const sql = await this.resolveSql();
|
|
4614
|
+
if (sql === null) return;
|
|
4615
|
+
if (sql.trim().length === 0) return void this.error("Error: No SQL statement provided.");
|
|
4616
|
+
const bindings = this.resolveBindings();
|
|
4617
|
+
if (bindings === null) return;
|
|
4618
|
+
const adapter = getRuntimeAdapter() ?? getRuntimeCompatibilityAdapter();
|
|
4619
|
+
if (!adapter) return void this.error("Error: No database driver configured. Set an adapter or client in arkormx.config.");
|
|
4620
|
+
if (typeof adapter.rawQuery !== "function") return void this.error("Error: The configured adapter does not support raw queries. Use a SQL-backed adapter (e.g. the Kysely/PostgreSQL adapter).");
|
|
4621
|
+
let rows;
|
|
4622
|
+
try {
|
|
4623
|
+
rows = await adapter.rawQuery({
|
|
4624
|
+
sql,
|
|
4625
|
+
bindings
|
|
4626
|
+
});
|
|
4627
|
+
} catch (error) {
|
|
4628
|
+
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4629
|
+
return;
|
|
4630
|
+
}
|
|
4631
|
+
this.render(rows);
|
|
4632
|
+
}
|
|
4633
|
+
/**
|
|
4634
|
+
* Resolves the SQL to run. Priority: the positional argument, then `--file`,
|
|
4635
|
+
* then an interactive editor prompt (so a bare `arkorm db` lets you compose a
|
|
4636
|
+
* statement). Returns `null` (after emitting an error) when a referenced file is
|
|
4637
|
+
* missing.
|
|
4638
|
+
*/
|
|
4639
|
+
async resolveSql() {
|
|
4640
|
+
const argument = this.argument("sql");
|
|
4641
|
+
if (typeof argument === "string" && argument.trim().length > 0) return argument;
|
|
4642
|
+
const filePath = this.option("file") ? String(this.option("file")) : void 0;
|
|
4643
|
+
if (filePath) {
|
|
4644
|
+
const resolved = resolve(filePath);
|
|
4645
|
+
if (!existsSync$1(resolved)) {
|
|
4646
|
+
this.error(`Error: SQL file not found: ${this.app.formatPathForLog(resolved)}`);
|
|
4647
|
+
return null;
|
|
4648
|
+
}
|
|
4649
|
+
return readFileSync$1(resolved, "utf-8");
|
|
4650
|
+
}
|
|
4651
|
+
return await this.multiline("Query", "Enter the SQL to execute");
|
|
4652
|
+
}
|
|
4653
|
+
/**
|
|
4654
|
+
* Parses `--bindings` as a JSON array. Returns `null` (after emitting an error)
|
|
4655
|
+
* when the value is present but not a valid JSON array.
|
|
4656
|
+
*/
|
|
4657
|
+
resolveBindings() {
|
|
4658
|
+
const raw = this.option("bindings");
|
|
4659
|
+
if (raw == null || raw === "") return [];
|
|
4660
|
+
try {
|
|
4661
|
+
const parsed = JSON.parse(String(raw));
|
|
4662
|
+
if (!Array.isArray(parsed)) {
|
|
4663
|
+
this.error("Error: --bindings must be a JSON array, e.g. --bindings=\"[1, \\\"active\\\"]\".");
|
|
4664
|
+
return null;
|
|
4665
|
+
}
|
|
4666
|
+
return parsed;
|
|
4667
|
+
} catch {
|
|
4668
|
+
this.error("Error: --bindings must be valid JSON, e.g. --bindings=\"[1, \\\"active\\\"]\".");
|
|
4669
|
+
return null;
|
|
4670
|
+
}
|
|
4671
|
+
}
|
|
4672
|
+
render(rows) {
|
|
4673
|
+
if (this.option("json")) {
|
|
4674
|
+
this.line(JSON.stringify(rows, null, 2));
|
|
4675
|
+
return;
|
|
4676
|
+
}
|
|
4677
|
+
if (rows.length === 0) {
|
|
4678
|
+
this.success("Statement executed successfully. (0 rows returned)");
|
|
4679
|
+
return;
|
|
4680
|
+
}
|
|
4681
|
+
this.renderTable(rows);
|
|
4682
|
+
this.success(`(${rows.length} row${rows.length === 1 ? "" : "s"})`);
|
|
4683
|
+
}
|
|
4684
|
+
renderTable(rows) {
|
|
4685
|
+
const columns = rows.reduce((accumulator, row) => {
|
|
4686
|
+
Object.keys(row).forEach((key) => {
|
|
4687
|
+
if (!accumulator.includes(key)) accumulator.push(key);
|
|
4688
|
+
});
|
|
4689
|
+
return accumulator;
|
|
4690
|
+
}, []);
|
|
4691
|
+
const cell = (value) => {
|
|
4692
|
+
if (value === null || value === void 0) return "NULL";
|
|
4693
|
+
if (value instanceof Date) return value.toISOString();
|
|
4694
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
4695
|
+
return String(value);
|
|
4696
|
+
};
|
|
4697
|
+
const widths = columns.map((column) => rows.reduce((max, row) => Math.max(max, cell(row[column]).length), column.length));
|
|
4698
|
+
const separator = `+${widths.map((width) => "-".repeat(width + 2)).join("+")}+`;
|
|
4699
|
+
const formatRow = (values) => `| ${values.map((value, index) => value.padEnd(widths[index])).join(" | ")} |`;
|
|
4700
|
+
this.line(separator);
|
|
4701
|
+
this.line(formatRow(columns));
|
|
4702
|
+
this.line(separator);
|
|
4703
|
+
rows.forEach((row) => this.line(formatRow(columns.map((column) => cell(row[column])))));
|
|
4704
|
+
this.line(separator);
|
|
4705
|
+
}
|
|
4706
|
+
};
|
|
4707
|
+
|
|
4496
4708
|
//#endregion
|
|
4497
4709
|
//#region src/cli/commands/InitCommand.ts
|
|
4498
4710
|
/**
|
|
@@ -5090,7 +5302,7 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
5090
5302
|
constructor(..._args) {
|
|
5091
5303
|
super(..._args);
|
|
5092
5304
|
this.signature = `migrate:rollback
|
|
5093
|
-
{--step= : Number of
|
|
5305
|
+
{--step= : Number of batches to rollback (defaults to 1, the last batch)}
|
|
5094
5306
|
{--dry-run : Preview rollback targets without applying changes}
|
|
5095
5307
|
{--deploy : Use prisma migrate deploy instead of migrate dev (Prisma compatibility driver only)}
|
|
5096
5308
|
{--skip-generate : Skip prisma generate (Prisma compatibility driver only)}
|
|
@@ -5112,14 +5324,10 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
5112
5324
|
const useDatabaseMigrations = supportsDatabaseMigrationExecution(adapter);
|
|
5113
5325
|
const persistedFeatures = resolvePersistedMetadataFeatures(this.app.getConfig("features"));
|
|
5114
5326
|
let appliedState = await readAppliedMigrationsStateFromStore(adapter, stateFilePath);
|
|
5115
|
-
const stepOption = this.option("step"
|
|
5116
|
-
const stepCount = stepOption == null ?
|
|
5117
|
-
if (
|
|
5118
|
-
const targets =
|
|
5119
|
-
const lastRun = getLastMigrationRun(appliedState);
|
|
5120
|
-
if (!lastRun) return [];
|
|
5121
|
-
return lastRun.migrationIds.map((id) => appliedState.migrations.find((migration) => migration.id === id)).filter((migration) => Boolean(migration));
|
|
5122
|
-
})();
|
|
5327
|
+
const stepOption = this.option("step");
|
|
5328
|
+
const stepCount = stepOption == null ? 1 : Number(stepOption);
|
|
5329
|
+
if (!Number.isFinite(stepCount) || stepCount <= 0 || !Number.isInteger(stepCount)) return void this.error("Error: --step must be a positive integer.");
|
|
5330
|
+
const targets = getLastBatchMigrations(appliedState, stepCount);
|
|
5123
5331
|
if (targets.length === 0) return void this.error("Error: No tracked migrations available to rollback.");
|
|
5124
5332
|
const available = await this.loadAllMigrations(migrationDirs);
|
|
5125
5333
|
const rollbackClasses = targets.map((target) => {
|
|
@@ -5458,26 +5666,31 @@ var logo_default = String.raw`
|
|
|
5458
5666
|
//#endregion
|
|
5459
5667
|
//#region src/cli/index.ts
|
|
5460
5668
|
const app = new CliApp();
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5669
|
+
try {
|
|
5670
|
+
await Kernel.init(app, {
|
|
5671
|
+
logo: logo_default,
|
|
5672
|
+
name: "Arkormˣ CLI",
|
|
5673
|
+
baseCommands: [
|
|
5674
|
+
DbCommand,
|
|
5675
|
+
InitCommand,
|
|
5676
|
+
MakeModelCommand,
|
|
5677
|
+
MakeFactoryCommand,
|
|
5678
|
+
MakeSeederCommand,
|
|
5679
|
+
MakeMigrationCommand,
|
|
5680
|
+
ModelsSyncCommand,
|
|
5681
|
+
SeedCommand,
|
|
5682
|
+
MigrateCommand,
|
|
5683
|
+
MigrateFreshCommand,
|
|
5684
|
+
MigrateRollbackCommand,
|
|
5685
|
+
MigrationHistoryCommand
|
|
5686
|
+
],
|
|
5687
|
+
exceptionHandler(exception) {
|
|
5688
|
+
throw exception;
|
|
5689
|
+
}
|
|
5690
|
+
});
|
|
5691
|
+
} finally {
|
|
5692
|
+
await disposeArkormRuntime();
|
|
5693
|
+
}
|
|
5481
5694
|
|
|
5482
5695
|
//#endregion
|
|
5483
5696
|
export { };
|
|
@@ -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 { Command } from "@h3ravel/musket";
|
|
4
|
+
import { PrismaClient } from "@prisma/client";
|
|
5
5
|
|
|
6
6
|
//#region src/types/migrations.d.ts
|
|
7
7
|
type SchemaColumnType = 'id' | 'uuid' | 'enum' | 'string' | 'text' | 'integer' | 'bigInteger' | 'float' | 'decimal' | 'boolean' | 'json' | 'date' | 'dateTime' | 'timestamp';
|
|
@@ -3508,6 +3508,10 @@ type ModelLifecycleState = {
|
|
|
3508
3508
|
//#region src/QueryBuilder.d.ts
|
|
3509
3509
|
/** Object select projection whose values may be expressions, columns, or booleans. */
|
|
3510
3510
|
type ExpressionSelectMap = Record<string, Expression | boolean | string>;
|
|
3511
|
+
/** Callback invoked with each chunk of results; return `false` to stop early. */
|
|
3512
|
+
type ChunkCallback<TModel> = (models: ArkormCollection<TModel>, page: number) => unknown | Promise<unknown>;
|
|
3513
|
+
/** Callback invoked with each record during `each`/`eachById`; return `false` to stop. */
|
|
3514
|
+
type EachCallback<TModel> = (model: TModel, index: number) => unknown | Promise<unknown>;
|
|
3511
3515
|
/** Map of model attributes selected for an aggregate (`{ amount: true }`). */
|
|
3512
3516
|
type AggregateColumnMap<TModel> = Partial<Record<keyof ModelAttributes<TModel> & string, true>>;
|
|
3513
3517
|
/**
|
|
@@ -4640,6 +4644,88 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4640
4644
|
* @returns
|
|
4641
4645
|
*/
|
|
4642
4646
|
get(): Promise<ArkormCollection<TModel>>;
|
|
4647
|
+
/**
|
|
4648
|
+
* Processes the query results in chunks, invoking the callback with each chunk
|
|
4649
|
+
* as a collection. Return `false` from the callback to stop early. Resolves to
|
|
4650
|
+
* `false` when stopped early, otherwise `true`.
|
|
4651
|
+
*
|
|
4652
|
+
* Chunking pages with `offset`/`limit`, so add an `orderBy` for stable results
|
|
4653
|
+
* and prefer {@link chunkById} when modifying the records being iterated.
|
|
4654
|
+
*
|
|
4655
|
+
* @param count Rows per chunk.
|
|
4656
|
+
* @param callback Receives each chunk and its 1-based page number.
|
|
4657
|
+
* @returns
|
|
4658
|
+
*/
|
|
4659
|
+
chunk(count: number, callback: ChunkCallback<TModel>): Promise<boolean>;
|
|
4660
|
+
/**
|
|
4661
|
+
* Chunks the results by comparing a monotonically increasing key column
|
|
4662
|
+
* (`id > lastId`) rather than by offset — safe when the callback updates the
|
|
4663
|
+
* records being iterated. Return `false` from the callback to stop early.
|
|
4664
|
+
*
|
|
4665
|
+
* @param count Rows per chunk.
|
|
4666
|
+
* @param callback Receives each chunk and its 1-based page number.
|
|
4667
|
+
* @param column The key column to page by (defaults to the primary key).
|
|
4668
|
+
* @param alias The result attribute holding the key value (defaults to `column`).
|
|
4669
|
+
* @returns
|
|
4670
|
+
*/
|
|
4671
|
+
chunkById(count: number, callback: ChunkCallback<TModel>, column?: string, alias?: string): Promise<boolean>;
|
|
4672
|
+
/**
|
|
4673
|
+
* Iterates the query results one record at a time (chunking under the hood).
|
|
4674
|
+
* Return `false` from the callback to stop early.
|
|
4675
|
+
*
|
|
4676
|
+
* @param callback Receives each record and its 0-based index.
|
|
4677
|
+
* @param count Rows fetched per chunk (default 1000).
|
|
4678
|
+
* @returns
|
|
4679
|
+
*/
|
|
4680
|
+
each(callback: EachCallback<TModel>, count?: number): Promise<boolean>;
|
|
4681
|
+
/**
|
|
4682
|
+
* Like {@link each}, but pages by key column ({@link chunkById}) — safe when the
|
|
4683
|
+
* callback updates the records being iterated.
|
|
4684
|
+
*
|
|
4685
|
+
* @param callback Receives each record and its 0-based index.
|
|
4686
|
+
* @param count Rows fetched per chunk (default 1000).
|
|
4687
|
+
* @param column The key column to page by (defaults to the primary key).
|
|
4688
|
+
* @param alias The result attribute holding the key value (defaults to `column`).
|
|
4689
|
+
* @returns
|
|
4690
|
+
*/
|
|
4691
|
+
eachById(callback: EachCallback<TModel>, count?: number, column?: string, alias?: string): Promise<boolean>;
|
|
4692
|
+
/**
|
|
4693
|
+
* Streams the query results lazily as an async iterator, fetching one chunk at
|
|
4694
|
+
* a time so only a small window is held in memory. Iterate with `for await`.
|
|
4695
|
+
*
|
|
4696
|
+
* ```ts
|
|
4697
|
+
* for await (const user of User.query().orderBy({ id: 'asc' }).lazy()) {
|
|
4698
|
+
* // …
|
|
4699
|
+
* }
|
|
4700
|
+
* ```
|
|
4701
|
+
*
|
|
4702
|
+
* @param chunkSize Rows fetched per underlying query (default 1000).
|
|
4703
|
+
* @returns
|
|
4704
|
+
*/
|
|
4705
|
+
lazy(chunkSize?: number): AsyncGenerator<TModel>;
|
|
4706
|
+
/**
|
|
4707
|
+
* Streams the results lazily, paging by an ascending key column — safe when the
|
|
4708
|
+
* consumer updates records mid-iteration. Iterate with `for await`.
|
|
4709
|
+
*
|
|
4710
|
+
* @param chunkSize Rows fetched per underlying query (default 1000).
|
|
4711
|
+
* @param column The key column to page by (defaults to the primary key).
|
|
4712
|
+
* @param alias The result attribute holding the key value (defaults to `column`).
|
|
4713
|
+
* @returns
|
|
4714
|
+
*/
|
|
4715
|
+
lazyById(chunkSize?: number, column?: string, alias?: string): AsyncGenerator<TModel>;
|
|
4716
|
+
/**
|
|
4717
|
+
* Streams the results lazily, paging by a descending key column. Iterate with
|
|
4718
|
+
* `for await`.
|
|
4719
|
+
*
|
|
4720
|
+
* @param chunkSize Rows fetched per underlying query (default 1000).
|
|
4721
|
+
* @param column The key column to page by (defaults to the primary key).
|
|
4722
|
+
* @param alias The result attribute holding the key value (defaults to `column`).
|
|
4723
|
+
* @returns
|
|
4724
|
+
*/
|
|
4725
|
+
lazyByIdDesc(chunkSize?: number, column?: string, alias?: string): AsyncGenerator<TModel>;
|
|
4726
|
+
private lazyByKey;
|
|
4727
|
+
private assertPositiveChunkSize;
|
|
4728
|
+
private readModelAttribute;
|
|
4643
4729
|
/**
|
|
4644
4730
|
* Executes the query and returns the first result as a model
|
|
4645
4731
|
* instance, or null if no results are found.
|
|
@@ -5808,6 +5894,12 @@ interface DatabaseAdapter {
|
|
|
5808
5894
|
readAppliedMigrationsState?: () => Promise<AppliedMigrationsState>;
|
|
5809
5895
|
writeAppliedMigrationsState?: (state: AppliedMigrationsState) => Promise<void>;
|
|
5810
5896
|
transaction: <TResult = unknown>(callback: (adapter: DatabaseAdapter) => TResult | Promise<TResult>, context?: AdapterTransactionContext) => Promise<TResult>;
|
|
5897
|
+
/**
|
|
5898
|
+
* Releases any resources the adapter holds (connection pools, clients). Called
|
|
5899
|
+
* by short-lived processes such as the CLI so the event loop can drain and the
|
|
5900
|
+
* process exits promptly instead of waiting for pool idle timeouts.
|
|
5901
|
+
*/
|
|
5902
|
+
dispose?: () => Promise<void>;
|
|
5811
5903
|
}
|
|
5812
5904
|
//#endregion
|
|
5813
5905
|
//#region src/adapters/KyselyDatabaseAdapter.d.ts
|
|
@@ -5827,6 +5919,12 @@ declare class KyselyDatabaseAdapter implements DatabaseAdapter {
|
|
|
5827
5919
|
private static readonly migrationRunTable;
|
|
5828
5920
|
readonly capabilities: AdapterCapabilities;
|
|
5829
5921
|
constructor(db: KyselyExecutor, mapping?: KyselyTableMapping);
|
|
5922
|
+
/**
|
|
5923
|
+
* Destroys the underlying Kysely instance, which ends its connection pool so a
|
|
5924
|
+
* short-lived process (e.g. the CLI) can exit promptly. A no-op when `db` is a
|
|
5925
|
+
* transaction executor, which does not own the pool.
|
|
5926
|
+
*/
|
|
5927
|
+
dispose(): Promise<void>;
|
|
5830
5928
|
private resolveConfiguredDatabaseName;
|
|
5831
5929
|
private createMaintenanceConnectionString;
|
|
5832
5930
|
private getMissingDatabaseNameFromError;
|
|
@@ -6125,6 +6223,11 @@ declare class PrismaDatabaseAdapter implements DatabaseAdapter {
|
|
|
6125
6223
|
readonly capabilities: AdapterCapabilities;
|
|
6126
6224
|
private readonly delegates;
|
|
6127
6225
|
constructor(prisma: PrismaClientLike, mapping?: PrismaDelegateNameMapping);
|
|
6226
|
+
/**
|
|
6227
|
+
* Disconnects the underlying Prisma client so a short-lived process (e.g. the
|
|
6228
|
+
* CLI) can exit promptly instead of waiting for the connection to idle out.
|
|
6229
|
+
*/
|
|
6230
|
+
dispose(): Promise<void>;
|
|
6128
6231
|
private hasTransactionSupport;
|
|
6129
6232
|
private normalizeCandidate;
|
|
6130
6233
|
private unique;
|
|
@@ -6800,6 +6903,33 @@ declare class CliApp {
|
|
|
6800
6903
|
};
|
|
6801
6904
|
}
|
|
6802
6905
|
//#endregion
|
|
6906
|
+
//#region src/cli/commands/DbCommand.d.ts
|
|
6907
|
+
/**
|
|
6908
|
+
* Executes a raw SQL statement against the configured database adapter and prints
|
|
6909
|
+
* the result — Arkorm's equivalent of `artisan db`.
|
|
6910
|
+
*
|
|
6911
|
+
* @author Legacy (3m1n3nc3)
|
|
6912
|
+
*/
|
|
6913
|
+
declare class DbCommand extends Command<CliApp> {
|
|
6914
|
+
protected signature: string;
|
|
6915
|
+
protected description: string;
|
|
6916
|
+
handle(): Promise<undefined>;
|
|
6917
|
+
/**
|
|
6918
|
+
* Resolves the SQL to run. Priority: the positional argument, then `--file`,
|
|
6919
|
+
* then an interactive editor prompt (so a bare `arkorm db` lets you compose a
|
|
6920
|
+
* statement). Returns `null` (after emitting an error) when a referenced file is
|
|
6921
|
+
* missing.
|
|
6922
|
+
*/
|
|
6923
|
+
private resolveSql;
|
|
6924
|
+
/**
|
|
6925
|
+
* Parses `--bindings` as a JSON array. Returns `null` (after emitting an error)
|
|
6926
|
+
* when the value is present but not a valid JSON array.
|
|
6927
|
+
*/
|
|
6928
|
+
private resolveBindings;
|
|
6929
|
+
private render;
|
|
6930
|
+
private renderTable;
|
|
6931
|
+
}
|
|
6932
|
+
//#endregion
|
|
6803
6933
|
//#region src/cli/commands/InitCommand.d.ts
|
|
6804
6934
|
/**
|
|
6805
6935
|
* The InitCommand class implements the CLI command for initializing Arkormˣ by creating
|
|
@@ -7842,6 +7972,20 @@ declare const buildMigrationRunId: () => string;
|
|
|
7842
7972
|
declare const markMigrationRun: (state: AppliedMigrationsState, run: AppliedMigrationRun) => AppliedMigrationsState;
|
|
7843
7973
|
declare const getLastMigrationRun: (state: AppliedMigrationsState) => AppliedMigrationRun | undefined;
|
|
7844
7974
|
declare const getLatestAppliedMigrations: (state: AppliedMigrationsState, steps: number) => AppliedMigrationEntry[];
|
|
7975
|
+
/**
|
|
7976
|
+
* Resolves the migrations belonging to the most recent `batches` batches, ordered
|
|
7977
|
+
* for rollback — **reverse of the order they were applied** (most recent batch
|
|
7978
|
+
* first, and within each batch the migration that ran `up()` last runs `down()`
|
|
7979
|
+
* first), so a rollback exactly reverses how the migrations were applied.
|
|
7980
|
+
*
|
|
7981
|
+
* Defaults to a single batch (`migrate:rollback` with no `--step`); `--step=N`
|
|
7982
|
+
* rolls back the last N batches.
|
|
7983
|
+
*
|
|
7984
|
+
* @param state
|
|
7985
|
+
* @param batches
|
|
7986
|
+
* @returns
|
|
7987
|
+
*/
|
|
7988
|
+
declare const getLastBatchMigrations: (state: AppliedMigrationsState, batches?: number) => AppliedMigrationEntry[];
|
|
7845
7989
|
//#endregion
|
|
7846
7990
|
//#region src/helpers/migrations.d.ts
|
|
7847
7991
|
declare const PRISMA_MODEL_REGEX: RegExp;
|
|
@@ -8228,6 +8372,14 @@ declare const getRuntimePrismaClient: () => RuntimeClientLike | undefined;
|
|
|
8228
8372
|
* @returns
|
|
8229
8373
|
*/
|
|
8230
8374
|
declare const getRuntimeAdapter: () => DatabaseAdapter | undefined;
|
|
8375
|
+
/**
|
|
8376
|
+
* Releases the database resources held by the configured runtime — the adapter's
|
|
8377
|
+
* connection pool and/or the configured client. Intended for short-lived
|
|
8378
|
+
* processes (the CLI) so the Node event loop drains and the process exits
|
|
8379
|
+
* promptly instead of hanging on pool idle timeouts. Teardown failures are
|
|
8380
|
+
* swallowed because the process is shutting down anyway.
|
|
8381
|
+
*/
|
|
8382
|
+
declare const disposeArkormRuntime: () => Promise<void>;
|
|
8231
8383
|
declare const getActiveTransactionClient: () => RuntimeClientLike | undefined;
|
|
8232
8384
|
declare const getActiveTransactionAdapter: () => DatabaseAdapter | undefined;
|
|
8233
8385
|
declare const isTransactionCapableClient: (value: unknown) => value is TransactionCapableClient;
|
|
@@ -8357,4 +8509,4 @@ declare class URLDriver {
|
|
|
8357
8509
|
url(page: number): string;
|
|
8358
8510
|
}
|
|
8359
8511
|
//#endregion
|
|
8360
|
-
export { buildRelationLine as $, AttributeCreateInput as $a, DelegateUniqueWhere as $i, RuntimePathInput as $n, MorphToManyRelation as $o, QueryDayCondition as $r, RawExpressionNode as $s, getPersistedColumnMap as $t, isTransactionCapableClient as A, QuerySchemaOrderBy as Aa, SchemaForeignKey as Ac, SoftDeleteQueryMode as Ai, GeneratedColumnExpression as An, Expression as Ao, AdapterDatabaseCreationResult as Ar, Paginator as As, createEmptyAppliedMigrationsState as At, applyDropTableOperation as B, Serializable as Ba, TimestampNames as Bc, ArkormDebugHandler as Bi, MakeModelCommand as Bn, fromExpressionNode as Bo, DatabaseAdapter as Br, MaybePromise as Bs, removeAppliedMigration as Bt, getRuntimeDebugHandler as C, PrismaTransactionCallback as Ca, MigrationClass as Cc, QueryTimeCondition as Ci, ArkormException as Cn, ModelWhereInput as Co, PrismaDelegateNameMapping as Cr, JoinOn as Cs, supportsDatabaseMigrationExecution as Ct, getUserConfig as D, QuerySchemaCreateData as Da, PrismaSchemaSyncOptions as Dc, RelationLoadPlan as Di, SchemaBuilder as Dn, Model as Do, createKyselyAdapter as Dr, WhereCallback as Ds, buildMigrationIdentity as Dt, getRuntimePrismaClient as E, PrismaTransactionOptions as Ea, PrismaMigrationWorkflowOptions as Ec, RelationFilterSpec as Ei, Migration as En, RelatedModelClass as Eo, KyselyDatabaseAdapter as Er, RelatedModelFromResult as Es, toModelName as Et, PRISMA_ENUM_MEMBER_REGEX as F, QuerySchemaUpdateArgs as Fa, SchemaTableAlterOperation as Fc, AdapterBindableModel as Fi, MigrationHistoryCommand as Fn, coalesce as Fo, AdapterQueryOperation as Fr, FactoryDefinition as Fs, isMigrationApplied as Ft, applyOperationsToPrismaSchema as G, TransactionContext as Ga, ClientResolver as Gi, resolveCast as Gn, sum as Go, DeleteManySpec as Gr, ColumnExpressionNode as Gs, PersistedColumnMappingsState as Gt, applyMigrationRollbackToPrismaSchema as H, SoftDeleteConfig as Ha, CastHandler as Hi, MakeFactoryCommand as Hn, max as Ho, DatabaseRow as Hr, BinaryExpressionNode as Hs, supportsDatabaseMigrationState as Ht, PRISMA_ENUM_REGEX as I, QuerySchemaUpdateData as Ia, SchemaTableCreateOperation as Ic, AdapterQueryInspection as Ii, MigrateRollbackCommand as In, col as Io, AdapterTransactionContext as Ir, FactoryDefinitionAttributes as Is, markMigrationApplied as It, buildIndexLine as J, RelationshipModelStatic as Ja, DelegateInclude as Ji, Arkorm as Jn, InlineFactory as Jo, InsertSpec as Jr, ExpressionNode as Js, PersistedTableMetadata as Jt, buildEnumBlock as K, TransactionOptions as Ka, DelegateCreateData as Ki, Attribute as Kn, val as Ko, DeleteSpec as Kr, ExpressionBinaryOperator as Ks, PersistedMetadataFeatures as Kt, PRISMA_MODEL_REGEX as L, QuerySchemaWhere as La, SchemaTableDropOperation as Lc, ArkormBootContext as Li, MigrateFreshCommand as Ln, count as Lo, AggregateOperation as Lr, FactoryModelConstructor as Ls, markMigrationRun as Lt, resetArkormRuntimeForTests as M, QuerySchemaRows as Ma, SchemaIndex as Mc, UpdateManySpec as Mi, ForeignKeyBuilder as Mn, JsonExpression as Mo, AdapterModelFieldStructure as Mr, FactoryAttributeResolver as Ms, findAppliedMigration as Mt, runArkormTransaction as N, QuerySchemaSelect as Na, SchemaOperation as Nc, UpdateSpec as Ni, SeedCommand as Nn, avg as No, AdapterModelIntrospectionOptions as Nr, FactoryAttributes as Ns, getLastMigrationRun as Nt, isDelegateLike as O, QuerySchemaFindManyArgs as Oa, SchemaColumn as Oc, RelationLoadSpec as Oi, EnumBuilder as On, AggregateExpression as Oo, AdapterCapabilities as Or, JoinClause as Os, buildMigrationRunId as Ot, PrimaryKeyGenerationPlanner as P, QuerySchemaUniqueWhere as Pa, SchemaPrimaryKey as Pc, UpsertSpec as Pi, ModelsSyncCommand as Pn, caseWhen as Po, AdapterModelStructure as Pr, FactoryCallback as Ps, getLatestAppliedMigrations as Pt, buildPrimaryKeyLine as Q, QueryBuilder as Qa, DelegateSelect as Qi, RuntimeConstructor as Qn, MorphToRelation as Qo, QueryCondition as Qr, NullCheckExpressionNode as Qs, deletePersistedColumnMappingsState as Qt, applyAlterTableOperation as R, RawSelectInput as Ra, SchemaUniqueConstraint as Rc, ArkormConfig as Ri, MigrateCommand as Rn, expressionBuilder as Ro, AggregateSelection as Rr, FactoryRelationshipResolver as Rs, readAppliedMigrationsState as Rt, getRuntimeClient as S, PrismaLikeWhereInput as Sa, GeneratedMigrationFile as Sc, QueryTarget as Si, ArkormErrorContext as Sn, ModelUpdateData as So, PrismaDatabaseAdapter as Sr, EagerLoadRelations as Ss, supportsDatabaseCreation as St, getRuntimePaginationURLDriverFactory as T, PrismaTransactionContext as Ta, PrimaryKeyGeneration as Tc, RelationAggregateSpec as Ti, MIGRATION_BRAND as Tn, QuerySchemaForModelInstance as To, createPrismaDatabaseAdapter as Tr, RelatedModelForRelationship as Ts, toMigrationFileSlug as Tt, applyMigrationToDatabase as U, TransactionCallback as Ua, CastMap as Ui, InitCommand as Un, min as Uo, DatabaseRows as Ur, CaseExpressionBranch as Us, writeAppliedMigrationsState as Ut, applyMigrationRollbackToDatabase as V, SimplePaginationMeta as Va, TimestampNaming as Vc, CastDefinition as Vi, MakeMigrationCommand as Vn, json as Vo, DatabasePrimitive as Vr, AggregateExpressionNode as Vs, resolveMigrationStateFilePath as Vt, applyMigrationToPrismaSchema as W, TransactionCapableClient as Wa, CastType as Wi, CliApp as Wn, raw as Wo, DatabaseValue as Wr, CaseExpressionNode as Ws, writeAppliedMigrationsStateToStore as Wt, buildMigrationSource as X, GroupByAggregateRow as Xa, DelegateRow as Xi, RegisteredFactory as Xn, defineFactory as Xo, QueryComparisonCondition as Xr, InExpressionNode as Xs, applyOperationsToPersistedColumnMappingsState as Xt, buildInverseRelationLine as Y, ExpressionSelectMap as Ya, DelegateOrderBy as Yi, Arkormx as Yn, ModelFactory as Yo, QueryColumnComparisonCondition as Yr, FunctionExpressionNode as Ys, PersistedTimestampColumn as Yt, buildModelBlock as Z, GroupByAggregateSpec as Za, DelegateRows as Zi, RegisteredModel as Zn, SetBasedEagerLoader as Zo, QueryComparisonOperator as Zr, JsonExpressionNode as Zs, createEmptyPersistedColumnMappingsState as Zt, ensureArkormConfigLoading as _, PrismaLikeInclude as _a, RelationMetadataType as _c, QueryNotCondition as _i, QueryExecutionException as _n, ModelEventName as _o, SEEDER_BRAND as _r, RelationDefaultValue as _s, resolveMigrationClassName as _t, getRuntimeCompatibilityAdapter as a, GetUserConfig as aa, ColumnMap as ac, QueryJoin as ai, readPersistedColumnMappingsState as an, AttributeWhereInput as ao, getRegisteredPaths as ar, HasManyRelation as as, deriveRelationFieldName as at, getDefaultStubsPath as b, PrismaLikeSelect as ba, AppliedMigrationsState as bc, QueryScalarComparisonOperator as bi, ModelNotFoundException as bn, ModelRelationshipKey as bo, SeederConstructor as br, RelationResultCache as bs, runPrismaCommand as bt, PrismaDelegateMap as c, NamingCase as ca, HasOneRelationMetadata as cc, QueryJoinConstraint as ci, resolveColumnMappingsFilePath as cn, ModelAttributeValue as co, loadMigrationsFrom as cr, BelongsToManyRelation as cs, findEnumBlock as ct, inferDelegateName as d, PaginationOptions as da, MorphManyRelationMetadata as dc, QueryJoinRawConstraint as di, validatePersistedMetadataFeaturesForMigrations as dn, ModelCreateData as do, registerFactories as dr, RelationAggregateConstraint as ds, formatEnumDefaultValue as dt, DelegateUpdateArgs as ea, ValueExpressionNode as ec, QueryExistsCondition as ei, getPersistedEnumMap as en, AttributeOrderBy as eo, RuntimePathKey as er, MorphOneRelation as es, buildUniqueConstraintLine as et, awaitConfiguredModelsRegistration as f, PaginationURLDriver as fa, MorphOneRelationMetadata as fc, QueryJoinType as fi, writePersistedColumnMappingsState as fn, ModelDeclaredAttributeKey as fo, registerMigrations as fr, RelationAggregateInput as fs, formatRelationAction as ft, emitRuntimeDebugEvent as g, PrismaFindManyArgsLike as ga, RelationMetadata as gc, QueryLogicalOperator as gi, RelationResolutionException as gn, ModelEventListener as go, resetRuntimeRegistryForTests as gr, RelationDefaultResolver as gs, resolveEnumName as gt, defineConfig as h, PrismaDelegateLike as ha, PivotModelStatic as hc, QueryJsonConditionKind as hi, ScopeNotDefinedException as hn, ModelEventHandlerConstructor as ho, registerSeeders as hr, RelationConstraint as hs, pad as ht, RuntimeModuleLoader as i, EagerLoadMap as ia, BelongsToRelationMetadata as ic, QueryGroupCondition as ii, getPersistedTimestampColumns as in, AttributeUpdateInput as io, getRegisteredModels as ir, HasManyThroughRelation as is, deriveRelationAlias as it, loadArkormConfig as j, QuerySchemaRow as ja, SchemaForeignKeyAction as jc, SortDirection as ji, resolveGeneratedExpression as jn, ExpressionBuilder as jo, AdapterInspectionRequest as jr, ArkormCollection as js, deleteAppliedMigrationsStateFromStore as jt, isQuerySchemaLike as k, QuerySchemaInclude as ka, SchemaColumnType as kc, SelectSpec as ki, TableBuilder as kn, CaseExpression as ko, AdapterCapability as kr, LengthAwarePaginator as ks, computeMigrationChecksum as kt, createPrismaAdapter as l, PaginationCurrentPageResolver as la, HasOneThroughRelationMetadata as lc, QueryJoinNestedConstraint as li, resolvePersistedMetadataFeatures as ln, ModelAttributes as lo, loadModelsFrom as lr, Relation as ls, findModelBlock as lt, configureArkormRuntime as m, PrismaClientLike as ma, MorphToRelationMetadata as mc, QueryJsonCondition as mi, UniqueConstraintResolutionException as mn, ModelEventHandler as mo, registerPaths as mr, RelationColumnLookupSpec as ms, getMigrationPlan as mt, PivotModel as n, DelegateWhere as na, DatabaseTablePersistedMetadataOptions as nc, QueryFullTextCondition as ni, getPersistedPrimaryKeyGeneration as nn, AttributeSchemaDelegate as no, getRegisteredFactories as nr, HasOneThroughRelation as ns, deriveCollectionFieldName as nt, resolveRuntimeCompatibilityQuerySchema as o, ModelQuerySchemaLike as oa, HasManyRelationMetadata as oc, QueryJoinBoolean as oi, rebuildPersistedColumnMappingsState as on, DelegateForModelSchema as oo, getRegisteredSeeders as or, BelongsToRelation as os, deriveSingularFieldName as ot, bindAdapterToModels as p, PaginationURLDriverFactory as pa, MorphToManyRelationMetadata as pc, QueryJoinValueConstraint as pi, UnsupportedAdapterFeatureException as pn, ModelEventDispatcher as po, registerModels as pr, RelationAggregateType as ps, generateMigrationFile as pt, buildFieldLine as q, ModelStatic as qa, DelegateFindManyArgs as qi, AttributeOptions as qn, where as qo, InsertManySpec as qr, ExpressionJsonCast as qs, PersistedPrimaryKeyGeneration as qt, LoadedRuntimeModule as r, EagerLoadConstraint as ra, BelongsToManyRelationMetadata as rc, QueryGroupByItem as ri, getPersistedTableMetadata as rn, AttributeSelect as ro, getRegisteredMigrations as rr, HasOneRelation as rs, deriveInverseRelationAlias as rt, resolveRuntimeCompatibilityQuerySchemaOrThrow as s, ModelTableCase as sa, HasManyThroughRelationMetadata as sc, QueryJoinColumnConstraint as si, resetPersistedColumnMappingsCache as sn, GlobalScope as so, loadFactoriesFrom as sr, SingleResultRelation as ss, escapeRegex as st, URLDriver as t, DelegateUpdateData as ta, DatabaseTableOptions as tc, QueryExpressionCondition as ti, getPersistedEnumTsType as tn, AttributeQuerySchema as to, RuntimePathMap as tr, MorphManyRelation as ts, createMigrationTimestamp as tt, createPrismaDelegateMap as u, PaginationMeta as ua, ModelMetadata as uc, QueryJoinNullConstraint as ui, syncPersistedColumnMappingsFromState as un, ModelAttributesOf as uo, loadSeedersFrom as ur, RelationTableLoader as us, formatDefaultValue as ut, getActiveTransactionAdapter as v, PrismaLikeOrderBy as va, AppliedMigrationEntry as vc, QueryOrderBy as vi, QueryExecutionExceptionContext as vn, ModelLifecycleState as vo, Seeder as vr, RelationMetadataProvider as vs, resolvePrismaType as vt, getRuntimePaginationCurrentPageResolver as w, PrismaTransactionCapableClient as wa, MigrationInstanceLike as wc, RawQuerySpec as wi, DB as wn, QuerySchemaForModel as wo, createPrismaCompatibilityAdapter as wr, JoinSource as ws, supportsDatabaseReset as wt, getRuntimeAdapter as x, PrismaLikeSortOrder as xa, GenerateMigrationOptions as xc, QuerySelectColumn as xi, MissingDelegateException as xn, ModelRelationshipResult as xo, SeederInput as xr, RelationTableLookupSpec as xs, stripPrismaSchemaModelsAndEnums as xt, getActiveTransactionClient as y, PrismaLikeScalarFilter as ya, AppliedMigrationRun as yc, QueryRawCondition as yi, QueryConstraintException as yn, ModelOrderByInput as yo, SeederCallArgument as yr, RelationResult as ys, runMigrationWithPrisma as yt, applyCreateTableOperation as z, RuntimeClientLike as za, TimestampColumnBehavior as zc, ArkormDebugEvent as zi, MakeSeederCommand as zn, fn as zo, AggregateSpec as zr, FactoryState as zs, readAppliedMigrationsStateFromStore as zt };
|
|
8512
|
+
export { buildPrimaryKeyLine as $, EachCallback as $a, DelegateRow as $i, RegisteredFactory as $n, InlineFactory as $o, QueryComparisonCondition as $r, ExpressionNode as $s, createEmptyPersistedColumnMappingsState as $t, isQuerySchemaLike as A, QuerySchemaCreateData as Aa, PrimaryKeyGeneration as Ac, RelationLoadPlan as Ai, EnumBuilder as An, QuerySchemaForModelInstance as Ao, createKyselyAdapter as Ar, RelatedModelForRelationship as As, computeMigrationChecksum as At, applyCreateTableOperation as B, QuerySchemaWhere as Ba, SchemaTableAlterOperation as Bc, ArkormBootContext as Bi, MigrateCommand as Bn, coalesce as Bo, AggregateOperation as Br, FactoryDefinition as Bs, readAppliedMigrationsState as Bt, getRuntimeClient as C, PrismaLikeSelect as Ca, AppliedMigrationEntry as Cc, QueryScalarComparisonOperator as Ci, MissingDelegateException as Cn, ModelLifecycleState as Co, SeederConstructor as Cr, RelationMetadataProvider as Cs, supportsDatabaseCreation as Ct, getRuntimePrismaClient as D, PrismaTransactionCapableClient as Da, GeneratedMigrationFile as Dc, RawQuerySpec as Di, MIGRATION_BRAND as Dn, ModelUpdateData as Do, createPrismaCompatibilityAdapter as Dr, EagerLoadRelations as Ds, toModelName as Dt, getRuntimePaginationURLDriverFactory as E, PrismaTransactionCallback as Ea, GenerateMigrationOptions as Ec, QueryTimeCondition as Ei, DB as En, ModelRelationshipResult as Eo, PrismaDelegateNameMapping as Er, RelationTableLookupSpec as Es, toMigrationFileSlug as Et, PrimaryKeyGenerationPlanner as F, QuerySchemaRows as Fa, SchemaForeignKey as Fc, UpdateManySpec as Fi, SeedCommand as Fn, Expression as Fo, AdapterModelFieldStructure as Fr, Paginator as Fs, getLastMigrationRun as Ft, applyMigrationToPrismaSchema as G, SoftDeleteConfig as Ga, TimestampNames as Gc, CastHandler as Gi, InitCommand as Gn, fromExpressionNode as Go, DatabaseRow as Gr, MaybePromise as Gs, writeAppliedMigrationsState as Gt, applyMigrationRollbackToDatabase as H, RuntimeClientLike as Ha, SchemaTableDropOperation as Hc, ArkormDebugEvent as Hi, MakeModelCommand as Hn, count as Ho, AggregateSpec as Hr, FactoryModelConstructor as Hs, removeAppliedMigration as Ht, PRISMA_ENUM_MEMBER_REGEX as I, QuerySchemaSelect as Ia, SchemaForeignKeyAction as Ic, UpdateSpec as Ii, ModelsSyncCommand as In, ExpressionBuilder as Io, AdapterModelIntrospectionOptions as Ir, ArkormCollection as Is, getLatestAppliedMigrations as It, buildFieldLine as J, TransactionContext as Ja, ClientResolver as Ji, resolveCast as Jn, min as Jo, DeleteManySpec as Jr, CaseExpressionBranch as Js, PersistedMetadataFeatures as Jt, applyOperationsToPrismaSchema as K, TransactionCallback as Ka, TimestampNaming as Kc, CastMap as Ki, DbCommand as Kn, json as Ko, DatabaseRows as Kr, AggregateExpressionNode as Ks, writeAppliedMigrationsStateToStore as Kt, PRISMA_ENUM_REGEX as L, QuerySchemaUniqueWhere as La, SchemaIndex as Lc, UpsertSpec as Li, MigrationHistoryCommand as Ln, JsonExpression as Lo, AdapterModelStructure as Lr, FactoryAttributeResolver as Ls, isMigrationApplied as Lt, loadArkormConfig as M, QuerySchemaInclude as Ma, PrismaSchemaSyncOptions as Mc, SelectSpec as Mi, GeneratedColumnExpression as Mn, Model as Mo, AdapterCapability as Mr, WhereCallback as Ms, deleteAppliedMigrationsStateFromStore as Mt, resetArkormRuntimeForTests as N, QuerySchemaOrderBy as Na, SchemaColumn as Nc, SoftDeleteQueryMode as Ni, resolveGeneratedExpression as Nn, AggregateExpression as No, AdapterDatabaseCreationResult as Nr, JoinClause as Ns, findAppliedMigration as Nt, getUserConfig as O, PrismaTransactionContext as Oa, MigrationClass as Oc, RelationAggregateSpec as Oi, Migration as On, ModelWhereInput as Oo, createPrismaDatabaseAdapter as Or, JoinOn as Os, buildMigrationIdentity as Ot, runArkormTransaction as P, QuerySchemaRow as Pa, SchemaColumnType as Pc, SortDirection as Pi, ForeignKeyBuilder as Pn, CaseExpression as Po, AdapterInspectionRequest as Pr, LengthAwarePaginator as Ps, getLastBatchMigrations as Pt, buildModelBlock as Q, ChunkCallback as Qa, DelegateOrderBy as Qi, Arkormx as Qn, where as Qo, QueryColumnComparisonCondition as Qr, ExpressionJsonCast as Qs, applyOperationsToPersistedColumnMappingsState as Qt, PRISMA_MODEL_REGEX as R, QuerySchemaUpdateArgs as Ra, SchemaOperation as Rc, AdapterBindableModel as Ri, MigrateRollbackCommand as Rn, avg as Ro, AdapterQueryOperation as Rr, FactoryAttributes as Rs, markMigrationApplied as Rt, getRuntimeAdapter as S, PrismaLikeScalarFilter as Sa, RelationMetadataType as Sc, QueryRawCondition as Si, ModelNotFoundException as Sn, ModelEventName as So, SeederCallArgument as Sr, RelationDefaultValue as Ss, stripPrismaSchemaModelsAndEnums as St, getRuntimePaginationCurrentPageResolver as T, PrismaLikeWhereInput as Ta, AppliedMigrationsState as Tc, QueryTarget as Ti, ArkormException as Tn, ModelRelationshipKey as To, PrismaDatabaseAdapter as Tr, RelationResultCache as Ts, supportsDatabaseReset as Tt, applyMigrationRollbackToPrismaSchema as U, Serializable as Ua, SchemaUniqueConstraint as Uc, ArkormDebugHandler as Ui, MakeMigrationCommand as Un, expressionBuilder as Uo, DatabaseAdapter as Ur, FactoryRelationshipResolver as Us, resolveMigrationStateFilePath as Ut, applyDropTableOperation as V, RawSelectInput as Va, SchemaTableCreateOperation as Vc, ArkormConfig as Vi, MakeSeederCommand as Vn, col as Vo, AggregateSelection as Vr, FactoryDefinitionAttributes as Vs, readAppliedMigrationsStateFromStore as Vt, applyMigrationToDatabase as W, SimplePaginationMeta as Wa, TimestampColumnBehavior as Wc, CastDefinition as Wi, MakeFactoryCommand as Wn, fn as Wo, DatabasePrimitive as Wr, FactoryState as Ws, supportsDatabaseMigrationState as Wt, buildInverseRelationLine as X, ModelStatic as Xa, DelegateFindManyArgs as Xi, AttributeOptions as Xn, sum as Xo, InsertManySpec as Xr, ColumnExpressionNode as Xs, PersistedTableMetadata as Xt, buildIndexLine as Y, TransactionOptions as Ya, DelegateCreateData as Yi, Attribute as Yn, raw as Yo, DeleteSpec as Yr, CaseExpressionNode as Ys, PersistedPrimaryKeyGeneration as Yt, buildMigrationSource as Z, RelationshipModelStatic as Za, DelegateInclude as Zi, Arkorm as Zn, val as Zo, InsertSpec as Zr, ExpressionBinaryOperator as Zs, PersistedTimestampColumn as Zt, emitRuntimeDebugEvent as _, PrismaClientLike as _a, MorphOneRelationMetadata as _c, QueryJsonCondition as _i, ScopeNotDefinedException as _n, ModelDeclaredAttributeKey as _o, registerPaths as _r, RelationAggregateInput as _s, resolveEnumName as _t, getRuntimeCompatibilityAdapter as a, DelegateWhere as aa, ValueExpressionNode as ac, QueryFullTextCondition as ai, getPersistedTableMetadata as an, AttributeOrderBy as ao, getRegisteredFactories as ar, MorphOneRelation as as, deriveRelationAlias as at, getActiveTransactionClient as b, PrismaLikeInclude as ba, PivotModelStatic as bc, QueryNotCondition as bi, QueryExecutionExceptionContext as bn, ModelEventHandlerConstructor as bo, SEEDER_BRAND as br, RelationConstraint as bs, runMigrationWithPrisma as bt, PrismaDelegateMap as c, GetUserConfig as ca, BelongsToManyRelationMetadata as cc, QueryJoin as ci, rebuildPersistedColumnMappingsState as cn, AttributeSelect as co, getRegisteredPaths as cr, HasOneRelation as cs, escapeRegex as ct, inferDelegateName as d, NamingCase as da, HasManyRelationMetadata as dc, QueryJoinConstraint as di, resolvePersistedMetadataFeatures as dn, DelegateForModelSchema as do, loadMigrationsFrom as dr, BelongsToRelation as ds, formatDefaultValue as dt, DelegateRows as ea, FunctionExpressionNode as ec, QueryComparisonOperator as ei, deletePersistedColumnMappingsState as en, ExpressionSelectMap as eo, RegisteredModel as er, ModelFactory as es, buildRelationLine as et, awaitConfiguredModelsRegistration as f, PaginationCurrentPageResolver as fa, HasManyThroughRelationMetadata as fc, QueryJoinNestedConstraint as fi, syncPersistedColumnMappingsFromState as fn, GlobalScope as fo, loadModelsFrom as fr, SingleResultRelation as fs, formatEnumDefaultValue as ft, disposeArkormRuntime as g, PaginationURLDriverFactory as ga, MorphManyRelationMetadata as gc, QueryJoinValueConstraint as gi, UniqueConstraintResolutionException as gn, ModelCreateData as go, registerModels as gr, RelationAggregateConstraint as gs, pad as gt, defineConfig as h, PaginationURLDriver as ha, ModelMetadata as hc, QueryJoinType as hi, UnsupportedAdapterFeatureException as hn, ModelAttributesOf as ho, registerMigrations as hr, RelationTableLoader as hs, getMigrationPlan as ht, RuntimeModuleLoader as i, DelegateUpdateData as ia, RawExpressionNode as ic, QueryExpressionCondition as ii, getPersistedPrimaryKeyGeneration as in, AttributeCreateInput as io, RuntimePathMap as ir, MorphToManyRelation as is, deriveInverseRelationAlias as it, isTransactionCapableClient as j, QuerySchemaFindManyArgs as ja, PrismaMigrationWorkflowOptions as jc, RelationLoadSpec as ji, TableBuilder as jn, RelatedModelClass as jo, AdapterCapabilities as jr, RelatedModelFromResult as js, createEmptyAppliedMigrationsState as jt, isDelegateLike as k, PrismaTransactionOptions as ka, MigrationInstanceLike as kc, RelationFilterSpec as ki, SchemaBuilder as kn, QuerySchemaForModel as ko, KyselyDatabaseAdapter as kr, JoinSource as ks, buildMigrationRunId as kt, createPrismaAdapter as l, ModelQuerySchemaLike as la, BelongsToRelationMetadata as lc, QueryJoinBoolean as li, resetPersistedColumnMappingsCache as ln, AttributeUpdateInput as lo, getRegisteredSeeders as lr, HasManyThroughRelation as ls, findEnumBlock as lt, configureArkormRuntime as m, PaginationOptions as ma, HasOneThroughRelationMetadata as mc, QueryJoinRawConstraint as mi, writePersistedColumnMappingsState as mn, ModelAttributes as mo, registerFactories as mr, Relation as ms, generateMigrationFile as mt, PivotModel as n, DelegateUniqueWhere as na, JsonExpressionNode as nc, QueryDayCondition as ni, getPersistedEnumMap as nn, GroupByAggregateSpec as no, RuntimePathInput as nr, SetBasedEagerLoader as ns, createMigrationTimestamp as nt, resolveRuntimeCompatibilityQuerySchema as o, EagerLoadConstraint as oa, DatabaseTableOptions as oc, QueryGroupByItem as oi, getPersistedTimestampColumns as on, AttributeQuerySchema as oo, getRegisteredMigrations as or, MorphManyRelation as os, deriveRelationFieldName as ot, bindAdapterToModels as p, PaginationMeta as pa, HasOneRelationMetadata as pc, QueryJoinNullConstraint as pi, validatePersistedMetadataFeaturesForMigrations as pn, ModelAttributeValue as po, loadSeedersFrom as pr, BelongsToManyRelation as ps, formatRelationAction as pt, buildEnumBlock as q, TransactionCapableClient as qa, CastType as qi, CliApp as qn, max as qo, DatabaseValue as qr, BinaryExpressionNode as qs, PersistedColumnMappingsState as qt, LoadedRuntimeModule as r, DelegateUpdateArgs as ra, NullCheckExpressionNode as rc, QueryExistsCondition as ri, getPersistedEnumTsType as rn, QueryBuilder as ro, RuntimePathKey as rr, MorphToRelation as rs, deriveCollectionFieldName as rt, resolveRuntimeCompatibilityQuerySchemaOrThrow as s, EagerLoadMap as sa, DatabaseTablePersistedMetadataOptions as sc, QueryGroupCondition as si, readPersistedColumnMappingsState as sn, AttributeSchemaDelegate as so, getRegisteredModels as sr, HasOneThroughRelation as ss, deriveSingularFieldName as st, URLDriver as t, DelegateSelect as ta, InExpressionNode as tc, QueryCondition as ti, getPersistedColumnMap as tn, GroupByAggregateRow as to, RuntimeConstructor as tr, defineFactory as ts, buildUniqueConstraintLine as tt, createPrismaDelegateMap as u, ModelTableCase as ua, ColumnMap as uc, QueryJoinColumnConstraint as ui, resolveColumnMappingsFilePath as un, AttributeWhereInput as uo, loadFactoriesFrom as ur, HasManyRelation as us, findModelBlock as ut, ensureArkormConfigLoading as v, PrismaDelegateLike as va, MorphToManyRelationMetadata as vc, QueryJsonConditionKind as vi, RelationResolutionException as vn, ModelEventDispatcher as vo, registerSeeders as vr, RelationAggregateType as vs, resolveMigrationClassName as vt, getRuntimeDebugHandler as w, PrismaLikeSortOrder as wa, AppliedMigrationRun as wc, QuerySelectColumn as wi, ArkormErrorContext as wn, ModelOrderByInput as wo, SeederInput as wr, RelationResult as ws, supportsDatabaseMigrationExecution as wt, getDefaultStubsPath as x, PrismaLikeOrderBy as xa, RelationMetadata as xc, QueryOrderBy as xi, QueryConstraintException as xn, ModelEventListener as xo, Seeder as xr, RelationDefaultResolver as xs, runPrismaCommand as xt, getActiveTransactionAdapter as y, PrismaFindManyArgsLike as ya, MorphToRelationMetadata as yc, QueryLogicalOperator as yi, QueryExecutionException as yn, ModelEventHandler as yo, resetRuntimeRegistryForTests as yr, RelationColumnLookupSpec as ys, resolvePrismaType as yt, applyAlterTableOperation as z, QuerySchemaUpdateData as za, SchemaPrimaryKey as zc, AdapterQueryInspection as zi, MigrateFreshCommand as zn, caseWhen as zo, AdapterTransactionContext as zr, FactoryCallback as zs, markMigrationRun as zt };
|