arkormx 2.10.1 → 2.11.0
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 +541 -21
- package/dist/{index-GhBV8Kyw.d.cts → index-DggXDBiD.d.cts} +524 -13
- package/dist/{index-ufenXVzx.d.mts → index-DoqUdah-.d.mts} +524 -13
- package/dist/index.cjs +539 -62
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +520 -63
- 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-CmhzOlEo.mjs → relationship-CP1xbMOa.mjs} +507 -5
- package/dist/{relationship-DGOpcWA0.cjs → relationship-IC-TAFyG.cjs} +626 -4
- package/package.json +1 -1
|
@@ -33,6 +33,13 @@ interface SchemaColumn {
|
|
|
33
33
|
precision?: number;
|
|
34
34
|
/** Number of digits to the right of the decimal point for `decimal` columns. */
|
|
35
35
|
scale?: number;
|
|
36
|
+
/**
|
|
37
|
+
* SQL expression for a database-computed column (`GENERATED ALWAYS AS (…)`).
|
|
38
|
+
* The expression must be immutable and reference only the row's own columns.
|
|
39
|
+
*/
|
|
40
|
+
generatedExpression?: string;
|
|
41
|
+
/** Whether the generated column is `STORED` (Postgres only supports stored). */
|
|
42
|
+
generatedStored?: boolean;
|
|
36
43
|
primaryKeyGeneration?: PrimaryKeyGeneration;
|
|
37
44
|
}
|
|
38
45
|
interface SchemaIndex {
|
|
@@ -70,6 +77,8 @@ interface SchemaTableAlterOperation {
|
|
|
70
77
|
type: 'alterTable';
|
|
71
78
|
table: string;
|
|
72
79
|
addColumns: SchemaColumn[];
|
|
80
|
+
/** Columns whose definition (type, nullability, default, enum values) is being redefined in place. */
|
|
81
|
+
changeColumns?: SchemaColumn[];
|
|
73
82
|
dropColumns: string[];
|
|
74
83
|
addIndexes: SchemaIndex[];
|
|
75
84
|
addForeignKeys: SchemaForeignKey[];
|
|
@@ -106,6 +115,7 @@ interface PrismaMigrationWorkflowOptions extends PrismaSchemaSyncOptions {
|
|
|
106
115
|
type MigrationInstanceLike = {
|
|
107
116
|
up: (...args: any[]) => Promise<void> | void;
|
|
108
117
|
down: (...args: any[]) => Promise<void> | void;
|
|
118
|
+
done?: (direction: 'up' | 'down') => Promise<void> | void;
|
|
109
119
|
};
|
|
110
120
|
interface AppliedMigrationEntry {
|
|
111
121
|
id: string;
|
|
@@ -256,6 +266,81 @@ interface DatabaseTableOptions {
|
|
|
256
266
|
timestampColumns?: TimestampColumnBehavior[];
|
|
257
267
|
}
|
|
258
268
|
//#endregion
|
|
269
|
+
//#region src/types/expression.d.ts
|
|
270
|
+
/**
|
|
271
|
+
* Serializable expression nodes produced by the expression builder (`col`, `val`,
|
|
272
|
+
* `raw`, `caseWhen`, `coalesce`, `json`, aggregate helpers, …).
|
|
273
|
+
*
|
|
274
|
+
* The query builder stays adapter-agnostic: it stores these nodes on the query
|
|
275
|
+
* spec and each {@link DatabaseAdapter} compiles (or rejects) them. Every node is
|
|
276
|
+
* discriminated by its `kind`.
|
|
277
|
+
*/
|
|
278
|
+
type ExpressionBinaryOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'like' | 'ilike' | 'not-like' | 'not-ilike' | 'and' | 'or' | '+' | '-' | '*' | '/';
|
|
279
|
+
type ExpressionJsonCast = 'text' | 'number' | 'boolean';
|
|
280
|
+
interface ColumnExpressionNode {
|
|
281
|
+
kind: 'column';
|
|
282
|
+
/** Logical model attribute, or a joined `table.column` reference. */
|
|
283
|
+
name: string;
|
|
284
|
+
}
|
|
285
|
+
interface ValueExpressionNode {
|
|
286
|
+
kind: 'value';
|
|
287
|
+
value: DatabaseValue;
|
|
288
|
+
}
|
|
289
|
+
interface RawExpressionNode {
|
|
290
|
+
kind: 'raw';
|
|
291
|
+
sql: string;
|
|
292
|
+
bindings: DatabaseValue[];
|
|
293
|
+
}
|
|
294
|
+
interface JsonExpressionNode {
|
|
295
|
+
kind: 'json';
|
|
296
|
+
column: string;
|
|
297
|
+
/** Path segments below the base column (`metadata->billType` => `['billType']`). */
|
|
298
|
+
path: string[];
|
|
299
|
+
/** Optional scalar cast applied to the extracted text value. */
|
|
300
|
+
cast?: ExpressionJsonCast;
|
|
301
|
+
}
|
|
302
|
+
interface CaseExpressionBranch {
|
|
303
|
+
when: ExpressionNode;
|
|
304
|
+
then: ExpressionNode;
|
|
305
|
+
}
|
|
306
|
+
interface CaseExpressionNode {
|
|
307
|
+
kind: 'case';
|
|
308
|
+
cases: CaseExpressionBranch[];
|
|
309
|
+
else?: ExpressionNode;
|
|
310
|
+
}
|
|
311
|
+
interface FunctionExpressionNode {
|
|
312
|
+
kind: 'function';
|
|
313
|
+
name: string;
|
|
314
|
+
args: ExpressionNode[];
|
|
315
|
+
}
|
|
316
|
+
interface BinaryExpressionNode {
|
|
317
|
+
kind: 'binary';
|
|
318
|
+
operator: ExpressionBinaryOperator;
|
|
319
|
+
left: ExpressionNode;
|
|
320
|
+
right: ExpressionNode;
|
|
321
|
+
}
|
|
322
|
+
interface InExpressionNode {
|
|
323
|
+
kind: 'in';
|
|
324
|
+
operand: ExpressionNode;
|
|
325
|
+
values: ExpressionNode[];
|
|
326
|
+
not: boolean;
|
|
327
|
+
}
|
|
328
|
+
interface NullCheckExpressionNode {
|
|
329
|
+
kind: 'null-check';
|
|
330
|
+
operand: ExpressionNode;
|
|
331
|
+
not: boolean;
|
|
332
|
+
}
|
|
333
|
+
interface AggregateExpressionNode {
|
|
334
|
+
kind: 'aggregate';
|
|
335
|
+
fn: AggregateOperation;
|
|
336
|
+
/** Argument expression; omitted for `count(*)`. */
|
|
337
|
+
arg?: ExpressionNode;
|
|
338
|
+
distinct?: boolean;
|
|
339
|
+
/** Boolean-valued predicate compiled to `FILTER (WHERE …)` on Postgres. */
|
|
340
|
+
filter?: ExpressionNode;
|
|
341
|
+
}
|
|
342
|
+
type ExpressionNode = ColumnExpressionNode | ValueExpressionNode | RawExpressionNode | JsonExpressionNode | CaseExpressionNode | FunctionExpressionNode | BinaryExpressionNode | InExpressionNode | NullCheckExpressionNode | AggregateExpressionNode;
|
|
343
|
+
//#endregion
|
|
259
344
|
//#region src/types/factories.d.ts
|
|
260
345
|
type FactoryAttributes = Record<string, unknown>;
|
|
261
346
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -2321,6 +2406,166 @@ declare class InlineFactory<TModel, TAttributes extends FactoryAttributes> exten
|
|
|
2321
2406
|
*/
|
|
2322
2407
|
declare const defineFactory: <TModel, TAttributes extends FactoryAttributes = Partial<ModelAttributes<TModel>>>(model: FactoryModelConstructor<TModel>, definition: FactoryDefinition<TAttributes>) => ModelFactory<TModel, TAttributes>;
|
|
2323
2408
|
//#endregion
|
|
2409
|
+
//#region src/Expression.d.ts
|
|
2410
|
+
/**
|
|
2411
|
+
* A composable SQL expression. Instances are immutable — every operator returns a
|
|
2412
|
+
* new expression — and are accepted by `select`, `where`, `groupBy`, `orderBy`,
|
|
2413
|
+
* `having`, and the aggregate helpers. Adapters compile the underlying node tree.
|
|
2414
|
+
*/
|
|
2415
|
+
declare abstract class Expression {
|
|
2416
|
+
/**
|
|
2417
|
+
* Serializes this expression to an adapter-compilable {@link ExpressionNode}.
|
|
2418
|
+
*/
|
|
2419
|
+
abstract toExpressionNode(): ExpressionNode;
|
|
2420
|
+
/**
|
|
2421
|
+
* Type guard for values that came out of the expression builder.
|
|
2422
|
+
*/
|
|
2423
|
+
static isExpression(value: unknown): value is Expression;
|
|
2424
|
+
eq(value: unknown): Expression;
|
|
2425
|
+
ne(value: unknown): Expression;
|
|
2426
|
+
gt(value: unknown): Expression;
|
|
2427
|
+
gte(value: unknown): Expression;
|
|
2428
|
+
lt(value: unknown): Expression;
|
|
2429
|
+
lte(value: unknown): Expression;
|
|
2430
|
+
like(value: unknown): Expression;
|
|
2431
|
+
ilike(value: unknown): Expression;
|
|
2432
|
+
notLike(value: unknown): Expression;
|
|
2433
|
+
notIlike(value: unknown): Expression;
|
|
2434
|
+
in(values: readonly unknown[]): Expression;
|
|
2435
|
+
notIn(values: readonly unknown[]): Expression;
|
|
2436
|
+
isNull(): Expression;
|
|
2437
|
+
isNotNull(): Expression;
|
|
2438
|
+
and(other: Expression): Expression;
|
|
2439
|
+
or(other: Expression): Expression;
|
|
2440
|
+
plus(value: unknown): Expression;
|
|
2441
|
+
minus(value: unknown): Expression;
|
|
2442
|
+
times(value: unknown): Expression;
|
|
2443
|
+
dividedBy(value: unknown): Expression;
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Fluent `CASE … WHEN … THEN … ELSE … END` builder. Immutable.
|
|
2447
|
+
*/
|
|
2448
|
+
declare class CaseExpression extends Expression {
|
|
2449
|
+
private readonly branches;
|
|
2450
|
+
private readonly elseExpr?;
|
|
2451
|
+
constructor(branches: CaseBranch[], elseExpr?: Expression | undefined);
|
|
2452
|
+
when(condition: Expression, result: unknown): CaseExpression;
|
|
2453
|
+
else(result: unknown): CaseExpression;
|
|
2454
|
+
toExpressionNode(): ExpressionNode;
|
|
2455
|
+
}
|
|
2456
|
+
interface CaseBranch {
|
|
2457
|
+
when: Expression;
|
|
2458
|
+
then: Expression;
|
|
2459
|
+
}
|
|
2460
|
+
/**
|
|
2461
|
+
* JSON-path value extraction (`metadata ->> 'billType'`), with optional casts.
|
|
2462
|
+
*/
|
|
2463
|
+
declare class JsonExpression extends Expression {
|
|
2464
|
+
private readonly column;
|
|
2465
|
+
private readonly path;
|
|
2466
|
+
private readonly castTo?;
|
|
2467
|
+
constructor(column: string, path: string[], castTo?: ExpressionJsonCast | undefined);
|
|
2468
|
+
asText(): JsonExpression;
|
|
2469
|
+
asNumber(): JsonExpression;
|
|
2470
|
+
asBoolean(): JsonExpression;
|
|
2471
|
+
toExpressionNode(): ExpressionNode;
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* Aggregate expression (`sum`, `count`, `avg`, `min`, `max`) with optional filter.
|
|
2475
|
+
*/
|
|
2476
|
+
declare class AggregateExpression extends Expression {
|
|
2477
|
+
private readonly fn;
|
|
2478
|
+
private readonly arg?;
|
|
2479
|
+
private readonly options;
|
|
2480
|
+
constructor(fn: AggregateOperation, arg?: Expression | undefined, options?: {
|
|
2481
|
+
distinct?: boolean;
|
|
2482
|
+
filterExpr?: Expression;
|
|
2483
|
+
});
|
|
2484
|
+
/**
|
|
2485
|
+
* Restricts the aggregate to rows matching `predicate` (`FILTER (WHERE …)`).
|
|
2486
|
+
*/
|
|
2487
|
+
filter(predicate: Expression): AggregateExpression;
|
|
2488
|
+
distinct(): AggregateExpression;
|
|
2489
|
+
toExpressionNode(): ExpressionNode;
|
|
2490
|
+
}
|
|
2491
|
+
/**
|
|
2492
|
+
* Rebuilds an {@link Expression} around an already-serialized node.
|
|
2493
|
+
*/
|
|
2494
|
+
declare const fromExpressionNode: (node: ExpressionNode) => Expression;
|
|
2495
|
+
/**
|
|
2496
|
+
* A typed column reference. Supports joined `table.column` syntax.
|
|
2497
|
+
*/
|
|
2498
|
+
declare const col: (name: string) => Expression;
|
|
2499
|
+
/**
|
|
2500
|
+
* A bound literal value (parameterized, never interpolated).
|
|
2501
|
+
*/
|
|
2502
|
+
declare const val: (value: DatabaseValue) => Expression;
|
|
2503
|
+
/**
|
|
2504
|
+
* Raw SQL escape hatch with positional `?` bindings.
|
|
2505
|
+
*/
|
|
2506
|
+
declare const raw: (sql: string, bindings?: DatabaseValue[]) => Expression;
|
|
2507
|
+
/**
|
|
2508
|
+
* Starts a `CASE WHEN condition THEN result` expression.
|
|
2509
|
+
*/
|
|
2510
|
+
declare const caseWhen: (condition: Expression, result: unknown) => CaseExpression;
|
|
2511
|
+
/**
|
|
2512
|
+
* `COALESCE(a, b, …)` — first non-null argument. Bare strings are columns.
|
|
2513
|
+
*/
|
|
2514
|
+
declare const coalesce: (...args: unknown[]) => Expression;
|
|
2515
|
+
/**
|
|
2516
|
+
* An arbitrary SQL function call. Bare-string arguments are treated as columns.
|
|
2517
|
+
*/
|
|
2518
|
+
declare const fn: (name: string, ...args: unknown[]) => Expression;
|
|
2519
|
+
/**
|
|
2520
|
+
* JSON value extraction: `json('metadata', 'billType')` => `metadata ->> 'billType'`.
|
|
2521
|
+
*/
|
|
2522
|
+
declare const json: (column: string, ...path: Array<string | number>) => JsonExpression;
|
|
2523
|
+
/**
|
|
2524
|
+
* `SUM(expr)`; a bare-string argument is treated as a column.
|
|
2525
|
+
*/
|
|
2526
|
+
declare const sum: (arg: unknown) => AggregateExpression;
|
|
2527
|
+
/**
|
|
2528
|
+
* `AVG(expr)`; a bare-string argument is treated as a column.
|
|
2529
|
+
*/
|
|
2530
|
+
declare const avg: (arg: unknown) => AggregateExpression;
|
|
2531
|
+
/**
|
|
2532
|
+
* `MIN(expr)`; a bare-string argument is treated as a column.
|
|
2533
|
+
*/
|
|
2534
|
+
declare const min: (arg: unknown) => AggregateExpression;
|
|
2535
|
+
/**
|
|
2536
|
+
* `MAX(expr)`; a bare-string argument is treated as a column.
|
|
2537
|
+
*/
|
|
2538
|
+
declare const max: (arg: unknown) => AggregateExpression;
|
|
2539
|
+
/**
|
|
2540
|
+
* `COUNT(expr)` — or `COUNT(*)` when called without an argument.
|
|
2541
|
+
*/
|
|
2542
|
+
declare const count: (arg?: unknown) => AggregateExpression;
|
|
2543
|
+
/**
|
|
2544
|
+
* Builds a comparison predicate: `where('createdAt', '>=', boundary)`. Handy as an
|
|
2545
|
+
* inline predicate for `caseWhen`, `having`, and aggregate `.filter(…)`.
|
|
2546
|
+
*/
|
|
2547
|
+
declare const where: (column: string, operator: QueryScalarComparisonOperator | "like" | "ilike" | "not like" | "not ilike" | "<>" | "==", value: unknown) => Expression;
|
|
2548
|
+
/**
|
|
2549
|
+
* The expression-builder namespace passed to `static computed` factories, so a
|
|
2550
|
+
* model can declare a virtual attribute as `category: (e) => e.coalesce(…)`.
|
|
2551
|
+
*/
|
|
2552
|
+
declare const expressionBuilder: {
|
|
2553
|
+
readonly col: (name: string) => Expression;
|
|
2554
|
+
readonly val: (value: DatabaseValue) => Expression;
|
|
2555
|
+
readonly raw: (sql: string, bindings?: DatabaseValue[]) => Expression;
|
|
2556
|
+
readonly caseWhen: (condition: Expression, result: unknown) => CaseExpression;
|
|
2557
|
+
readonly coalesce: (...args: unknown[]) => Expression;
|
|
2558
|
+
readonly fn: (name: string, ...args: unknown[]) => Expression;
|
|
2559
|
+
readonly json: (column: string, ...path: Array<string | number>) => JsonExpression;
|
|
2560
|
+
readonly sum: (arg: unknown) => AggregateExpression;
|
|
2561
|
+
readonly avg: (arg: unknown) => AggregateExpression;
|
|
2562
|
+
readonly min: (arg: unknown) => AggregateExpression;
|
|
2563
|
+
readonly max: (arg: unknown) => AggregateExpression;
|
|
2564
|
+
readonly count: (arg?: unknown) => AggregateExpression;
|
|
2565
|
+
readonly where: (column: string, operator: QueryScalarComparisonOperator | "like" | "ilike" | "not like" | "not ilike" | "<>" | "==", value: unknown) => Expression;
|
|
2566
|
+
};
|
|
2567
|
+
type ExpressionBuilder = typeof expressionBuilder;
|
|
2568
|
+
//#endregion
|
|
2324
2569
|
//#region src/Model.d.ts
|
|
2325
2570
|
/**
|
|
2326
2571
|
* Base model class that all models should extend.
|
|
@@ -2333,6 +2578,7 @@ declare const defineFactory: <TModel, TAttributes extends FactoryAttributes = Pa
|
|
|
2333
2578
|
declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<string, unknown> | string = Record<string, any>, TAttributes extends Record<string, unknown> = ModelAttributesOf<TSchema>> {
|
|
2334
2579
|
private static readonly lifecycleStates;
|
|
2335
2580
|
private static readonly castMapCache;
|
|
2581
|
+
private static readonly computedCache;
|
|
2336
2582
|
private static readonly emittedDeprecationWarnings;
|
|
2337
2583
|
private static eventsSuppressed;
|
|
2338
2584
|
protected static factoryClass?: new () => ModelFactory<any, any>;
|
|
@@ -2352,6 +2598,18 @@ declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<strin
|
|
|
2352
2598
|
protected static softDeletes: boolean;
|
|
2353
2599
|
protected static deletedAtColumn: string;
|
|
2354
2600
|
protected static globalScopes: Record<string, GlobalScope>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Expression-backed virtual attributes. Each factory receives the expression
|
|
2603
|
+
* builder and returns an {@link Expression}; the name may then be used in
|
|
2604
|
+
* `select`, `where`, `groupBy`, `orderBy`, and `having`, and is expanded inline
|
|
2605
|
+
* during query building.
|
|
2606
|
+
*
|
|
2607
|
+
* @example
|
|
2608
|
+
* static computed = {
|
|
2609
|
+
* category: (e) => e.coalesce(e.col('override.category'), e.val('other')),
|
|
2610
|
+
* }
|
|
2611
|
+
*/
|
|
2612
|
+
protected static computed?: Record<string, (builder: ExpressionBuilder) => Expression>;
|
|
2355
2613
|
protected static eventListeners: Partial<Record<ModelEventName, ModelEventListener<any>[]>>;
|
|
2356
2614
|
protected static dispatchesEvents: Partial<Record<ModelEventName, ModelEventDispatcher<any> | ModelEventDispatcher<any>[]>>;
|
|
2357
2615
|
protected casts: CastMap;
|
|
@@ -2400,6 +2658,11 @@ declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<strin
|
|
|
2400
2658
|
* instance field) and cached per model class.
|
|
2401
2659
|
*/
|
|
2402
2660
|
static getCasts(): CastMap;
|
|
2661
|
+
/**
|
|
2662
|
+
* Resolves the model's `static computed` declarations into expression nodes,
|
|
2663
|
+
* cached per class. Returns an empty map when no computed attributes exist.
|
|
2664
|
+
*/
|
|
2665
|
+
static getComputed(): Record<string, ExpressionNode>;
|
|
2403
2666
|
/**
|
|
2404
2667
|
* Apply built-in persistence casts (currently `json` serialisation) to a raw
|
|
2405
2668
|
* attribute payload, without re-running arbitrary custom setters. Used by
|
|
@@ -2632,6 +2895,17 @@ declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<strin
|
|
|
2632
2895
|
*/
|
|
2633
2896
|
fill(attributes: Partial<TAttributes>): this;
|
|
2634
2897
|
fill(attributes: Record<string, unknown>): this;
|
|
2898
|
+
/**
|
|
2899
|
+
* Merge already-stored (database representation) attribute values into the
|
|
2900
|
+
* model without running set mutators or casts. Used to refresh the instance
|
|
2901
|
+
* from a row returned by a write, where the values are already in storage
|
|
2902
|
+
* form and must not be re-cast (re-applying a non-idempotent set-cast such as
|
|
2903
|
+
* a money or array cast would corrupt the value).
|
|
2904
|
+
*
|
|
2905
|
+
* @param attributes
|
|
2906
|
+
* @returns
|
|
2907
|
+
*/
|
|
2908
|
+
protected fillRawAttributes(attributes: Record<string, unknown>): this;
|
|
2635
2909
|
/**
|
|
2636
2910
|
* Update the model's state in the database using data from a plain object.
|
|
2637
2911
|
* If the model has no identifier (id), the process will be skipped and the
|
|
@@ -3232,6 +3506,45 @@ type ModelLifecycleState = {
|
|
|
3232
3506
|
};
|
|
3233
3507
|
//#endregion
|
|
3234
3508
|
//#region src/QueryBuilder.d.ts
|
|
3509
|
+
/** Object select projection whose values may be expressions, columns, or booleans. */
|
|
3510
|
+
type ExpressionSelectMap = Record<string, Expression | boolean | string>;
|
|
3511
|
+
/** Map of model attributes selected for an aggregate (`{ amount: true }`). */
|
|
3512
|
+
type AggregateColumnMap<TModel> = Partial<Record<keyof ModelAttributes<TModel> & string, true>>;
|
|
3513
|
+
/**
|
|
3514
|
+
* Prisma-style grouped-aggregate request: group by `by` columns and compute the
|
|
3515
|
+
* requested `_sum`/`_avg`/`_min`/`_max`/`_count` aggregates per group.
|
|
3516
|
+
*/
|
|
3517
|
+
interface GroupByAggregateSpec<TModel> {
|
|
3518
|
+
by: Array<keyof ModelAttributes<TModel> & string>;
|
|
3519
|
+
_count?: true | AggregateColumnMap<TModel>;
|
|
3520
|
+
_sum?: AggregateColumnMap<TModel>;
|
|
3521
|
+
_avg?: AggregateColumnMap<TModel>;
|
|
3522
|
+
_min?: AggregateColumnMap<TModel>;
|
|
3523
|
+
_max?: AggregateColumnMap<TModel>;
|
|
3524
|
+
}
|
|
3525
|
+
type SameTypeAggregate<TModel, TMap> = { [K in keyof TMap]: K extends keyof ModelAttributes<TModel> ? ModelAttributes<TModel>[K] : unknown };
|
|
3526
|
+
/** The typed plain row returned for a {@link GroupByAggregateSpec} query. */
|
|
3527
|
+
type GroupByAggregateRow<TModel, TSpec extends GroupByAggregateSpec<TModel>> = { [K in TSpec['by'][number]]: K extends keyof ModelAttributes<TModel> ? ModelAttributes<TModel>[K] : unknown } & (TSpec extends {
|
|
3528
|
+
_count: infer C;
|
|
3529
|
+
} ? {
|
|
3530
|
+
_count: C extends AggregateColumnMap<TModel> ? { [K in keyof C]: number } : number;
|
|
3531
|
+
} : object) & (TSpec extends {
|
|
3532
|
+
_sum: infer S;
|
|
3533
|
+
} ? {
|
|
3534
|
+
_sum: { [K in keyof S]: number | null };
|
|
3535
|
+
} : object) & (TSpec extends {
|
|
3536
|
+
_avg: infer A;
|
|
3537
|
+
} ? {
|
|
3538
|
+
_avg: { [K in keyof A]: number | null };
|
|
3539
|
+
} : object) & (TSpec extends {
|
|
3540
|
+
_min: infer M;
|
|
3541
|
+
} ? {
|
|
3542
|
+
_min: SameTypeAggregate<TModel, M>;
|
|
3543
|
+
} : object) & (TSpec extends {
|
|
3544
|
+
_max: infer M;
|
|
3545
|
+
} ? {
|
|
3546
|
+
_max: SameTypeAggregate<TModel, M>;
|
|
3547
|
+
} : object);
|
|
3235
3548
|
/**
|
|
3236
3549
|
* The QueryBuilder class provides a fluent interface for building and
|
|
3237
3550
|
* executing database queries.
|
|
@@ -3280,6 +3593,7 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
3280
3593
|
*/
|
|
3281
3594
|
where(where: QuerySchemaWhere<TDelegate>): this;
|
|
3282
3595
|
where(callback: WhereCallback<TModel, TDelegate>): this;
|
|
3596
|
+
where(expression: Expression): this;
|
|
3283
3597
|
/**
|
|
3284
3598
|
* Adds an OR where clause to the query. Pass a callback to build a
|
|
3285
3599
|
* parenthesized group of nested conditions.
|
|
@@ -3289,6 +3603,13 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
3289
3603
|
*/
|
|
3290
3604
|
orWhere(where: QuerySchemaWhere<TDelegate>): this;
|
|
3291
3605
|
orWhere(callback: WhereCallback<TModel, TDelegate>): this;
|
|
3606
|
+
orWhere(expression: Expression): this;
|
|
3607
|
+
/**
|
|
3608
|
+
* Appends a boolean {@link Expression} as a where predicate. When the query is
|
|
3609
|
+
* using the Prisma-like legacy where representation, the expression is merged in
|
|
3610
|
+
* as a structured condition alongside it.
|
|
3611
|
+
*/
|
|
3612
|
+
private appendExpressionCondition;
|
|
3292
3613
|
/**
|
|
3293
3614
|
* Resolve a callback into a parenthesized group condition and append it.
|
|
3294
3615
|
*/
|
|
@@ -3733,6 +4054,17 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
3733
4054
|
* @returns
|
|
3734
4055
|
*/
|
|
3735
4056
|
orderBy(orderBy: QuerySchemaOrderBy<TDelegate>): this;
|
|
4057
|
+
orderBy(expression: Expression, direction?: 'asc' | 'desc'): this;
|
|
4058
|
+
/**
|
|
4059
|
+
* Appends a raw SQL `order by` fragment (with positional `?` bindings), useful
|
|
4060
|
+
* for ordering by a computed expression the builder does not model directly.
|
|
4061
|
+
*
|
|
4062
|
+
* @param sql
|
|
4063
|
+
* @param bindings
|
|
4064
|
+
* @param direction
|
|
4065
|
+
* @returns
|
|
4066
|
+
*/
|
|
4067
|
+
orderByRaw(sql: string, bindings?: DatabaseValue[], direction?: 'asc' | 'desc'): this;
|
|
3736
4068
|
/**
|
|
3737
4069
|
* Puts the query results in random order.
|
|
3738
4070
|
*
|
|
@@ -3989,6 +4321,7 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
3989
4321
|
* @returns
|
|
3990
4322
|
*/
|
|
3991
4323
|
select(select: QuerySchemaSelect<TDelegate>): this;
|
|
4324
|
+
select(select: Record<string, Expression | boolean | string>): this;
|
|
3992
4325
|
/**
|
|
3993
4326
|
* Appends columns or expressions to the existing select clause.
|
|
3994
4327
|
*
|
|
@@ -3996,6 +4329,7 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
3996
4329
|
* @returns
|
|
3997
4330
|
*/
|
|
3998
4331
|
addSelect(select: QuerySchemaSelect<TDelegate>): this;
|
|
4332
|
+
addSelect(select: Record<string, Expression | boolean | string>): this;
|
|
3999
4333
|
/**
|
|
4000
4334
|
* Apply or remove DISTINCT from the select query.
|
|
4001
4335
|
*
|
|
@@ -4011,8 +4345,48 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4011
4345
|
*/
|
|
4012
4346
|
groupBy<TKey extends keyof ModelAttributes<TModel> & string>(columns: TKey[]): this;
|
|
4013
4347
|
groupBy<TKey extends keyof ModelAttributes<TModel> & string>(...columns: TKey[]): this;
|
|
4348
|
+
groupBy(columns: Array<string | Expression>): this;
|
|
4349
|
+
groupBy(...columns: Array<string | Expression>): this;
|
|
4350
|
+
groupBy<TSpec extends GroupByAggregateSpec<TModel>>(spec: TSpec): Promise<GroupByAggregateRow<TModel, TSpec>[]>;
|
|
4351
|
+
/**
|
|
4352
|
+
* Appends a raw SQL `group by` fragment (with positional `?` bindings), mirroring
|
|
4353
|
+
* `whereRaw`/`havingRaw`. Combines with any columns/expressions already grouped.
|
|
4354
|
+
*
|
|
4355
|
+
* @param sql
|
|
4356
|
+
* @param bindings
|
|
4357
|
+
* @returns
|
|
4358
|
+
*/
|
|
4359
|
+
groupByRaw(sql: string, bindings?: DatabaseValue[]): this;
|
|
4360
|
+
/**
|
|
4361
|
+
* Resolves the recorded group-by sources into adapter {@link QueryGroupByItem}s.
|
|
4362
|
+
* A bare string that matches a select-column alias is expanded to that column's
|
|
4363
|
+
* underlying expression (group-by-alias); otherwise it is treated as a column.
|
|
4364
|
+
*/
|
|
4365
|
+
private buildGroupByItems;
|
|
4366
|
+
private isGroupByAggregateSpec;
|
|
4367
|
+
/**
|
|
4368
|
+
* Executes the query and returns plain, un-hydrated rows keyed by their select
|
|
4369
|
+
* alias — the natural shape for `select` + `groupBy` aggregate reports. Pass a
|
|
4370
|
+
* row type to describe the projection.
|
|
4371
|
+
*
|
|
4372
|
+
* @returns
|
|
4373
|
+
*/
|
|
4374
|
+
getRows<TRow = Record<string, DatabaseValue>>(): Promise<TRow[]>;
|
|
4375
|
+
/**
|
|
4376
|
+
* Runs a Prisma-style grouped aggregate and returns typed rows shaped as
|
|
4377
|
+
* `{ <by columns>, _sum, _avg, _min, _max, _count }`.
|
|
4378
|
+
*/
|
|
4379
|
+
private executeGroupByAggregate;
|
|
4380
|
+
private coerceNumeric;
|
|
4014
4381
|
private appendHavingCondition;
|
|
4015
4382
|
private buildHavingComparison;
|
|
4383
|
+
/**
|
|
4384
|
+
* Resolves the three `having` call shapes into a condition: `having(column, …)`,
|
|
4385
|
+
* `having(expression)` (a boolean expression predicate), and
|
|
4386
|
+
* `having(expression, operator, value)` (compare an aggregate to a value).
|
|
4387
|
+
*/
|
|
4388
|
+
private buildHavingCondition;
|
|
4389
|
+
private compareExpression;
|
|
4016
4390
|
/**
|
|
4017
4391
|
* Adds a HAVING clause to filter grouped rows. Accepts either
|
|
4018
4392
|
* `having(column, value)` (defaulting to equality) or
|
|
@@ -4025,6 +4399,8 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4025
4399
|
*/
|
|
4026
4400
|
having(column: string, value: DatabaseValue): this;
|
|
4027
4401
|
having(column: string, operator: QueryScalarComparisonOperator, value: DatabaseValue): this;
|
|
4402
|
+
having(expression: Expression): this;
|
|
4403
|
+
having(expression: Expression, operator: QueryScalarComparisonOperator, value: DatabaseValue): this;
|
|
4028
4404
|
/**
|
|
4029
4405
|
* Adds an OR HAVING clause to filter grouped rows.
|
|
4030
4406
|
*
|
|
@@ -4035,6 +4411,8 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4035
4411
|
*/
|
|
4036
4412
|
orHaving(column: string, value: DatabaseValue): this;
|
|
4037
4413
|
orHaving(column: string, operator: QueryScalarComparisonOperator, value: DatabaseValue): this;
|
|
4414
|
+
orHaving(expression: Expression): this;
|
|
4415
|
+
orHaving(expression: Expression, operator: QueryScalarComparisonOperator, value: DatabaseValue): this;
|
|
4038
4416
|
/**
|
|
4039
4417
|
* Adds a raw HAVING clause, useful for filtering on aggregate expressions
|
|
4040
4418
|
* such as `count(*)`. Combines with previous HAVING clauses using AND.
|
|
@@ -4621,6 +4999,17 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4621
4999
|
private tryBuildFieldCondition;
|
|
4622
5000
|
private tryBuildQueryCondition;
|
|
4623
5001
|
private tryBuildSelectSpec;
|
|
5002
|
+
/** Reads and caches the model's resolved `static computed` expression map. */
|
|
5003
|
+
private computedAttributes;
|
|
5004
|
+
/**
|
|
5005
|
+
* Expands references to `static computed` attribute names into their backing
|
|
5006
|
+
* expressions across a select spec's columns, group by, order by, where, and
|
|
5007
|
+
* having clauses. A no-op when the model declares no computed attributes.
|
|
5008
|
+
*/
|
|
5009
|
+
private expandComputedAttributes;
|
|
5010
|
+
private expandComputedCondition;
|
|
5011
|
+
/** Converts a where comparison against a computed attribute into an expression. */
|
|
5012
|
+
private computedComparison;
|
|
4624
5013
|
private tryBuildAggregateSpec;
|
|
4625
5014
|
private requireAdapter;
|
|
4626
5015
|
private executeReadRows;
|
|
@@ -5070,7 +5459,7 @@ type DatabasePrimitive = string | number | boolean | bigint | Date | null;
|
|
|
5070
5459
|
type DatabaseValue = DatabasePrimitive | DatabaseRow | DatabaseValue[];
|
|
5071
5460
|
type DatabaseRow = Record<string, unknown>;
|
|
5072
5461
|
type DatabaseRows = DatabaseRow[];
|
|
5073
|
-
type AdapterCapability = 'transactions' | 'returning' | 'insertMany' | 'upsert' | 'updateMany' | 'deleteMany' | 'exists' | 'relationLoads' | 'relationAggregates' | 'relationFilters' | 'rawSelect' | 'rawWhere' | 'distinct' | 'groupBy' | 'joins';
|
|
5462
|
+
type AdapterCapability = 'transactions' | 'returning' | 'insertMany' | 'upsert' | 'updateMany' | 'deleteMany' | 'exists' | 'relationLoads' | 'relationAggregates' | 'relationFilters' | 'rawSelect' | 'rawWhere' | 'distinct' | 'groupBy' | 'joins' | 'expressions';
|
|
5074
5463
|
type AdapterCapabilities = Partial<Record<AdapterCapability, boolean>>;
|
|
5075
5464
|
type QueryLogicalOperator = 'and' | 'or';
|
|
5076
5465
|
type QueryComparisonOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'not-in' | 'contains' | 'starts-with' | 'ends-with' | 'is-null' | 'is-not-null';
|
|
@@ -5094,11 +5483,30 @@ interface QuerySelectColumn {
|
|
|
5094
5483
|
alias?: string;
|
|
5095
5484
|
raw?: boolean;
|
|
5096
5485
|
wildcard?: boolean;
|
|
5486
|
+
/** A compiled expression projected in place of a physical column. */
|
|
5487
|
+
expression?: ExpressionNode;
|
|
5097
5488
|
}
|
|
5098
5489
|
interface QueryOrderBy {
|
|
5099
5490
|
column: string;
|
|
5100
5491
|
direction: SortDirection;
|
|
5492
|
+
/** Orders by a compiled expression instead of a physical column. */
|
|
5493
|
+
expression?: ExpressionNode;
|
|
5101
5494
|
}
|
|
5495
|
+
/**
|
|
5496
|
+
* A `GROUP BY` entry: either a logical column name (string) or a compiled
|
|
5497
|
+
* expression / raw fragment. The query builder resolves select-alias grouping to
|
|
5498
|
+
* the underlying expression before it reaches the adapter.
|
|
5499
|
+
*/
|
|
5500
|
+
type QueryGroupByItem = string | {
|
|
5501
|
+
alias: string;
|
|
5502
|
+
} | {
|
|
5503
|
+
expression: ExpressionNode;
|
|
5504
|
+
} | {
|
|
5505
|
+
raw: {
|
|
5506
|
+
sql: string;
|
|
5507
|
+
bindings?: DatabaseValue[];
|
|
5508
|
+
};
|
|
5509
|
+
};
|
|
5102
5510
|
interface QueryComparisonCondition {
|
|
5103
5511
|
type: 'comparison';
|
|
5104
5512
|
column: string;
|
|
@@ -5165,7 +5573,12 @@ interface RawQuerySpec {
|
|
|
5165
5573
|
sql: string;
|
|
5166
5574
|
bindings?: DatabaseValue[];
|
|
5167
5575
|
}
|
|
5168
|
-
|
|
5576
|
+
/** A boolean-valued expression used directly as a predicate (where / having). */
|
|
5577
|
+
interface QueryExpressionCondition {
|
|
5578
|
+
type: 'expression';
|
|
5579
|
+
expression: ExpressionNode;
|
|
5580
|
+
}
|
|
5581
|
+
type QueryCondition = QueryComparisonCondition | QueryColumnComparisonCondition | QueryTimeCondition | QueryDayCondition | QueryExistsCondition | QueryFullTextCondition | QueryJsonCondition | QueryExpressionCondition | QueryGroupCondition | QueryNotCondition | QueryRawCondition;
|
|
5169
5582
|
interface AggregateSelection {
|
|
5170
5583
|
type: AggregateOperation;
|
|
5171
5584
|
column?: string;
|
|
@@ -5244,7 +5657,7 @@ interface SelectSpec<TModel = unknown> {
|
|
|
5244
5657
|
target: QueryTarget<TModel>;
|
|
5245
5658
|
columns?: QuerySelectColumn[];
|
|
5246
5659
|
distinct?: boolean;
|
|
5247
|
-
groupBy?:
|
|
5660
|
+
groupBy?: QueryGroupByItem[];
|
|
5248
5661
|
having?: QueryCondition;
|
|
5249
5662
|
joins?: QueryJoin[];
|
|
5250
5663
|
where?: QueryCondition;
|
|
@@ -5478,6 +5891,17 @@ declare class KyselyDatabaseAdapter implements DatabaseAdapter {
|
|
|
5478
5891
|
private ensureEnumTypes;
|
|
5479
5892
|
private executeCreateTableOperation;
|
|
5480
5893
|
private executeAlterTableOperation;
|
|
5894
|
+
private enumTypeExists;
|
|
5895
|
+
/**
|
|
5896
|
+
* Redefine an existing column in place using ALTER COLUMN statements: the
|
|
5897
|
+
* column type (recreating the enum type when enum values change), nullability,
|
|
5898
|
+
* default, and a conventionally-named unique constraint.
|
|
5899
|
+
*
|
|
5900
|
+
* @param table
|
|
5901
|
+
* @param column
|
|
5902
|
+
* @param executor
|
|
5903
|
+
*/
|
|
5904
|
+
private executeChangeColumn;
|
|
5481
5905
|
private executeDropTableOperation;
|
|
5482
5906
|
private ensureMigrationStateTables;
|
|
5483
5907
|
private writeAppliedMigrationsStateInternal;
|
|
@@ -5511,6 +5935,22 @@ declare class KyselyDatabaseAdapter implements DatabaseAdapter {
|
|
|
5511
5935
|
private buildFullTextCondition;
|
|
5512
5936
|
private buildJsonAccessor;
|
|
5513
5937
|
private buildJsonCondition;
|
|
5938
|
+
/**
|
|
5939
|
+
* Compiles a serialized {@link ExpressionNode} into a parameterized SQL fragment.
|
|
5940
|
+
* Shared by expression-backed select columns, `group by`, `order by`, and any
|
|
5941
|
+
* boolean expression used as a `where`/`having` predicate.
|
|
5942
|
+
*
|
|
5943
|
+
* @param target
|
|
5944
|
+
* @param node
|
|
5945
|
+
* @returns
|
|
5946
|
+
*/
|
|
5947
|
+
private buildExpression;
|
|
5948
|
+
private buildExpressionColumn;
|
|
5949
|
+
private buildBinaryExpression;
|
|
5950
|
+
private buildAggregateExpression;
|
|
5951
|
+
private buildJsonValueExpression;
|
|
5952
|
+
private buildRawExpressionFragment;
|
|
5953
|
+
private sanitizeFunctionName;
|
|
5514
5954
|
private buildWhereCondition;
|
|
5515
5955
|
private buildWhereClause;
|
|
5516
5956
|
private buildPaginationClause;
|
|
@@ -6451,7 +6891,8 @@ declare class MakeSeederCommand extends Command<CliApp> {
|
|
|
6451
6891
|
//#region src/cli/commands/MigrateCommand.d.ts
|
|
6452
6892
|
/**
|
|
6453
6893
|
* The MigrateCommand class implements the CLI command for applying migration
|
|
6454
|
-
* classes to the Prisma schema and running the Prisma workflow
|
|
6894
|
+
* classes to the database or Prisma schema and running the Prisma workflow when
|
|
6895
|
+
* using the Prisma compatibility driver.
|
|
6455
6896
|
*
|
|
6456
6897
|
* @author Legacy (3m1n3nc3)
|
|
6457
6898
|
* @since 0.1.0
|
|
@@ -6463,8 +6904,8 @@ declare class MigrateCommand extends Command<CliApp> {
|
|
|
6463
6904
|
* Command handler for the migrate command.
|
|
6464
6905
|
* This method is responsible for orchestrating the migration
|
|
6465
6906
|
* process, including loading migration classes, applying them to
|
|
6466
|
-
* the Prisma schema, and running the appropriate Prisma commands
|
|
6467
|
-
* based on the provided options.
|
|
6907
|
+
* the the database or Prisma schema, and running the appropriate Prisma commands
|
|
6908
|
+
* when using the Prisma compatibility driver based on the provided options.
|
|
6468
6909
|
*
|
|
6469
6910
|
* @returns
|
|
6470
6911
|
*/
|
|
@@ -6641,6 +7082,19 @@ declare class ForeignKeyBuilder {
|
|
|
6641
7082
|
as(fieldName: string): this;
|
|
6642
7083
|
}
|
|
6643
7084
|
//#endregion
|
|
7085
|
+
//#region src/helpers/generated-column.d.ts
|
|
7086
|
+
/**
|
|
7087
|
+
* The two ways to declare a generated column's expression: a raw SQL string, or a
|
|
7088
|
+
* factory that builds one with the expression builder.
|
|
7089
|
+
*/
|
|
7090
|
+
type GeneratedColumnExpression = string | ((builder: ExpressionBuilder) => Expression);
|
|
7091
|
+
/**
|
|
7092
|
+
* Resolves a generated-column expression into raw Postgres SQL. Generated columns
|
|
7093
|
+
* cannot carry bind parameters (they must be immutable), so literal values are
|
|
7094
|
+
* inlined and aggregates are rejected.
|
|
7095
|
+
*/
|
|
7096
|
+
declare const resolveGeneratedExpression: (expression: GeneratedColumnExpression) => string;
|
|
7097
|
+
//#endregion
|
|
6644
7098
|
//#region src/database/TableBuilder.d.ts
|
|
6645
7099
|
/**
|
|
6646
7100
|
* The EnumBuilder class provides a fluent interface for configuring enum columns
|
|
@@ -6693,6 +7147,12 @@ declare class EnumBuilder {
|
|
|
6693
7147
|
* @returns
|
|
6694
7148
|
*/
|
|
6695
7149
|
map(name: string): this;
|
|
7150
|
+
/**
|
|
7151
|
+
* Marks the enum column as an in-place change to an existing column.
|
|
7152
|
+
*
|
|
7153
|
+
* @returns
|
|
7154
|
+
*/
|
|
7155
|
+
change(): this;
|
|
6696
7156
|
}
|
|
6697
7157
|
/**
|
|
6698
7158
|
* The TableBuilder class provides a fluent interface for defining
|
|
@@ -6704,6 +7164,7 @@ declare class EnumBuilder {
|
|
|
6704
7164
|
declare class TableBuilder {
|
|
6705
7165
|
private readonly columns;
|
|
6706
7166
|
private readonly dropColumnNames;
|
|
7167
|
+
private readonly changeColumnNames;
|
|
6707
7168
|
private readonly indexes;
|
|
6708
7169
|
private readonly foreignKeys;
|
|
6709
7170
|
private readonly compositeUniqueConstraints;
|
|
@@ -6843,6 +7304,28 @@ declare class TableBuilder {
|
|
|
6843
7304
|
* @returns The current TableBuilder instance for chaining.
|
|
6844
7305
|
*/
|
|
6845
7306
|
dateTime(name: string, options?: Partial<SchemaColumn>): this;
|
|
7307
|
+
/**
|
|
7308
|
+
* Defines a database-computed column (`GENERATED ALWAYS AS (…) STORED`). The
|
|
7309
|
+
* expression may be a raw SQL string or an expression-builder factory, and must
|
|
7310
|
+
* be immutable and reference only the row's own columns. Combine with
|
|
7311
|
+
* {@link index} to index the generated value.
|
|
7312
|
+
*
|
|
7313
|
+
* @example
|
|
7314
|
+
* table.generated('category', "case when metadata->>'kind' = 'a' then 'x' else 'y' end", {
|
|
7315
|
+
* type: 'text',
|
|
7316
|
+
* })
|
|
7317
|
+
* table.generated('total', (e) => e.col('price').times(e.col('quantity')), { type: 'integer' })
|
|
7318
|
+
*
|
|
7319
|
+
* @param name The generated column name.
|
|
7320
|
+
* @param expression The SQL expression string, or a builder factory.
|
|
7321
|
+
* @param options Column type (default `text`), `stored` flag, and nullability.
|
|
7322
|
+
* @returns
|
|
7323
|
+
*/
|
|
7324
|
+
generated(name: string, expression: GeneratedColumnExpression, options?: {
|
|
7325
|
+
type?: SchemaColumnType;
|
|
7326
|
+
stored?: boolean;
|
|
7327
|
+
nullable?: boolean;
|
|
7328
|
+
}): this;
|
|
6846
7329
|
/**
|
|
6847
7330
|
* Defines colonns for a polymorphic relationship in the table.
|
|
6848
7331
|
*
|
|
@@ -6920,6 +7403,20 @@ declare class TableBuilder {
|
|
|
6920
7403
|
* @returns
|
|
6921
7404
|
*/
|
|
6922
7405
|
dropColumn(name: string): this;
|
|
7406
|
+
/**
|
|
7407
|
+
* Marks a (re)defined column as a change to an existing column rather than an
|
|
7408
|
+
* addition. Use it at the end of a normal column chain inside `alterTable` to
|
|
7409
|
+
* redefine the column's type, nullability, default, or enum values in place:
|
|
7410
|
+
*
|
|
7411
|
+
* ```ts
|
|
7412
|
+
* table.string('status').default('active').change()
|
|
7413
|
+
* table.enum('role', ['admin', 'user', 'guest']).change()
|
|
7414
|
+
* ```
|
|
7415
|
+
*
|
|
7416
|
+
* @param columnName Optional explicit column name. When omitted, applies to the latest defined column.
|
|
7417
|
+
* @returns The current TableBuilder instance for chaining.
|
|
7418
|
+
*/
|
|
7419
|
+
change(columnName?: string): this;
|
|
6923
7420
|
/**
|
|
6924
7421
|
* Marks a column as nullable.
|
|
6925
7422
|
*
|
|
@@ -6988,6 +7485,12 @@ declare class TableBuilder {
|
|
|
6988
7485
|
* @returns
|
|
6989
7486
|
*/
|
|
6990
7487
|
getColumns(): SchemaColumn[];
|
|
7488
|
+
/**
|
|
7489
|
+
* Returns a deep copy of the columns flagged for in-place change via `change()`.
|
|
7490
|
+
*
|
|
7491
|
+
* @returns
|
|
7492
|
+
*/
|
|
7493
|
+
getChangeColumns(): SchemaColumn[];
|
|
6991
7494
|
/**
|
|
6992
7495
|
* Returns a copy of the defined column names to be dropped from the table.
|
|
6993
7496
|
*
|
|
@@ -7141,6 +7644,14 @@ declare abstract class Migration {
|
|
|
7141
7644
|
* @param schema A SchemaBuilder instance.
|
|
7142
7645
|
*/
|
|
7143
7646
|
abstract down(schema: SchemaBuilder): Promise<void> | void;
|
|
7647
|
+
/**
|
|
7648
|
+
* Optional lifecycle hook invoked after the migration's schema operations
|
|
7649
|
+
* have been applied to the database, for either direction. Override it to run
|
|
7650
|
+
* extra logic such as seeding or data backfills once the schema is in place.
|
|
7651
|
+
*
|
|
7652
|
+
* @param direction The direction that just ran (`'up'` or `'down'`).
|
|
7653
|
+
*/
|
|
7654
|
+
done(_direction: 'up' | 'down'): Promise<void> | void;
|
|
7144
7655
|
}
|
|
7145
7656
|
//#endregion
|
|
7146
7657
|
//#region src/DB.d.ts
|
|
@@ -7590,15 +8101,15 @@ declare const generateMigrationFile: (name: string, options?: GenerateMigrationO
|
|
|
7590
8101
|
* @param direction The direction of the migration to plan for ('up' or 'down').
|
|
7591
8102
|
* @returns A promise that resolves to an array of schema operations that would be performed.
|
|
7592
8103
|
*/
|
|
7593
|
-
declare const getMigrationPlan: (migration:
|
|
8104
|
+
declare const getMigrationPlan: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), direction?: "up" | "down") => Promise<SchemaOperation[]>;
|
|
7594
8105
|
declare const supportsDatabaseMigrationExecution: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "executeSchemaOperations">>;
|
|
7595
8106
|
declare const supportsDatabaseCreation: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "createDatabaseFromError">>;
|
|
7596
8107
|
declare const supportsDatabaseReset: (adapter?: DatabaseAdapter) => adapter is DatabaseAdapter & Required<Pick<DatabaseAdapter, "resetDatabase">>;
|
|
7597
8108
|
declare const stripPrismaSchemaModelsAndEnums: (schema: string) => string;
|
|
7598
|
-
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration:
|
|
8109
|
+
declare const applyMigrationToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7599
8110
|
operations: SchemaOperation[];
|
|
7600
8111
|
}>;
|
|
7601
|
-
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration:
|
|
8112
|
+
declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migration: MigrationInstanceLike | (new () => MigrationInstanceLike)) => Promise<{
|
|
7602
8113
|
operations: SchemaOperation[];
|
|
7603
8114
|
}>;
|
|
7604
8115
|
/**
|
|
@@ -7610,7 +8121,7 @@ declare const applyMigrationRollbackToDatabase: (adapter: DatabaseAdapter, migra
|
|
|
7610
8121
|
* @param options Options for applying the migration, including schema path and write flag.
|
|
7611
8122
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and list of operations applied.
|
|
7612
8123
|
*/
|
|
7613
|
-
declare const applyMigrationToPrismaSchema: (migration:
|
|
8124
|
+
declare const applyMigrationToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7614
8125
|
schema: string;
|
|
7615
8126
|
schemaPath: string;
|
|
7616
8127
|
operations: SchemaOperation[];
|
|
@@ -7622,7 +8133,7 @@ declare const applyMigrationToPrismaSchema: (migration: Migration | (new () => M
|
|
|
7622
8133
|
* @param options Options for applying the rollback, including schema path and write flag.
|
|
7623
8134
|
* @returns A promise that resolves to an object containing the updated schema, schema path, and rollback operations applied.
|
|
7624
8135
|
*/
|
|
7625
|
-
declare const applyMigrationRollbackToPrismaSchema: (migration:
|
|
8136
|
+
declare const applyMigrationRollbackToPrismaSchema: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaSchemaSyncOptions) => Promise<{
|
|
7626
8137
|
schema: string;
|
|
7627
8138
|
schemaPath: string;
|
|
7628
8139
|
operations: SchemaOperation[];
|
|
@@ -7636,7 +8147,7 @@ declare const applyMigrationRollbackToPrismaSchema: (migration: Migration | (new
|
|
|
7636
8147
|
* @param options Options for running the migration, including schema path, write flag, and Prisma commands.
|
|
7637
8148
|
* @returns A promise that resolves to an object containing the schema path and list of operations applied.
|
|
7638
8149
|
*/
|
|
7639
|
-
declare const runMigrationWithPrisma: (migration:
|
|
8150
|
+
declare const runMigrationWithPrisma: (migration: MigrationInstanceLike | (new () => MigrationInstanceLike), options?: PrismaMigrationWorkflowOptions) => Promise<{
|
|
7640
8151
|
schemaPath: string;
|
|
7641
8152
|
operations: SchemaOperation[];
|
|
7642
8153
|
}>;
|
|
@@ -7846,4 +8357,4 @@ declare class URLDriver {
|
|
|
7846
8357
|
url(page: number): string;
|
|
7847
8358
|
}
|
|
7848
8359
|
//#endregion
|
|
7849
|
-
export { buildRelationLine as $, DelegateForModelSchema as $a, EagerLoadConstraint as $i, RuntimePathMap as $n, RelatedModelFromResult as $o, QueryFullTextCondition as $r, TimestampNames as $s, getPersistedColumnMap as $t, isTransactionCapableClient as A, QuerySchemaUniqueWhere as Aa, UpsertSpec as Ai, ForeignKeyBuilder as An, HasOneRelation as Ao, AdapterModelFieldStructure as Ar, RelationMetadataType as As, createEmptyAppliedMigrationsState as At, applyDropTableOperation as B, TransactionCapableClient as Ba, CastType as Bi, MakeFactoryCommand as Bn, RelationAggregateType as Bo, DatabaseRow as Br, PrismaSchemaSyncOptions as Bs, removeAppliedMigration as Bt, getRuntimeDebugHandler as C, QuerySchemaCreateData as Ca, RelationLoadPlan as Ci, ArkormException as Cn, defineFactory as Co, createPrismaDatabaseAdapter as Cr, ModelMetadata as Cs, supportsDatabaseMigrationExecution as Ct, getUserConfig as D, QuerySchemaRow as Da, SortDirection as Di, SchemaBuilder as Dn, MorphOneRelation as Do, AdapterCapability as Dr, MorphToRelationMetadata as Ds, buildMigrationIdentity as Dt, getRuntimePrismaClient as E, QuerySchemaOrderBy as Ea, SoftDeleteQueryMode as Ei, Migration as En, MorphToManyRelation as Eo, AdapterCapabilities as Er, MorphToManyRelationMetadata as Es, toModelName as Et, PRISMA_ENUM_MEMBER_REGEX as F, RuntimeClientLike as Fa, ArkormDebugEvent as Fi, MigrateFreshCommand as Fn, BelongsToManyRelation as Fo, AggregateOperation as Fr, GeneratedMigrationFile as Fs, isMigrationApplied as Ft, applyOperationsToPrismaSchema as G, QueryBuilder as Ga, DelegateOrderBy as Gi, AttributeOptions as Gn, RelationMetadataProvider as Go, InsertManySpec as Gr, SchemaIndex as Gs, PersistedColumnMappingsState as Gt, applyMigrationRollbackToPrismaSchema as H, TransactionOptions as Ha, DelegateCreateData as Hi, CliApp as Hn, RelationConstraint as Ho, DatabaseValue as Hr, SchemaColumnType as Hs, supportsDatabaseMigrationState as Ht, PRISMA_ENUM_REGEX as I, Serializable as Ia, ArkormDebugHandler as Ii, MigrateCommand as In, Relation as Io, AggregateSelection as Ir, MigrationClass as Is, markMigrationApplied as It, buildIndexLine as J, AttributeQuerySchema as Ja, DelegateSelect as Ji, RegisteredFactory as Jn, RelationTableLookupSpec as Jo, QueryComparisonCondition as Jr, SchemaTableAlterOperation as Js, PersistedTableMetadata as Jt, buildEnumBlock as K, AttributeCreateInput as Ka, DelegateRow as Ki, Arkorm as Kn, RelationResult as Ko, InsertSpec as Kr, SchemaOperation as Ks, PersistedMetadataFeatures as Kt, PRISMA_MODEL_REGEX as L, SimplePaginationMeta as La, CastDefinition as Li, MakeSeederCommand as Ln, RelationTableLoader as Lo, AggregateSpec as Lr, MigrationInstanceLike as Ls, markMigrationRun as Lt, resetArkormRuntimeForTests as M, QuerySchemaUpdateData as Ma, AdapterQueryInspection as Mi, ModelsSyncCommand as Mn, HasManyRelation as Mo, AdapterModelStructure as Mr, AppliedMigrationRun as Ms, findAppliedMigration as Mt, runArkormTransaction as N, QuerySchemaWhere as Na, ArkormBootContext as Ni, MigrationHistoryCommand as Nn, BelongsToRelation as No, AdapterQueryOperation as Nr, AppliedMigrationsState as Ns, getLastMigrationRun as Nt, isDelegateLike as O, QuerySchemaRows as Oa, UpdateManySpec as Oi, EnumBuilder as On, MorphManyRelation as Oo, AdapterDatabaseCreationResult as Or, PivotModelStatic as Os, buildMigrationRunId as Ot, PrimaryKeyGenerationPlanner as P, RawSelectInput as Pa, ArkormConfig as Pi, MigrateRollbackCommand as Pn, SingleResultRelation as Po, AdapterTransactionContext as Pr, GenerateMigrationOptions as Ps, getLatestAppliedMigrations as Pt, buildPrimaryKeyLine as Q, AttributeWhereInput as Qa, DelegateWhere as Qi, RuntimePathKey as Qn, RelatedModelForRelationship as Qo, QueryExistsCondition as Qr, TimestampColumnBehavior as Qs, deletePersistedColumnMappingsState as Qt, applyAlterTableOperation as R, SoftDeleteConfig as Ra, CastHandler as Ri, MakeModelCommand as Rn, RelationAggregateConstraint as Ro, DatabaseAdapter as Rr, PrimaryKeyGeneration as Rs, readAppliedMigrationsState as Rt, getRuntimeClient as S, PrismaTransactionOptions as Sa, RelationFilterSpec as Si, ArkormErrorContext as Sn, ModelFactory as So, createPrismaCompatibilityAdapter as Sr, HasOneThroughRelationMetadata as Ss, supportsDatabaseCreation as St, getRuntimePaginationURLDriverFactory as T, QuerySchemaInclude as Ta, SelectSpec as Ti, MIGRATION_BRAND as Tn, MorphToRelation as To, createKyselyAdapter as Tr, MorphOneRelationMetadata as Ts, toMigrationFileSlug as Tt, applyMigrationToDatabase as U, ModelStatic as Ua, DelegateFindManyArgs as Ui, resolveCast as Un, RelationDefaultResolver as Uo, DeleteManySpec as Ur, SchemaForeignKey as Us, writeAppliedMigrationsState as Ut, applyMigrationRollbackToDatabase as V, TransactionContext as Va, ClientResolver as Vi, InitCommand as Vn, RelationColumnLookupSpec as Vo, DatabaseRows as Vr, SchemaColumn as Vs, resolveMigrationStateFilePath as Vt, applyMigrationToPrismaSchema as W, RelationshipModelStatic as Wa, DelegateInclude as Wi, Attribute as Wn, RelationDefaultValue as Wo, DeleteSpec as Wr, SchemaForeignKeyAction as Ws, writeAppliedMigrationsStateToStore as Wt, buildMigrationSource as X, AttributeSelect as Xa, DelegateUpdateArgs as Xi, RuntimeConstructor as Xn, JoinOn as Xo, QueryCondition as Xr, SchemaTableDropOperation as Xs, applyOperationsToPersistedColumnMappingsState as Xt, buildInverseRelationLine as Y, AttributeSchemaDelegate as Ya, DelegateUniqueWhere as Yi, RegisteredModel as Yn, EagerLoadRelations as Yo, QueryComparisonOperator as Yr, SchemaTableCreateOperation as Ys, PersistedTimestampColumn as Yt, buildModelBlock as Z, AttributeUpdateInput as Za, DelegateUpdateData as Zi, RuntimePathInput as Zn, JoinSource as Zo, QueryDayCondition as Zr, SchemaUniqueConstraint as Zs, createEmptyPersistedColumnMappingsState as Zt, ensureArkormConfigLoading as _, PrismaLikeSortOrder as _a, QuerySelectColumn as _i, QueryExecutionException as _n, QuerySchemaForModel as _o, SeederCallArgument as _r, BelongsToRelationMetadata as _s, resolveMigrationClassName as _t, getRuntimeCompatibilityAdapter as a, PaginationCurrentPageResolver as aa, QueryJoinNestedConstraint as ai, readPersistedColumnMappingsState as an, ModelDeclaredAttributeKey as ao, loadFactoriesFrom as ar, FactoryAttributeResolver as as, deriveRelationFieldName as at, getDefaultStubsPath as b, PrismaTransactionCapableClient as ba, RawQuerySpec as bi, ModelNotFoundException as bn, Model as bo, PrismaDatabaseAdapter as br, HasManyThroughRelationMetadata as bs, runPrismaCommand as bt, PrismaDelegateMap as c, PaginationURLDriver as ca, QueryJoinType as ci, resolveColumnMappingsFilePath as cn, ModelEventHandlerConstructor as co, loadSeedersFrom as cr, FactoryDefinition as cs, findEnumBlock as ct, inferDelegateName as d, PrismaDelegateLike as da, QueryJsonConditionKind as di, validatePersistedMetadataFeaturesForMigrations as dn, ModelLifecycleState as do, registerModels as dr, FactoryRelationshipResolver as ds, formatEnumDefaultValue as dt, EagerLoadMap as ea, TimestampNaming as ec, QueryGroupCondition as ei, getPersistedEnumMap as en, GlobalScope as eo, getRegisteredFactories as er, WhereCallback as es, buildUniqueConstraintLine as et, awaitConfiguredModelsRegistration as f, PrismaFindManyArgsLike as fa, QueryLogicalOperator as fi, writePersistedColumnMappingsState as fn, ModelOrderByInput as fo, registerPaths as fr, FactoryState as fs, formatRelationAction as ft, emitRuntimeDebugEvent as g, PrismaLikeSelect as ga, QueryScalarComparisonOperator as gi, RelationResolutionException as gn, ModelWhereInput as go, Seeder as gr, BelongsToManyRelationMetadata as gs, resolveEnumName as gt, defineConfig as h, PrismaLikeScalarFilter as ha, QueryRawCondition as hi, ScopeNotDefinedException as hn, ModelUpdateData as ho, SEEDER_BRAND as hr, DatabaseTablePersistedMetadataOptions as hs, pad as ht, RuntimeModuleLoader as i, NamingCase as ia, QueryJoinConstraint as ii, getPersistedTimestampColumns as in, ModelCreateData as io, getRegisteredSeeders as ir, ArkormCollection as is, deriveRelationAlias as it, loadArkormConfig as j, QuerySchemaUpdateArgs as ja, AdapterBindableModel as ji, SeedCommand as jn, HasManyThroughRelation as jo, AdapterModelIntrospectionOptions as jr, AppliedMigrationEntry as js, deleteAppliedMigrationsStateFromStore as jt, isQuerySchemaLike as k, QuerySchemaSelect as ka, UpdateSpec as ki, TableBuilder as kn, HasOneThroughRelation as ko, AdapterInspectionRequest as kr, RelationMetadata as ks, computeMigrationChecksum as kt, createPrismaAdapter as l, PaginationURLDriverFactory as la, QueryJoinValueConstraint as li, resolvePersistedMetadataFeatures as ln, ModelEventListener as lo, registerFactories as lr, FactoryDefinitionAttributes as ls, findModelBlock as lt, configureArkormRuntime as m, PrismaLikeOrderBy as ma, QueryOrderBy as mi, UniqueConstraintResolutionException as mn, ModelRelationshipResult as mo, resetRuntimeRegistryForTests as mr, DatabaseTableOptions as ms, getMigrationPlan as mt, PivotModel as n, ModelQuerySchemaLike as na, QueryJoinBoolean as ni, getPersistedPrimaryKeyGeneration as nn, ModelAttributes as no, getRegisteredModels as nr, LengthAwarePaginator as ns, deriveCollectionFieldName as nt, resolveRuntimeCompatibilityQuerySchema as o, PaginationMeta as oa, QueryJoinNullConstraint as oi, rebuildPersistedColumnMappingsState as on, ModelEventDispatcher as oo, loadMigrationsFrom as or, FactoryAttributes as os, deriveSingularFieldName as ot, bindAdapterToModels as p, PrismaLikeInclude as pa, QueryNotCondition as pi, UnsupportedAdapterFeatureException as pn, ModelRelationshipKey as po, registerSeeders as pr, MaybePromise as ps, generateMigrationFile as pt, buildFieldLine as q, AttributeOrderBy as qa, DelegateRows as qi, Arkormx as qn, RelationResultCache as qo, QueryColumnComparisonCondition as qr, SchemaPrimaryKey as qs, PersistedPrimaryKeyGeneration as qt, LoadedRuntimeModule as r, ModelTableCase as ra, QueryJoinColumnConstraint as ri, getPersistedTableMetadata as rn, ModelAttributesOf as ro, getRegisteredPaths as rr, Paginator as rs, deriveInverseRelationAlias as rt, resolveRuntimeCompatibilityQuerySchemaOrThrow as s, PaginationOptions as sa, QueryJoinRawConstraint as si, resetPersistedColumnMappingsCache as sn, ModelEventHandler as so, loadModelsFrom as sr, FactoryCallback as ss, escapeRegex as st, URLDriver as t, GetUserConfig as ta, QueryJoin as ti, getPersistedEnumTsType as tn, ModelAttributeValue as to, getRegisteredMigrations as tr, JoinClause as ts, createMigrationTimestamp as tt, createPrismaDelegateMap as u, PrismaClientLike as ua, QueryJsonCondition as ui, syncPersistedColumnMappingsFromState as un, ModelEventName as uo, registerMigrations as ur, FactoryModelConstructor as us, formatDefaultValue as ut, getActiveTransactionAdapter as v, PrismaLikeWhereInput as va, QueryTarget as vi, QueryExecutionExceptionContext as vn, QuerySchemaForModelInstance as vo, SeederConstructor as vr, ColumnMap as vs, resolvePrismaType as vt, getRuntimePaginationCurrentPageResolver as w, QuerySchemaFindManyArgs as wa, RelationLoadSpec as wi, DB as wn, SetBasedEagerLoader as wo, KyselyDatabaseAdapter as wr, MorphManyRelationMetadata as ws, supportsDatabaseReset as wt, getRuntimeAdapter as x, PrismaTransactionContext as xa, RelationAggregateSpec as xi, MissingDelegateException as xn, InlineFactory as xo, PrismaDelegateNameMapping as xr, HasOneRelationMetadata as xs, stripPrismaSchemaModelsAndEnums as xt, getActiveTransactionClient as y, PrismaTransactionCallback as ya, QueryTimeCondition as yi, QueryConstraintException as yn, RelatedModelClass as yo, SeederInput as yr, HasManyRelationMetadata as ys, runMigrationWithPrisma as yt, applyCreateTableOperation as z, TransactionCallback as za, CastMap as zi, MakeMigrationCommand as zn, RelationAggregateInput as zo, DatabasePrimitive as zr, PrismaMigrationWorkflowOptions as zs, readAppliedMigrationsStateFromStore as zt };
|
|
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 };
|