arkormx 2.12.12 → 2.12.13
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/{index-BSJFuytO.d.cts → index-BbKMvoiA.d.cts} +35 -11
- package/dist/{index-DJe32yxM.d.mts → index-ChLGDqKz.d.mts} +35 -11
- package/dist/index.cjs +89 -66
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +89 -66
- package/dist/relationship/index.d.cts +1 -1
- package/dist/relationship/index.d.mts +1 -1
- package/package.json +1 -1
|
@@ -4021,8 +4021,7 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4021
4021
|
private addPositionalWhere;
|
|
4022
4022
|
private normalizeWhereOperator;
|
|
4023
4023
|
/**
|
|
4024
|
-
* Appends a pre-built structured condition
|
|
4025
|
-
* legacy where into the structured representation so the two combine correctly.
|
|
4024
|
+
* Appends a pre-built structured condition.
|
|
4026
4025
|
*
|
|
4027
4026
|
* @param boolean
|
|
4028
4027
|
* @param condition
|
|
@@ -5564,7 +5563,22 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5564
5563
|
private normalizeRelationLoadSelect;
|
|
5565
5564
|
private normalizeRelationLoadOrderBy;
|
|
5566
5565
|
private normalizeRelationLoads;
|
|
5566
|
+
/**
|
|
5567
|
+
* Appends a structured condition, first flushing any Prisma-like legacy
|
|
5568
|
+
* where into the structured representation so that neither is lost.
|
|
5569
|
+
*
|
|
5570
|
+
* @param operator
|
|
5571
|
+
* @param condition
|
|
5572
|
+
*/
|
|
5567
5573
|
private appendQueryCondition;
|
|
5574
|
+
/**
|
|
5575
|
+
* Whether a condition survives conversion to the Prisma-like where shape;
|
|
5576
|
+
* only comparisons and groups or negations of them do.
|
|
5577
|
+
*
|
|
5578
|
+
* @param condition
|
|
5579
|
+
* @returns
|
|
5580
|
+
*/
|
|
5581
|
+
private isSchemaWhereRepresentable;
|
|
5568
5582
|
private toQuerySchemaWhere;
|
|
5569
5583
|
private buildSoftDeleteQueryCondition;
|
|
5570
5584
|
private buildQueryWhereCondition;
|
|
@@ -5596,6 +5610,24 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5596
5610
|
private executeUpdateRow;
|
|
5597
5611
|
private executeUpdateManyRows;
|
|
5598
5612
|
private executeDeleteManyRows;
|
|
5613
|
+
/**
|
|
5614
|
+
* The complete where condition for a write, built the same way reads build
|
|
5615
|
+
* theirs so that every constraint (raw, JSON, relation, expression, and the
|
|
5616
|
+
* rest) narrows the write. A write without constraints is refused.
|
|
5617
|
+
*
|
|
5618
|
+
* @param operation
|
|
5619
|
+
* @param label
|
|
5620
|
+
* @returns
|
|
5621
|
+
*/
|
|
5622
|
+
private buildWriteCondition;
|
|
5623
|
+
/**
|
|
5624
|
+
* The primary-key lookup a condition amounts to, when it is nothing more
|
|
5625
|
+
* than an equality on the primary key.
|
|
5626
|
+
*
|
|
5627
|
+
* @param condition
|
|
5628
|
+
* @returns
|
|
5629
|
+
*/
|
|
5630
|
+
private uniqueWhereFor;
|
|
5599
5631
|
/**
|
|
5600
5632
|
* Builds the where clause for the query, taking into account soft delete
|
|
5601
5633
|
* settings if applicable.
|
|
@@ -5611,18 +5643,10 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5611
5643
|
/**
|
|
5612
5644
|
* Resolves a unique where clause for update and delete operations.
|
|
5613
5645
|
*
|
|
5614
|
-
* @param
|
|
5646
|
+
* @param condition
|
|
5615
5647
|
* @returns
|
|
5616
5648
|
*/
|
|
5617
5649
|
private resolveUniqueWhere;
|
|
5618
|
-
/**
|
|
5619
|
-
* Checks if the provided where clause is already a unique
|
|
5620
|
-
* identifier (i.e., contains only an 'id' field).
|
|
5621
|
-
*
|
|
5622
|
-
* @param where
|
|
5623
|
-
* @returns
|
|
5624
|
-
*/
|
|
5625
|
-
private isUniqueWhere;
|
|
5626
5650
|
private shuffleRows;
|
|
5627
5651
|
private hasRelationFilters;
|
|
5628
5652
|
private resolveMorphTargets;
|
|
@@ -4021,8 +4021,7 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
4021
4021
|
private addPositionalWhere;
|
|
4022
4022
|
private normalizeWhereOperator;
|
|
4023
4023
|
/**
|
|
4024
|
-
* Appends a pre-built structured condition
|
|
4025
|
-
* legacy where into the structured representation so the two combine correctly.
|
|
4024
|
+
* Appends a pre-built structured condition.
|
|
4026
4025
|
*
|
|
4027
4026
|
* @param boolean
|
|
4028
4027
|
* @param condition
|
|
@@ -5564,7 +5563,22 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5564
5563
|
private normalizeRelationLoadSelect;
|
|
5565
5564
|
private normalizeRelationLoadOrderBy;
|
|
5566
5565
|
private normalizeRelationLoads;
|
|
5566
|
+
/**
|
|
5567
|
+
* Appends a structured condition, first flushing any Prisma-like legacy
|
|
5568
|
+
* where into the structured representation so that neither is lost.
|
|
5569
|
+
*
|
|
5570
|
+
* @param operator
|
|
5571
|
+
* @param condition
|
|
5572
|
+
*/
|
|
5567
5573
|
private appendQueryCondition;
|
|
5574
|
+
/**
|
|
5575
|
+
* Whether a condition survives conversion to the Prisma-like where shape;
|
|
5576
|
+
* only comparisons and groups or negations of them do.
|
|
5577
|
+
*
|
|
5578
|
+
* @param condition
|
|
5579
|
+
* @returns
|
|
5580
|
+
*/
|
|
5581
|
+
private isSchemaWhereRepresentable;
|
|
5568
5582
|
private toQuerySchemaWhere;
|
|
5569
5583
|
private buildSoftDeleteQueryCondition;
|
|
5570
5584
|
private buildQueryWhereCondition;
|
|
@@ -5596,6 +5610,24 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5596
5610
|
private executeUpdateRow;
|
|
5597
5611
|
private executeUpdateManyRows;
|
|
5598
5612
|
private executeDeleteManyRows;
|
|
5613
|
+
/**
|
|
5614
|
+
* The complete where condition for a write, built the same way reads build
|
|
5615
|
+
* theirs so that every constraint (raw, JSON, relation, expression, and the
|
|
5616
|
+
* rest) narrows the write. A write without constraints is refused.
|
|
5617
|
+
*
|
|
5618
|
+
* @param operation
|
|
5619
|
+
* @param label
|
|
5620
|
+
* @returns
|
|
5621
|
+
*/
|
|
5622
|
+
private buildWriteCondition;
|
|
5623
|
+
/**
|
|
5624
|
+
* The primary-key lookup a condition amounts to, when it is nothing more
|
|
5625
|
+
* than an equality on the primary key.
|
|
5626
|
+
*
|
|
5627
|
+
* @param condition
|
|
5628
|
+
* @returns
|
|
5629
|
+
*/
|
|
5630
|
+
private uniqueWhereFor;
|
|
5599
5631
|
/**
|
|
5600
5632
|
* Builds the where clause for the query, taking into account soft delete
|
|
5601
5633
|
* settings if applicable.
|
|
@@ -5611,18 +5643,10 @@ declare class QueryBuilder<TModel, TDelegate extends ModelQuerySchemaLike = Mode
|
|
|
5611
5643
|
/**
|
|
5612
5644
|
* Resolves a unique where clause for update and delete operations.
|
|
5613
5645
|
*
|
|
5614
|
-
* @param
|
|
5646
|
+
* @param condition
|
|
5615
5647
|
* @returns
|
|
5616
5648
|
*/
|
|
5617
5649
|
private resolveUniqueWhere;
|
|
5618
|
-
/**
|
|
5619
|
-
* Checks if the provided where clause is already a unique
|
|
5620
|
-
* identifier (i.e., contains only an 'id' field).
|
|
5621
|
-
*
|
|
5622
|
-
* @param where
|
|
5623
|
-
* @returns
|
|
5624
|
-
*/
|
|
5625
|
-
private isUniqueWhere;
|
|
5626
5650
|
private shuffleRows;
|
|
5627
5651
|
private hasRelationFilters;
|
|
5628
5652
|
private resolveMorphTargets;
|
package/dist/index.cjs
CHANGED
|
@@ -5186,19 +5186,13 @@ var QueryBuilder = class QueryBuilder {
|
|
|
5186
5186
|
return operator;
|
|
5187
5187
|
}
|
|
5188
5188
|
/**
|
|
5189
|
-
* Appends a pre-built structured condition
|
|
5190
|
-
* legacy where into the structured representation so the two combine correctly.
|
|
5189
|
+
* Appends a pre-built structured condition.
|
|
5191
5190
|
*
|
|
5192
5191
|
* @param boolean
|
|
5193
5192
|
* @param condition
|
|
5194
5193
|
* @returns
|
|
5195
5194
|
*/
|
|
5196
5195
|
appendStructuredWhere(boolean, condition) {
|
|
5197
|
-
if (this.legacyWhere) {
|
|
5198
|
-
const existing = this.tryBuildQueryCondition(this.legacyWhere);
|
|
5199
|
-
this.legacyWhere = void 0;
|
|
5200
|
-
if (existing) this.queryWhere = existing;
|
|
5201
|
-
}
|
|
5202
5196
|
this.appendQueryCondition(boolean, condition);
|
|
5203
5197
|
return this;
|
|
5204
5198
|
}
|
|
@@ -5866,6 +5860,10 @@ var QueryBuilder = class QueryBuilder {
|
|
|
5866
5860
|
};
|
|
5867
5861
|
return this;
|
|
5868
5862
|
}
|
|
5863
|
+
if (!this.legacyWhere && this.queryWhere && !this.isSchemaWhereRepresentable(this.queryWhere)) throw new require_relationship.UnsupportedAdapterFeatureException("This where clause cannot be combined with the raw, JSON, relation, or expression constraints already on the query.", {
|
|
5864
|
+
operation: "query.where",
|
|
5865
|
+
model: this.model.name
|
|
5866
|
+
});
|
|
5869
5867
|
const existingWhere = this.legacyWhere ?? this.toQuerySchemaWhere(this.queryWhere);
|
|
5870
5868
|
this.queryWhere = void 0;
|
|
5871
5869
|
if (!existingWhere) {
|
|
@@ -7402,20 +7400,19 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7402
7400
|
* @returns
|
|
7403
7401
|
*/
|
|
7404
7402
|
async update(data) {
|
|
7405
|
-
const
|
|
7406
|
-
|
|
7407
|
-
operation: "update",
|
|
7408
|
-
model: this.model.name
|
|
7409
|
-
});
|
|
7410
|
-
const directSpec = this.tryBuildUpdateSpec(where, data);
|
|
7403
|
+
const condition = this.buildWriteCondition("update", "Update");
|
|
7404
|
+
const uniqueWhere = this.uniqueWhereFor(condition);
|
|
7411
7405
|
const adapter = this.requireAdapter();
|
|
7412
|
-
if (!
|
|
7413
|
-
const updated = await adapter.updateFirst(
|
|
7406
|
+
if (!uniqueWhere && typeof adapter.updateFirst === "function") {
|
|
7407
|
+
const updated = await adapter.updateFirst({
|
|
7408
|
+
target: this.buildQueryTarget(),
|
|
7409
|
+
where: condition,
|
|
7410
|
+
values: data
|
|
7411
|
+
});
|
|
7414
7412
|
if (!updated) throw new ModelNotFoundException(this.model.name, "Record not found for update operation.", { operation: "update" });
|
|
7415
7413
|
return this.model.hydrate(updated);
|
|
7416
7414
|
}
|
|
7417
|
-
const
|
|
7418
|
-
const updated = await this.executeUpdateRow(uniqueWhere, data);
|
|
7415
|
+
const updated = await this.executeUpdateRow(uniqueWhere ?? await this.resolveUniqueWhere(condition), data);
|
|
7419
7416
|
return this.model.hydrate(updated);
|
|
7420
7417
|
}
|
|
7421
7418
|
/**
|
|
@@ -7426,12 +7423,8 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7426
7423
|
* @returns
|
|
7427
7424
|
*/
|
|
7428
7425
|
async updateFrom(data) {
|
|
7429
|
-
const
|
|
7430
|
-
|
|
7431
|
-
operation: "updateFrom",
|
|
7432
|
-
model: this.model.name
|
|
7433
|
-
});
|
|
7434
|
-
return await this.executeUpdateManyRows(where, data);
|
|
7426
|
+
const condition = this.buildWriteCondition("updateFrom", "Update");
|
|
7427
|
+
return await this.executeUpdateManyRows(condition, data);
|
|
7435
7428
|
}
|
|
7436
7429
|
/**
|
|
7437
7430
|
* Insert a record when no match exists, otherwise update the matching record.
|
|
@@ -7520,12 +7513,7 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7520
7513
|
* @returns the count of deleted rows (0 when nothing matched)
|
|
7521
7514
|
*/
|
|
7522
7515
|
async delete() {
|
|
7523
|
-
|
|
7524
|
-
if (!where) throw new QueryConstraintException("Delete requires a where clause.", {
|
|
7525
|
-
operation: "delete",
|
|
7526
|
-
model: this.model.name
|
|
7527
|
-
});
|
|
7528
|
-
return this.executeDeleteManyRows(where);
|
|
7516
|
+
return this.executeDeleteManyRows(this.buildWriteCondition("delete", "Delete"));
|
|
7529
7517
|
}
|
|
7530
7518
|
/**
|
|
7531
7519
|
* Deletes every record matching the current query constraints and throws when
|
|
@@ -7573,9 +7561,7 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7573
7561
|
values
|
|
7574
7562
|
};
|
|
7575
7563
|
}
|
|
7576
|
-
tryBuildUpdateManySpec(
|
|
7577
|
-
const condition = this.tryBuildQueryCondition(where);
|
|
7578
|
-
if (condition === null) return null;
|
|
7564
|
+
tryBuildUpdateManySpec(condition, values) {
|
|
7579
7565
|
return {
|
|
7580
7566
|
target: this.buildQueryTarget(),
|
|
7581
7567
|
where: condition,
|
|
@@ -8187,7 +8173,23 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8187
8173
|
}
|
|
8188
8174
|
return plans;
|
|
8189
8175
|
}
|
|
8176
|
+
/**
|
|
8177
|
+
* Appends a structured condition, first flushing any Prisma-like legacy
|
|
8178
|
+
* where into the structured representation so that neither is lost.
|
|
8179
|
+
*
|
|
8180
|
+
* @param operator
|
|
8181
|
+
* @param condition
|
|
8182
|
+
*/
|
|
8190
8183
|
appendQueryCondition(operator, condition) {
|
|
8184
|
+
if (this.legacyWhere) {
|
|
8185
|
+
const existing = this.tryBuildQueryCondition(this.legacyWhere);
|
|
8186
|
+
if (existing === null) throw new require_relationship.UnsupportedAdapterFeatureException("This constraint cannot be combined with the where clause already on the query.", {
|
|
8187
|
+
operation: "query.where",
|
|
8188
|
+
model: this.model.name
|
|
8189
|
+
});
|
|
8190
|
+
this.legacyWhere = void 0;
|
|
8191
|
+
if (existing) this.queryWhere = existing;
|
|
8192
|
+
}
|
|
8191
8193
|
if (!this.queryWhere) {
|
|
8192
8194
|
this.queryWhere = condition;
|
|
8193
8195
|
return;
|
|
@@ -8198,6 +8200,19 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8198
8200
|
conditions: [this.queryWhere, condition]
|
|
8199
8201
|
};
|
|
8200
8202
|
}
|
|
8203
|
+
/**
|
|
8204
|
+
* Whether a condition survives conversion to the Prisma-like where shape;
|
|
8205
|
+
* only comparisons and groups or negations of them do.
|
|
8206
|
+
*
|
|
8207
|
+
* @param condition
|
|
8208
|
+
* @returns
|
|
8209
|
+
*/
|
|
8210
|
+
isSchemaWhereRepresentable(condition) {
|
|
8211
|
+
if (condition.type === "comparison") return true;
|
|
8212
|
+
if (condition.type === "group") return condition.conditions.every((entry) => this.isSchemaWhereRepresentable(entry));
|
|
8213
|
+
if (condition.type === "not") return this.isSchemaWhereRepresentable(condition.condition);
|
|
8214
|
+
return false;
|
|
8215
|
+
}
|
|
8201
8216
|
toQuerySchemaWhere(condition) {
|
|
8202
8217
|
if (!condition) return void 0;
|
|
8203
8218
|
if (condition.type === "comparison") {
|
|
@@ -8578,14 +8593,10 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8578
8593
|
if (!updated) throw new ModelNotFoundException(this.model.name, "Record not found for update operation.", { operation: "update" });
|
|
8579
8594
|
return updated;
|
|
8580
8595
|
}
|
|
8581
|
-
async executeUpdateManyRows(
|
|
8596
|
+
async executeUpdateManyRows(condition, values) {
|
|
8582
8597
|
const adapter = this.requireAdapter();
|
|
8583
8598
|
const normalizedValues = this.normalizeUpdatePayload(values);
|
|
8584
|
-
const spec = this.tryBuildUpdateManySpec(
|
|
8585
|
-
if (!spec) throw new require_relationship.UnsupportedAdapterFeatureException("Update-many could not be compiled into an Arkorm update specification.", {
|
|
8586
|
-
operation: "query.updateMany",
|
|
8587
|
-
model: this.model.name
|
|
8588
|
-
});
|
|
8599
|
+
const spec = this.tryBuildUpdateManySpec(condition, normalizedValues);
|
|
8589
8600
|
if (typeof adapter.updateMany === "function") return await adapter.updateMany(spec);
|
|
8590
8601
|
const rows = await adapter.select({
|
|
8591
8602
|
target: spec.target,
|
|
@@ -8603,13 +8614,8 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8603
8614
|
}
|
|
8604
8615
|
return updated;
|
|
8605
8616
|
}
|
|
8606
|
-
async executeDeleteManyRows(
|
|
8617
|
+
async executeDeleteManyRows(condition) {
|
|
8607
8618
|
const adapter = this.requireAdapter();
|
|
8608
|
-
const condition = this.tryBuildQueryCondition(where);
|
|
8609
|
-
if (condition === null) throw new require_relationship.UnsupportedAdapterFeatureException("Delete could not be compiled into an Arkorm delete specification.", {
|
|
8610
|
-
operation: "query.delete",
|
|
8611
|
-
model: this.model.name
|
|
8612
|
-
});
|
|
8613
8619
|
const spec = {
|
|
8614
8620
|
target: this.buildQueryTarget(),
|
|
8615
8621
|
where: condition
|
|
@@ -8631,6 +8637,39 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8631
8637
|
return deleted;
|
|
8632
8638
|
}
|
|
8633
8639
|
/**
|
|
8640
|
+
* The complete where condition for a write, built the same way reads build
|
|
8641
|
+
* theirs so that every constraint (raw, JSON, relation, expression, and the
|
|
8642
|
+
* rest) narrows the write. A write without constraints is refused.
|
|
8643
|
+
*
|
|
8644
|
+
* @param operation
|
|
8645
|
+
* @param label
|
|
8646
|
+
* @returns
|
|
8647
|
+
*/
|
|
8648
|
+
buildWriteCondition(operation, label) {
|
|
8649
|
+
const condition = this.buildQueryWhereCondition();
|
|
8650
|
+
if (condition === null) throw new require_relationship.UnsupportedAdapterFeatureException(`${label} could not be compiled into an Arkorm ${label.toLowerCase()} specification.`, {
|
|
8651
|
+
operation: `query.${operation}`,
|
|
8652
|
+
model: this.model.name
|
|
8653
|
+
});
|
|
8654
|
+
if (!condition) throw new QueryConstraintException(`${label} requires a where clause.`, {
|
|
8655
|
+
operation,
|
|
8656
|
+
model: this.model.name
|
|
8657
|
+
});
|
|
8658
|
+
return condition;
|
|
8659
|
+
}
|
|
8660
|
+
/**
|
|
8661
|
+
* The primary-key lookup a condition amounts to, when it is nothing more
|
|
8662
|
+
* than an equality on the primary key.
|
|
8663
|
+
*
|
|
8664
|
+
* @param condition
|
|
8665
|
+
* @returns
|
|
8666
|
+
*/
|
|
8667
|
+
uniqueWhereFor(condition) {
|
|
8668
|
+
const primaryKey = this.model.getPrimaryKey();
|
|
8669
|
+
if (condition.type !== "comparison" || condition.column !== primaryKey || condition.operator !== "=" || condition.value == null) return null;
|
|
8670
|
+
return { [primaryKey]: condition.value };
|
|
8671
|
+
}
|
|
8672
|
+
/**
|
|
8634
8673
|
* Builds the where clause for the query, taking into account soft delete
|
|
8635
8674
|
* settings if applicable.
|
|
8636
8675
|
*
|
|
@@ -8653,17 +8692,12 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8653
8692
|
/**
|
|
8654
8693
|
* Resolves a unique where clause for update and delete operations.
|
|
8655
8694
|
*
|
|
8656
|
-
* @param
|
|
8695
|
+
* @param condition
|
|
8657
8696
|
* @returns
|
|
8658
8697
|
*/
|
|
8659
|
-
async resolveUniqueWhere(
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
if (!condition) throw new UniqueConstraintResolutionException("Unable to resolve a unique identifier for update/delete operation from the current query shape.", {
|
|
8663
|
-
operation: "resolveUniqueWhere",
|
|
8664
|
-
model: this.model.name,
|
|
8665
|
-
meta: { where }
|
|
8666
|
-
});
|
|
8698
|
+
async resolveUniqueWhere(condition, failIfMissing = true) {
|
|
8699
|
+
const unique = this.uniqueWhereFor(condition);
|
|
8700
|
+
if (unique) return unique;
|
|
8667
8701
|
const row = await this.requireAdapter().selectOne({
|
|
8668
8702
|
target: this.buildQueryTarget(),
|
|
8669
8703
|
columns: [{ column: this.model.getPrimaryKey() }],
|
|
@@ -8673,28 +8707,17 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8673
8707
|
if (!row) return failIfMissing ? (() => {
|
|
8674
8708
|
throw new ModelNotFoundException(this.model.name, "Record not found for update/delete operation.", {
|
|
8675
8709
|
operation: "resolveUniqueWhere",
|
|
8676
|
-
meta: {
|
|
8710
|
+
meta: { condition }
|
|
8677
8711
|
});
|
|
8678
8712
|
})() : null;
|
|
8679
8713
|
const primaryKey = this.model.getPrimaryKey();
|
|
8680
8714
|
if (!Object.prototype.hasOwnProperty.call(row, primaryKey)) throw new UniqueConstraintResolutionException(`Unable to resolve a unique identifier for update/delete operation. Include [${primaryKey}] in the query constraints.`, {
|
|
8681
8715
|
operation: "resolveUniqueWhere",
|
|
8682
8716
|
model: this.model.name,
|
|
8683
|
-
meta: {
|
|
8717
|
+
meta: { condition }
|
|
8684
8718
|
});
|
|
8685
8719
|
return { [primaryKey]: row[primaryKey] };
|
|
8686
8720
|
}
|
|
8687
|
-
/**
|
|
8688
|
-
* Checks if the provided where clause is already a unique
|
|
8689
|
-
* identifier (i.e., contains only an 'id' field).
|
|
8690
|
-
*
|
|
8691
|
-
* @param where
|
|
8692
|
-
* @returns
|
|
8693
|
-
*/
|
|
8694
|
-
isUniqueWhere(where) {
|
|
8695
|
-
const primaryKey = this.model.getPrimaryKey();
|
|
8696
|
-
return Object.keys(where).length === 1 && Object.prototype.hasOwnProperty.call(where, primaryKey);
|
|
8697
|
-
}
|
|
8698
8721
|
shuffleRows(rows) {
|
|
8699
8722
|
const shuffled = [...rows];
|
|
8700
8723
|
for (let index = shuffled.length - 1; index > 0; index--) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildPrimaryKeyLine, $a as TransactionOptions, $c as SchemaTableCreateOperation, $i as DelegateCreateData, $n as getModel, $o as fn, $r as InsertSpec, $s as FactoryModelConstructor, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCallback, Ac as MorphToRelationMetadata, Ai as QueryTimeCondition, An as EnumBuilder, Ao as ModelOrderByInput, Ar as createPrismaDatabaseAdapter, As as RelationConstraint, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaSelect, Bc as MigrationClass, Bi as UpdateSpec, Bn as MigrateCommand, Bo as RelatedModelClass, Br as AdapterQueryOperation, Bs as JoinSource, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaFindManyArgsLike, Cc as HasManyThroughRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelDeclaredAttributeKey, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSelect, Dc as MorphManyRelationMetadata, Di as QueryScalarComparisonOperator, Dn as MIGRATION_BRAND, Do as ModelEventListener, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateInput, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeScalarFilter, Ec as ModelMetadata, Ei as QueryRelationCondition, En as DB, Eo as ModelEventHandlerConstructor, Er as SeederInput, Es as RelationAggregateConstraint, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaFindManyArgs, Fc as AppliedMigrationEntry, Fi as RelationLoadSpec, Fn as SeedCommand, Fo as QuerySchemaForModel, Fr as AdapterDatabaseCreationResult, Fs as RelationResultCache, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RawSelectInput, Gc as SchemaColumn, Gi as ArkormConfig, Gn as InitCommand, Go as ExpressionBuilder, Gr as DatabaseAdapter, Gs as LengthAwarePaginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateArgs, Hc as PrimaryKeyGeneration, Hi as AdapterBindableModel, Hn as MakeModelCommand, Ho as AggregateExpression, Hr as AggregateOperation, Hs as RelatedModelFromResult, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaInclude, Ic as AppliedMigrationRun, Ii as SelectSpec, In as ModelsSyncCommand, Io as QuerySchemaForModelInstance, Ir as AdapterInspectionRequest, Is as RelationTableLookupSpec, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SimplePaginationMeta, Jc as SchemaForeignKeyAction, Ji as CastDefinition, Jn as resolveCast, Jo as caseWhen, Jr as DatabaseRows, Js as FactoryAttributeResolver, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as RuntimeClientLike, Kc as SchemaColumnType, Ki as ArkormDebugEvent, Kn as DbCommand, Ko as JsonExpression, Kr as DatabasePrimitive, Ks as Paginator, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaOrderBy, Lc as AppliedMigrationsState, Li as SoftDeleteQueryMode, Ln as MigrationHistoryCommand, Lo as RegisteredModelClass, Lr as AdapterModelFieldStructure, Ls as EagerLoadQueryForRelationship, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionContext, Mc as PivotModelStatic, Mi as RelationAggregateSpec, Mn as GeneratedColumnExpression, Mo as ModelRelationshipResult, Mr as createKyselyAdapter, Ms as RelationDefaultValue, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as PrismaTransactionOptions, Nc as RelationMetadata, Ni as RelationFilterSpec, Nn as resolveGeneratedExpression, No as ModelUpdateData, Nr as AdapterCapabilities, Ns as RelationMetadataProvider, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeSortOrder, Oc as MorphOneRelationMetadata, Oi as QuerySelectColumn, On as Migration, Oo as ModelEventName, Or as PrismaDelegateNameMapping, Os as RelationAggregateType, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaCreateData, Pc as RelationMetadataType, Pi as RelationLoadPlan, Pn as ForeignKeyBuilder, Po as ModelWhereInput, Pr as AdapterCapability, Ps as RelationResult, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionContext, Qc as SchemaTableAlterOperation, Qi as ClientResolver, Qn as Arkormx, Qo as expressionBuilder, Qr as InsertManySpec, Qs as FactoryDefinitionAttributes, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRow, Rc as GenerateMigrationOptions, Ri as SortDirection, Rn as MigrateRollbackCommand, Ro as RegisteredModelInstance, Rr as AdapterModelIntrospectionOptions, Rs as EagerLoadRelations, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaDelegateLike, Sc as HasManyRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelCreateData, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeOrderBy, Tc as HasOneThroughRelationMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandler, Tr as SeederConstructor, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaUpdateData, Uc as PrismaMigrationWorkflowOptions, Ui as AdapterQueryInspection, Un as MakeMigrationCommand, Uo as CaseExpression, Ur as AggregateSelection, Us as WhereCallback, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUniqueWhere, Vc as MigrationInstanceLike, Vi as UpsertSpec, Vn as MakeSeederCommand, Vo as Model, Vr as AdapterTransactionContext, Vs as RelatedModelForRelationship, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as QuerySchemaWhere, Wc as PrismaSchemaSyncOptions, Wi as ArkormBootContext, Wn as MakeFactoryCommand, Wo as Expression, Wr as AggregateSpec, Ws as JoinClause, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCallback, Xc as SchemaOperation, Xi as CastMap, Xn as AttributeOptions, Xo as col, Xr as DeleteManySpec, Xs as FactoryCallback, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as SoftDeleteConfig, Yc as SchemaIndex, Yi as CastHandler, Yn as Attribute, Yo as coalesce, Yr as DatabaseValue, Ys as FactoryAttributes, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionCapableClient, Zc as SchemaPrimaryKey, Zi as CastType, Zn as Arkorm, Zo as count, Zr as DeleteSpec, Zs as FactoryDefinition, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationMeta, _c as DatabaseTableOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as DelegateForModelSchema, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateSelect, ac as CaseExpressionBranch, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateRow, ar as RuntimePathMap, as as sum, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PaginationURLDriverFactory, bc as BelongsToRelationMetadata, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributes, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateUpdateData, cc as ExpressionBinaryOperator, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelNameRegistry, cr as getRegisteredModels, cs as InlineFactory, ct as escapeRegex, d as inferDelegateName, da as EagerLoadMap, dc as FunctionExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeOrderBy, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateFindManyArgs, ec as FactoryRelationshipResolver, ei as PartitionedSelectSpec, el as SchemaTableDropOperation, en as deletePersistedColumnMappingsState, eo as ModelStatic, er as RegisteredFactory, es as fromExpressionNode, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as GetUserConfig, fc as InExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeQuerySchema, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationCurrentPageResolver, gc as ValueExpressionNode, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as AttributeWhereInput, gr as registerMigrations, gt as pad, h as defineConfig, ha as NamingCase, hc as RawExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeUpdateInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateRows, ic as BinaryExpressionNode, ii as QueryCondition, il as TimestampNaming, in as getPersistedPrimaryKeyGeneration, io as ExpressionSelectMap, ir as RuntimePathKey, is as raw, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionCapableClient, jc as MorphedByManyRelationMetadata, ji as RawQuerySpec, jn as TableBuilder, jo as ModelRelationshipKey, jr as KyselyDatabaseAdapter, js as RelationDefaultResolver, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaLikeWhereInput, kc as MorphToManyRelationMetadata, ki as QueryTarget, kn as SchemaBuilder, ko as ModelLifecycleState, kr as createPrismaCompatibilityAdapter, ks as RelationColumnLookupSpec, kt as buildMigrationRunId, l as createPrismaAdapter, la as DelegateWhere, lc as ExpressionJsonCast, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as ArkormModelRegistry, lr as getRegisteredPaths, ls as ModelFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as ModelTableCase, mc as NullCheckExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeSelect, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateOrderBy, nc as MaybePromise, ni as QueryComparisonCondition, nl as TimestampColumnBehavior, nn as getPersistedEnumMap, no as ChunkCallback, nr as RuntimeConstructor, ns as max, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUniqueWhere, oc as CaseExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as GroupByAggregateSpec, or as getRegisteredFactories, os as val, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelQuerySchemaLike, pc as JsonExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSchemaDelegate, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as Serializable, qc as SchemaForeignKey, qi as ArkormDebugHandler, qn as CliApp, qo as avg, qr as DatabaseRow, qs as ArkormCollection, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRow, rc as AggregateExpressionNode, ri as QueryComparisonOperator, rl as TimestampNames, rn as getPersistedEnumTsType, ro as EachCallback, rr as RuntimePathInput, rs as min, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateArgs, sc as ColumnExpressionNode, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as QueryBuilder, sr as getRegisteredMigrations, ss as where, st as deriveSingularFieldName, t as URLDriver, ta as DelegateInclude, tc as FactoryState, ti as QueryColumnComparisonCondition, tl as SchemaUniqueConstraint, tn as getPersistedColumnMap, to as RelationshipModelStatic, tr as RegisteredModel, ts as json, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadConstraint, uc as ExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeCreateInput, ur as getRegisteredSeeders, us as defineFactory, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationOptions, vc as DatabaseTablePersistedMetadataOptions, vi as QueryJoinType, vn as RelationResolutionException, vo as GlobalScope, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeInclude, wc as HasOneRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventDispatcher, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaClientLike, xc as ColumnMap, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelAttributesOf, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriver, yc as BelongsToManyRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributeValue, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaRows, zc as GeneratedMigrationFile, zi as UpdateManySpec, zn as MigrateFreshCommand, zo as RegisteredModelName, zr as AdapterModelStructure, zs as JoinOn, zt as markMigrationRun } from "./index-BSJFuytO.cjs";
|
|
1
|
+
import { $ as buildPrimaryKeyLine, $a as TransactionOptions, $c as SchemaTableCreateOperation, $i as DelegateCreateData, $n as getModel, $o as fn, $r as InsertSpec, $s as FactoryModelConstructor, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCallback, Ac as MorphToRelationMetadata, Ai as QueryTimeCondition, An as EnumBuilder, Ao as ModelOrderByInput, Ar as createPrismaDatabaseAdapter, As as RelationConstraint, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaSelect, Bc as MigrationClass, Bi as UpdateSpec, Bn as MigrateCommand, Bo as RelatedModelClass, Br as AdapterQueryOperation, Bs as JoinSource, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaFindManyArgsLike, Cc as HasManyThroughRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelDeclaredAttributeKey, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSelect, Dc as MorphManyRelationMetadata, Di as QueryScalarComparisonOperator, Dn as MIGRATION_BRAND, Do as ModelEventListener, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateInput, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeScalarFilter, Ec as ModelMetadata, Ei as QueryRelationCondition, En as DB, Eo as ModelEventHandlerConstructor, Er as SeederInput, Es as RelationAggregateConstraint, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaFindManyArgs, Fc as AppliedMigrationEntry, Fi as RelationLoadSpec, Fn as SeedCommand, Fo as QuerySchemaForModel, Fr as AdapterDatabaseCreationResult, Fs as RelationResultCache, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RawSelectInput, Gc as SchemaColumn, Gi as ArkormConfig, Gn as InitCommand, Go as ExpressionBuilder, Gr as DatabaseAdapter, Gs as LengthAwarePaginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateArgs, Hc as PrimaryKeyGeneration, Hi as AdapterBindableModel, Hn as MakeModelCommand, Ho as AggregateExpression, Hr as AggregateOperation, Hs as RelatedModelFromResult, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaInclude, Ic as AppliedMigrationRun, Ii as SelectSpec, In as ModelsSyncCommand, Io as QuerySchemaForModelInstance, Ir as AdapterInspectionRequest, Is as RelationTableLookupSpec, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SimplePaginationMeta, Jc as SchemaForeignKeyAction, Ji as CastDefinition, Jn as resolveCast, Jo as caseWhen, Jr as DatabaseRows, Js as FactoryAttributeResolver, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as RuntimeClientLike, Kc as SchemaColumnType, Ki as ArkormDebugEvent, Kn as DbCommand, Ko as JsonExpression, Kr as DatabasePrimitive, Ks as Paginator, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaOrderBy, Lc as AppliedMigrationsState, Li as SoftDeleteQueryMode, Ln as MigrationHistoryCommand, Lo as RegisteredModelClass, Lr as AdapterModelFieldStructure, Ls as EagerLoadQueryForRelationship, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionContext, Mc as PivotModelStatic, Mi as RelationAggregateSpec, Mn as GeneratedColumnExpression, Mo as ModelRelationshipResult, Mr as createKyselyAdapter, Ms as RelationDefaultValue, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as PrismaTransactionOptions, Nc as RelationMetadata, Ni as RelationFilterSpec, Nn as resolveGeneratedExpression, No as ModelUpdateData, Nr as AdapterCapabilities, Ns as RelationMetadataProvider, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeSortOrder, Oc as MorphOneRelationMetadata, Oi as QuerySelectColumn, On as Migration, Oo as ModelEventName, Or as PrismaDelegateNameMapping, Os as RelationAggregateType, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaCreateData, Pc as RelationMetadataType, Pi as RelationLoadPlan, Pn as ForeignKeyBuilder, Po as ModelWhereInput, Pr as AdapterCapability, Ps as RelationResult, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionContext, Qc as SchemaTableAlterOperation, Qi as ClientResolver, Qn as Arkormx, Qo as expressionBuilder, Qr as InsertManySpec, Qs as FactoryDefinitionAttributes, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRow, Rc as GenerateMigrationOptions, Ri as SortDirection, Rn as MigrateRollbackCommand, Ro as RegisteredModelInstance, Rr as AdapterModelIntrospectionOptions, Rs as EagerLoadRelations, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaDelegateLike, Sc as HasManyRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelCreateData, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeOrderBy, Tc as HasOneThroughRelationMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandler, Tr as SeederConstructor, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaUpdateData, Uc as PrismaMigrationWorkflowOptions, Ui as AdapterQueryInspection, Un as MakeMigrationCommand, Uo as CaseExpression, Ur as AggregateSelection, Us as WhereCallback, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUniqueWhere, Vc as MigrationInstanceLike, Vi as UpsertSpec, Vn as MakeSeederCommand, Vo as Model, Vr as AdapterTransactionContext, Vs as RelatedModelForRelationship, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as QuerySchemaWhere, Wc as PrismaSchemaSyncOptions, Wi as ArkormBootContext, Wn as MakeFactoryCommand, Wo as Expression, Wr as AggregateSpec, Ws as JoinClause, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCallback, Xc as SchemaOperation, Xi as CastMap, Xn as AttributeOptions, Xo as col, Xr as DeleteManySpec, Xs as FactoryCallback, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as SoftDeleteConfig, Yc as SchemaIndex, Yi as CastHandler, Yn as Attribute, Yo as coalesce, Yr as DatabaseValue, Ys as FactoryAttributes, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionCapableClient, Zc as SchemaPrimaryKey, Zi as CastType, Zn as Arkorm, Zo as count, Zr as DeleteSpec, Zs as FactoryDefinition, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationMeta, _c as DatabaseTableOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as DelegateForModelSchema, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateSelect, ac as CaseExpressionBranch, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateRow, ar as RuntimePathMap, as as sum, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PaginationURLDriverFactory, bc as BelongsToRelationMetadata, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributes, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateUpdateData, cc as ExpressionBinaryOperator, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelNameRegistry, cr as getRegisteredModels, cs as InlineFactory, ct as escapeRegex, d as inferDelegateName, da as EagerLoadMap, dc as FunctionExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeOrderBy, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateFindManyArgs, ec as FactoryRelationshipResolver, ei as PartitionedSelectSpec, el as SchemaTableDropOperation, en as deletePersistedColumnMappingsState, eo as ModelStatic, er as RegisteredFactory, es as fromExpressionNode, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as GetUserConfig, fc as InExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeQuerySchema, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationCurrentPageResolver, gc as ValueExpressionNode, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as AttributeWhereInput, gr as registerMigrations, gt as pad, h as defineConfig, ha as NamingCase, hc as RawExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeUpdateInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateRows, ic as BinaryExpressionNode, ii as QueryCondition, il as TimestampNaming, in as getPersistedPrimaryKeyGeneration, io as ExpressionSelectMap, ir as RuntimePathKey, is as raw, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionCapableClient, jc as MorphedByManyRelationMetadata, ji as RawQuerySpec, jn as TableBuilder, jo as ModelRelationshipKey, jr as KyselyDatabaseAdapter, js as RelationDefaultResolver, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaLikeWhereInput, kc as MorphToManyRelationMetadata, ki as QueryTarget, kn as SchemaBuilder, ko as ModelLifecycleState, kr as createPrismaCompatibilityAdapter, ks as RelationColumnLookupSpec, kt as buildMigrationRunId, l as createPrismaAdapter, la as DelegateWhere, lc as ExpressionJsonCast, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as ArkormModelRegistry, lr as getRegisteredPaths, ls as ModelFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as ModelTableCase, mc as NullCheckExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeSelect, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateOrderBy, nc as MaybePromise, ni as QueryComparisonCondition, nl as TimestampColumnBehavior, nn as getPersistedEnumMap, no as ChunkCallback, nr as RuntimeConstructor, ns as max, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUniqueWhere, oc as CaseExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as GroupByAggregateSpec, or as getRegisteredFactories, os as val, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelQuerySchemaLike, pc as JsonExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSchemaDelegate, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as Serializable, qc as SchemaForeignKey, qi as ArkormDebugHandler, qn as CliApp, qo as avg, qr as DatabaseRow, qs as ArkormCollection, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRow, rc as AggregateExpressionNode, ri as QueryComparisonOperator, rl as TimestampNames, rn as getPersistedEnumTsType, ro as EachCallback, rr as RuntimePathInput, rs as min, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateArgs, sc as ColumnExpressionNode, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as QueryBuilder, sr as getRegisteredMigrations, ss as where, st as deriveSingularFieldName, t as URLDriver, ta as DelegateInclude, tc as FactoryState, ti as QueryColumnComparisonCondition, tl as SchemaUniqueConstraint, tn as getPersistedColumnMap, to as RelationshipModelStatic, tr as RegisteredModel, ts as json, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadConstraint, uc as ExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeCreateInput, ur as getRegisteredSeeders, us as defineFactory, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationOptions, vc as DatabaseTablePersistedMetadataOptions, vi as QueryJoinType, vn as RelationResolutionException, vo as GlobalScope, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeInclude, wc as HasOneRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventDispatcher, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaClientLike, xc as ColumnMap, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelAttributesOf, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriver, yc as BelongsToManyRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributeValue, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaRows, zc as GeneratedMigrationFile, zi as UpdateManySpec, zn as MigrateFreshCommand, zo as RegisteredModelName, zr as AdapterModelStructure, zs as JoinOn, zt as markMigrationRun } from "./index-BbKMvoiA.cjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateExpression, AggregateExpressionNode, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, ArkormModelNameRegistry, ArkormModelRegistry, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, BinaryExpressionNode, CaseExpression, CaseExpressionBranch, CaseExpressionNode, CastDefinition, CastHandler, CastMap, CastType, ChunkCallback, CliApp, ClientResolver, ColumnExpressionNode, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DbCommand, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EachCallback, EagerLoadConstraint, EagerLoadMap, EagerLoadQueryForRelationship, EagerLoadRelations, EnumBuilder, Expression, ExpressionBinaryOperator, ExpressionBuilder, ExpressionJsonCast, ExpressionNode, ExpressionSelectMap, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, FunctionExpressionNode, GenerateMigrationOptions, GeneratedColumnExpression, GeneratedMigrationFile, GetUserConfig, GlobalScope, GroupByAggregateRow, GroupByAggregateSpec, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InExpressionNode, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, JsonExpression, JsonExpressionNode, KyselyDatabaseAdapter, LengthAwarePaginator, LoadedRuntimeModule, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MaybePromise, MigrateCommand, MigrateFreshCommand, MigrateRollbackCommand, Migration, MigrationClass, MigrationHistoryCommand, MigrationInstanceLike, MissingDelegateException, Model, ModelAttributeValue, ModelAttributes, ModelAttributesOf, ModelCreateData, ModelDeclaredAttributeKey, ModelEventDispatcher, ModelEventHandler, ModelEventHandlerConstructor, ModelEventListener, ModelEventName, ModelFactory, ModelLifecycleState, ModelMetadata, ModelNotFoundException, ModelOrderByInput, ModelQuerySchemaLike, ModelRelationshipKey, ModelRelationshipResult, ModelStatic, ModelTableCase, ModelUpdateData, ModelWhereInput, ModelsSyncCommand, MorphManyRelationMetadata, MorphOneRelationMetadata, MorphToManyRelationMetadata, MorphToRelationMetadata, MorphedByManyRelationMetadata, NamingCase, NullCheckExpressionNode, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PartitionedSelectSpec, PersistedColumnMappingsState, PersistedMetadataFeatures, PersistedPrimaryKeyGeneration, PersistedTableMetadata, PersistedTimestampColumn, PivotModel, PivotModelStatic, PrimaryKeyGeneration, PrimaryKeyGenerationPlanner, PrismaClientLike, PrismaDatabaseAdapter, PrismaDelegateLike, PrismaDelegateMap, PrismaDelegateNameMapping, PrismaFindManyArgsLike, PrismaLikeInclude, PrismaLikeOrderBy, PrismaLikeScalarFilter, PrismaLikeSelect, PrismaLikeSortOrder, PrismaLikeWhereInput, PrismaMigrationWorkflowOptions, PrismaSchemaSyncOptions, PrismaTransactionCallback, PrismaTransactionCapableClient, PrismaTransactionContext, PrismaTransactionOptions, QueryBuilder, QueryColumnComparisonCondition, QueryComparisonCondition, QueryComparisonOperator, QueryCondition, QueryConstraintException, QueryDayCondition, QueryExecutionException, QueryExecutionExceptionContext, QueryExistsCondition, QueryExpressionCondition, QueryFullTextCondition, QueryGroupByItem, QueryGroupCondition, QueryJoin, QueryJoinBoolean, QueryJoinColumnConstraint, QueryJoinConstraint, QueryJoinNestedConstraint, QueryJoinNullConstraint, QueryJoinRawConstraint, QueryJoinType, QueryJoinValueConstraint, QueryJsonCondition, QueryJsonConditionKind, QueryLogicalOperator, QueryNotCondition, QueryOrderBy, QueryRawCondition, QueryRelationCondition, QueryScalarComparisonOperator, QuerySchemaCreateData, QuerySchemaFindManyArgs, QuerySchemaForModel, QuerySchemaForModelInstance, QuerySchemaInclude, QuerySchemaOrderBy, QuerySchemaRow, QuerySchemaRows, QuerySchemaSelect, QuerySchemaUniqueWhere, QuerySchemaUpdateArgs, QuerySchemaUpdateData, QuerySchemaWhere, QuerySelectColumn, QueryTarget, QueryTimeCondition, RawExpressionNode, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RegisteredModelClass, RegisteredModelInstance, RegisteredModelName, RelatedModelClass, RelatedModelForRelationship, RelatedModelFromResult, RelationAggregateConstraint, RelationAggregateInput, RelationAggregateSpec, RelationAggregateType, RelationColumnLookupSpec, RelationConstraint, RelationDefaultResolver, RelationDefaultValue, RelationFilterSpec, RelationLoadPlan, RelationLoadSpec, RelationMetadata, RelationMetadataProvider, RelationMetadataType, RelationResolutionException, RelationResult, RelationResultCache, RelationTableLookupSpec, RelationshipModelStatic, RuntimeClientLike, RuntimeConstructor, RuntimeModuleLoader, RuntimePathInput, RuntimePathKey, RuntimePathMap, SEEDER_BRAND, SchemaBuilder, SchemaColumn, SchemaColumnType, SchemaForeignKey, SchemaForeignKeyAction, SchemaIndex, SchemaOperation, SchemaPrimaryKey, SchemaTableAlterOperation, SchemaTableCreateOperation, SchemaTableDropOperation, SchemaUniqueConstraint, ScopeNotDefinedException, SeedCommand, Seeder, SeederCallArgument, SeederConstructor, SeederInput, SelectSpec, Serializable, SimplePaginationMeta, SoftDeleteConfig, SoftDeleteQueryMode, SortDirection, TableBuilder, TimestampColumnBehavior, TimestampNames, TimestampNaming, TransactionCallback, TransactionCapableClient, TransactionContext, TransactionOptions, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, UpdateManySpec, UpdateSpec, UpsertSpec, ValueExpressionNode, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, avg, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, caseWhen, coalesce, col, computeMigrationChecksum, configureArkormRuntime, count, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, disposeArkormRuntime, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, expressionBuilder, findAppliedMigration, findEnumBlock, findModelBlock, fn, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, fromExpressionNode, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastBatchMigrations, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getModel, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, json, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, max, min, pad, raw, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveGeneratedExpression, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRegisteredModel, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, sum, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, val, validatePersistedMetadataFeaturesForMigrations, where, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as buildPrimaryKeyLine, $a as TransactionOptions, $c as SchemaTableCreateOperation, $i as DelegateCreateData, $n as getModel, $o as fn, $r as InsertSpec, $s as FactoryModelConstructor, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCallback, Ac as MorphToRelationMetadata, Ai as QueryTimeCondition, An as EnumBuilder, Ao as ModelOrderByInput, Ar as createPrismaDatabaseAdapter, As as RelationConstraint, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaSelect, Bc as MigrationClass, Bi as UpdateSpec, Bn as MigrateCommand, Bo as RelatedModelClass, Br as AdapterQueryOperation, Bs as JoinSource, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaFindManyArgsLike, Cc as HasManyThroughRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelDeclaredAttributeKey, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSelect, Dc as MorphManyRelationMetadata, Di as QueryScalarComparisonOperator, Dn as MIGRATION_BRAND, Do as ModelEventListener, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateInput, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeScalarFilter, Ec as ModelMetadata, Ei as QueryRelationCondition, En as DB, Eo as ModelEventHandlerConstructor, Er as SeederInput, Es as RelationAggregateConstraint, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaFindManyArgs, Fc as AppliedMigrationEntry, Fi as RelationLoadSpec, Fn as SeedCommand, Fo as QuerySchemaForModel, Fr as AdapterDatabaseCreationResult, Fs as RelationResultCache, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RawSelectInput, Gc as SchemaColumn, Gi as ArkormConfig, Gn as InitCommand, Go as ExpressionBuilder, Gr as DatabaseAdapter, Gs as LengthAwarePaginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateArgs, Hc as PrimaryKeyGeneration, Hi as AdapterBindableModel, Hn as MakeModelCommand, Ho as AggregateExpression, Hr as AggregateOperation, Hs as RelatedModelFromResult, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaInclude, Ic as AppliedMigrationRun, Ii as SelectSpec, In as ModelsSyncCommand, Io as QuerySchemaForModelInstance, Ir as AdapterInspectionRequest, Is as RelationTableLookupSpec, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SimplePaginationMeta, Jc as SchemaForeignKeyAction, Ji as CastDefinition, Jn as resolveCast, Jo as caseWhen, Jr as DatabaseRows, Js as FactoryAttributeResolver, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as RuntimeClientLike, Kc as SchemaColumnType, Ki as ArkormDebugEvent, Kn as DbCommand, Ko as JsonExpression, Kr as DatabasePrimitive, Ks as Paginator, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaOrderBy, Lc as AppliedMigrationsState, Li as SoftDeleteQueryMode, Ln as MigrationHistoryCommand, Lo as RegisteredModelClass, Lr as AdapterModelFieldStructure, Ls as EagerLoadQueryForRelationship, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionContext, Mc as PivotModelStatic, Mi as RelationAggregateSpec, Mn as GeneratedColumnExpression, Mo as ModelRelationshipResult, Mr as createKyselyAdapter, Ms as RelationDefaultValue, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as PrismaTransactionOptions, Nc as RelationMetadata, Ni as RelationFilterSpec, Nn as resolveGeneratedExpression, No as ModelUpdateData, Nr as AdapterCapabilities, Ns as RelationMetadataProvider, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeSortOrder, Oc as MorphOneRelationMetadata, Oi as QuerySelectColumn, On as Migration, Oo as ModelEventName, Or as PrismaDelegateNameMapping, Os as RelationAggregateType, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaCreateData, Pc as RelationMetadataType, Pi as RelationLoadPlan, Pn as ForeignKeyBuilder, Po as ModelWhereInput, Pr as AdapterCapability, Ps as RelationResult, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionContext, Qc as SchemaTableAlterOperation, Qi as ClientResolver, Qn as Arkormx, Qo as expressionBuilder, Qr as InsertManySpec, Qs as FactoryDefinitionAttributes, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRow, Rc as GenerateMigrationOptions, Ri as SortDirection, Rn as MigrateRollbackCommand, Ro as RegisteredModelInstance, Rr as AdapterModelIntrospectionOptions, Rs as EagerLoadRelations, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaDelegateLike, Sc as HasManyRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelCreateData, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeOrderBy, Tc as HasOneThroughRelationMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandler, Tr as SeederConstructor, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaUpdateData, Uc as PrismaMigrationWorkflowOptions, Ui as AdapterQueryInspection, Un as MakeMigrationCommand, Uo as CaseExpression, Ur as AggregateSelection, Us as WhereCallback, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUniqueWhere, Vc as MigrationInstanceLike, Vi as UpsertSpec, Vn as MakeSeederCommand, Vo as Model, Vr as AdapterTransactionContext, Vs as RelatedModelForRelationship, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as QuerySchemaWhere, Wc as PrismaSchemaSyncOptions, Wi as ArkormBootContext, Wn as MakeFactoryCommand, Wo as Expression, Wr as AggregateSpec, Ws as JoinClause, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCallback, Xc as SchemaOperation, Xi as CastMap, Xn as AttributeOptions, Xo as col, Xr as DeleteManySpec, Xs as FactoryCallback, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as SoftDeleteConfig, Yc as SchemaIndex, Yi as CastHandler, Yn as Attribute, Yo as coalesce, Yr as DatabaseValue, Ys as FactoryAttributes, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionCapableClient, Zc as SchemaPrimaryKey, Zi as CastType, Zn as Arkorm, Zo as count, Zr as DeleteSpec, Zs as FactoryDefinition, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationMeta, _c as DatabaseTableOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as DelegateForModelSchema, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateSelect, ac as CaseExpressionBranch, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateRow, ar as RuntimePathMap, as as sum, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PaginationURLDriverFactory, bc as BelongsToRelationMetadata, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributes, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateUpdateData, cc as ExpressionBinaryOperator, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelNameRegistry, cr as getRegisteredModels, cs as InlineFactory, ct as escapeRegex, d as inferDelegateName, da as EagerLoadMap, dc as FunctionExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeOrderBy, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateFindManyArgs, ec as FactoryRelationshipResolver, ei as PartitionedSelectSpec, el as SchemaTableDropOperation, en as deletePersistedColumnMappingsState, eo as ModelStatic, er as RegisteredFactory, es as fromExpressionNode, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as GetUserConfig, fc as InExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeQuerySchema, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationCurrentPageResolver, gc as ValueExpressionNode, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as AttributeWhereInput, gr as registerMigrations, gt as pad, h as defineConfig, ha as NamingCase, hc as RawExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeUpdateInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateRows, ic as BinaryExpressionNode, ii as QueryCondition, il as TimestampNaming, in as getPersistedPrimaryKeyGeneration, io as ExpressionSelectMap, ir as RuntimePathKey, is as raw, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionCapableClient, jc as MorphedByManyRelationMetadata, ji as RawQuerySpec, jn as TableBuilder, jo as ModelRelationshipKey, jr as KyselyDatabaseAdapter, js as RelationDefaultResolver, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaLikeWhereInput, kc as MorphToManyRelationMetadata, ki as QueryTarget, kn as SchemaBuilder, ko as ModelLifecycleState, kr as createPrismaCompatibilityAdapter, ks as RelationColumnLookupSpec, kt as buildMigrationRunId, l as createPrismaAdapter, la as DelegateWhere, lc as ExpressionJsonCast, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as ArkormModelRegistry, lr as getRegisteredPaths, ls as ModelFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as ModelTableCase, mc as NullCheckExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeSelect, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateOrderBy, nc as MaybePromise, ni as QueryComparisonCondition, nl as TimestampColumnBehavior, nn as getPersistedEnumMap, no as ChunkCallback, nr as RuntimeConstructor, ns as max, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUniqueWhere, oc as CaseExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as GroupByAggregateSpec, or as getRegisteredFactories, os as val, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelQuerySchemaLike, pc as JsonExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSchemaDelegate, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as Serializable, qc as SchemaForeignKey, qi as ArkormDebugHandler, qn as CliApp, qo as avg, qr as DatabaseRow, qs as ArkormCollection, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRow, rc as AggregateExpressionNode, ri as QueryComparisonOperator, rl as TimestampNames, rn as getPersistedEnumTsType, ro as EachCallback, rr as RuntimePathInput, rs as min, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateArgs, sc as ColumnExpressionNode, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as QueryBuilder, sr as getRegisteredMigrations, ss as where, st as deriveSingularFieldName, t as URLDriver, ta as DelegateInclude, tc as FactoryState, ti as QueryColumnComparisonCondition, tl as SchemaUniqueConstraint, tn as getPersistedColumnMap, to as RelationshipModelStatic, tr as RegisteredModel, ts as json, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadConstraint, uc as ExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeCreateInput, ur as getRegisteredSeeders, us as defineFactory, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationOptions, vc as DatabaseTablePersistedMetadataOptions, vi as QueryJoinType, vn as RelationResolutionException, vo as GlobalScope, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeInclude, wc as HasOneRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventDispatcher, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaClientLike, xc as ColumnMap, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelAttributesOf, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriver, yc as BelongsToManyRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributeValue, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaRows, zc as GeneratedMigrationFile, zi as UpdateManySpec, zn as MigrateFreshCommand, zo as RegisteredModelName, zr as AdapterModelStructure, zs as JoinOn, zt as markMigrationRun } from "./index-DJe32yxM.mjs";
|
|
1
|
+
import { $ as buildPrimaryKeyLine, $a as TransactionOptions, $c as SchemaTableCreateOperation, $i as DelegateCreateData, $n as getModel, $o as fn, $r as InsertSpec, $s as FactoryModelConstructor, $t as createEmptyPersistedColumnMappingsState, A as isQuerySchemaLike, Aa as PrismaTransactionCallback, Ac as MorphToRelationMetadata, Ai as QueryTimeCondition, An as EnumBuilder, Ao as ModelOrderByInput, Ar as createPrismaDatabaseAdapter, As as RelationConstraint, At as computeMigrationChecksum, B as applyCreateTableOperation, Ba as QuerySchemaSelect, Bc as MigrationClass, Bi as UpdateSpec, Bn as MigrateCommand, Bo as RelatedModelClass, Br as AdapterQueryOperation, Bs as JoinSource, Bt as readAppliedMigrationsState, C as getRuntimeClient, Ca as PrismaFindManyArgsLike, Cc as HasManyThroughRelationMetadata, Ci as QueryNotCondition, Cn as MissingDelegateException, Co as ModelDeclaredAttributeKey, Cr as Seeder, Ct as supportsDatabaseCreation, D as getRuntimePrismaClient, Da as PrismaLikeSelect, Dc as MorphManyRelationMetadata, Di as QueryScalarComparisonOperator, Dn as MIGRATION_BRAND, Do as ModelEventListener, Dr as PrismaDatabaseAdapter, Ds as RelationAggregateInput, Dt as toModelName, E as getRuntimePaginationURLDriverFactory, Ea as PrismaLikeScalarFilter, Ec as ModelMetadata, Ei as QueryRelationCondition, En as DB, Eo as ModelEventHandlerConstructor, Er as SeederInput, Es as RelationAggregateConstraint, Et as toMigrationFileSlug, F as PrimaryKeyGenerationPlanner, Fa as QuerySchemaFindManyArgs, Fc as AppliedMigrationEntry, Fi as RelationLoadSpec, Fn as SeedCommand, Fo as QuerySchemaForModel, Fr as AdapterDatabaseCreationResult, Fs as RelationResultCache, Ft as getLastMigrationRun, G as applyMigrationToPrismaSchema, Ga as RawSelectInput, Gc as SchemaColumn, Gi as ArkormConfig, Gn as InitCommand, Go as ExpressionBuilder, Gr as DatabaseAdapter, Gs as LengthAwarePaginator, Gt as writeAppliedMigrationsState, H as applyMigrationRollbackToDatabase, Ha as QuerySchemaUpdateArgs, Hc as PrimaryKeyGeneration, Hi as AdapterBindableModel, Hn as MakeModelCommand, Ho as AggregateExpression, Hr as AggregateOperation, Hs as RelatedModelFromResult, Ht as removeAppliedMigration, I as PRISMA_ENUM_MEMBER_REGEX, Ia as QuerySchemaInclude, Ic as AppliedMigrationRun, Ii as SelectSpec, In as ModelsSyncCommand, Io as QuerySchemaForModelInstance, Ir as AdapterInspectionRequest, Is as RelationTableLookupSpec, It as getLatestAppliedMigrations, J as buildFieldLine, Ja as SimplePaginationMeta, Jc as SchemaForeignKeyAction, Ji as CastDefinition, Jn as resolveCast, Jo as caseWhen, Jr as DatabaseRows, Js as FactoryAttributeResolver, Jt as PersistedMetadataFeatures, K as applyOperationsToPrismaSchema, Ka as RuntimeClientLike, Kc as SchemaColumnType, Ki as ArkormDebugEvent, Kn as DbCommand, Ko as JsonExpression, Kr as DatabasePrimitive, Ks as Paginator, Kt as writeAppliedMigrationsStateToStore, L as PRISMA_ENUM_REGEX, La as QuerySchemaOrderBy, Lc as AppliedMigrationsState, Li as SoftDeleteQueryMode, Ln as MigrationHistoryCommand, Lo as RegisteredModelClass, Lr as AdapterModelFieldStructure, Ls as EagerLoadQueryForRelationship, Lt as isMigrationApplied, M as loadArkormConfig, Ma as PrismaTransactionContext, Mc as PivotModelStatic, Mi as RelationAggregateSpec, Mn as GeneratedColumnExpression, Mo as ModelRelationshipResult, Mr as createKyselyAdapter, Ms as RelationDefaultValue, Mt as deleteAppliedMigrationsStateFromStore, N as resetArkormRuntimeForTests, Na as PrismaTransactionOptions, Nc as RelationMetadata, Ni as RelationFilterSpec, Nn as resolveGeneratedExpression, No as ModelUpdateData, Nr as AdapterCapabilities, Ns as RelationMetadataProvider, Nt as findAppliedMigration, O as getUserConfig, Oa as PrismaLikeSortOrder, Oc as MorphOneRelationMetadata, Oi as QuerySelectColumn, On as Migration, Oo as ModelEventName, Or as PrismaDelegateNameMapping, Os as RelationAggregateType, Ot as buildMigrationIdentity, P as runArkormTransaction, Pa as QuerySchemaCreateData, Pc as RelationMetadataType, Pi as RelationLoadPlan, Pn as ForeignKeyBuilder, Po as ModelWhereInput, Pr as AdapterCapability, Ps as RelationResult, Pt as getLastBatchMigrations, Q as buildModelBlock, Qa as TransactionContext, Qc as SchemaTableAlterOperation, Qi as ClientResolver, Qn as Arkormx, Qo as expressionBuilder, Qr as InsertManySpec, Qs as FactoryDefinitionAttributes, Qt as applyOperationsToPersistedColumnMappingsState, R as PRISMA_MODEL_REGEX, Ra as QuerySchemaRow, Rc as GenerateMigrationOptions, Ri as SortDirection, Rn as MigrateRollbackCommand, Ro as RegisteredModelInstance, Rr as AdapterModelIntrospectionOptions, Rs as EagerLoadRelations, Rt as markMigrationApplied, S as getRuntimeAdapter, Sa as PrismaDelegateLike, Sc as HasManyRelationMetadata, Si as QueryLogicalOperator, Sn as ModelNotFoundException, So as ModelCreateData, Sr as SEEDER_BRAND, St as stripPrismaSchemaModelsAndEnums, T as getRuntimePaginationCurrentPageResolver, Ta as PrismaLikeOrderBy, Tc as HasOneThroughRelationMetadata, Ti as QueryRawCondition, Tn as ArkormException, To as ModelEventHandler, Tr as SeederConstructor, Tt as supportsDatabaseReset, U as applyMigrationRollbackToPrismaSchema, Ua as QuerySchemaUpdateData, Uc as PrismaMigrationWorkflowOptions, Ui as AdapterQueryInspection, Un as MakeMigrationCommand, Uo as CaseExpression, Ur as AggregateSelection, Us as WhereCallback, Ut as resolveMigrationStateFilePath, V as applyDropTableOperation, Va as QuerySchemaUniqueWhere, Vc as MigrationInstanceLike, Vi as UpsertSpec, Vn as MakeSeederCommand, Vo as Model, Vr as AdapterTransactionContext, Vs as RelatedModelForRelationship, Vt as readAppliedMigrationsStateFromStore, W as applyMigrationToDatabase, Wa as QuerySchemaWhere, Wc as PrismaSchemaSyncOptions, Wi as ArkormBootContext, Wn as MakeFactoryCommand, Wo as Expression, Wr as AggregateSpec, Ws as JoinClause, Wt as supportsDatabaseMigrationState, X as buildInverseRelationLine, Xa as TransactionCallback, Xc as SchemaOperation, Xi as CastMap, Xn as AttributeOptions, Xo as col, Xr as DeleteManySpec, Xs as FactoryCallback, Xt as PersistedTableMetadata, Y as buildIndexLine, Ya as SoftDeleteConfig, Yc as SchemaIndex, Yi as CastHandler, Yn as Attribute, Yo as coalesce, Yr as DatabaseValue, Ys as FactoryAttributes, Yt as PersistedPrimaryKeyGeneration, Z as buildMigrationSource, Za as TransactionCapableClient, Zc as SchemaPrimaryKey, Zi as CastType, Zn as Arkorm, Zo as count, Zr as DeleteSpec, Zs as FactoryDefinition, Zt as PersistedTimestampColumn, _ as emitRuntimeDebugEvent, _a as PaginationMeta, _c as DatabaseTableOptions, _i as QueryJoinRawConstraint, _n as ScopeNotDefinedException, _o as DelegateForModelSchema, _r as registerModels, _t as resolveEnumName, a as getRuntimeCompatibilityAdapter, aa as DelegateSelect, ac as CaseExpressionBranch, ai as QueryDayCondition, an as getPersistedTableMetadata, ao as GroupByAggregateRow, ar as RuntimePathMap, as as sum, at as deriveRelationAlias, b as getActiveTransactionClient, ba as PaginationURLDriverFactory, bc as BelongsToRelationMetadata, bi as QueryJsonCondition, bn as QueryExecutionExceptionContext, bo as ModelAttributes, br as resetRuntimeRegistryForTests, bt as runMigrationWithPrisma, c as PrismaDelegateMap, ca as DelegateUpdateData, cc as ExpressionBinaryOperator, ci as QueryFullTextCondition, cn as rebuildPersistedColumnMappingsState, co as ArkormModelNameRegistry, cr as getRegisteredModels, cs as InlineFactory, ct as escapeRegex, d as inferDelegateName, da as EagerLoadMap, dc as FunctionExpressionNode, di as QueryJoin, dn as resolvePersistedMetadataFeatures, do as AttributeOrderBy, dr as loadFactoriesFrom, dt as formatDefaultValue, ea as DelegateFindManyArgs, ec as FactoryRelationshipResolver, ei as PartitionedSelectSpec, el as SchemaTableDropOperation, en as deletePersistedColumnMappingsState, eo as ModelStatic, er as RegisteredFactory, es as fromExpressionNode, et as buildRelationLine, f as awaitConfiguredModelsRegistration, fa as GetUserConfig, fc as InExpressionNode, fi as QueryJoinBoolean, fn as syncPersistedColumnMappingsFromState, fo as AttributeQuerySchema, fr as loadMigrationsFrom, ft as formatEnumDefaultValue, g as disposeArkormRuntime, ga as PaginationCurrentPageResolver, gc as ValueExpressionNode, gi as QueryJoinNullConstraint, gn as UniqueConstraintResolutionException, go as AttributeWhereInput, gr as registerMigrations, gt as pad, h as defineConfig, ha as NamingCase, hc as RawExpressionNode, hi as QueryJoinNestedConstraint, hn as UnsupportedAdapterFeatureException, ho as AttributeUpdateInput, hr as registerFactories, ht as getMigrationPlan, i as RuntimeModuleLoader, ia as DelegateRows, ic as BinaryExpressionNode, ii as QueryCondition, il as TimestampNaming, in as getPersistedPrimaryKeyGeneration, io as ExpressionSelectMap, ir as RuntimePathKey, is as raw, it as deriveInverseRelationAlias, j as isTransactionCapableClient, ja as PrismaTransactionCapableClient, jc as MorphedByManyRelationMetadata, ji as RawQuerySpec, jn as TableBuilder, jo as ModelRelationshipKey, jr as KyselyDatabaseAdapter, js as RelationDefaultResolver, jt as createEmptyAppliedMigrationsState, k as isDelegateLike, ka as PrismaLikeWhereInput, kc as MorphToManyRelationMetadata, ki as QueryTarget, kn as SchemaBuilder, ko as ModelLifecycleState, kr as createPrismaCompatibilityAdapter, ks as RelationColumnLookupSpec, kt as buildMigrationRunId, l as createPrismaAdapter, la as DelegateWhere, lc as ExpressionJsonCast, li as QueryGroupByItem, ln as resetPersistedColumnMappingsCache, lo as ArkormModelRegistry, lr as getRegisteredPaths, ls as ModelFactory, lt as findEnumBlock, m as configureArkormRuntime, ma as ModelTableCase, mc as NullCheckExpressionNode, mi as QueryJoinConstraint, mn as writePersistedColumnMappingsState, mo as AttributeSelect, mr as loadSeedersFrom, mt as generateMigrationFile, n as PivotModel, na as DelegateOrderBy, nc as MaybePromise, ni as QueryComparisonCondition, nl as TimestampColumnBehavior, nn as getPersistedEnumMap, no as ChunkCallback, nr as RuntimeConstructor, ns as max, nt as createMigrationTimestamp, o as resolveRuntimeCompatibilityQuerySchema, oa as DelegateUniqueWhere, oc as CaseExpressionNode, oi as QueryExistsCondition, on as getPersistedTimestampColumns, oo as GroupByAggregateSpec, or as getRegisteredFactories, os as val, ot as deriveRelationFieldName, p as bindAdapterToModels, pa as ModelQuerySchemaLike, pc as JsonExpressionNode, pi as QueryJoinColumnConstraint, pn as validatePersistedMetadataFeaturesForMigrations, po as AttributeSchemaDelegate, pr as loadModelsFrom, pt as formatRelationAction, q as buildEnumBlock, qa as Serializable, qc as SchemaForeignKey, qi as ArkormDebugHandler, qn as CliApp, qo as avg, qr as DatabaseRow, qs as ArkormCollection, qt as PersistedColumnMappingsState, r as LoadedRuntimeModule, ra as DelegateRow, rc as AggregateExpressionNode, ri as QueryComparisonOperator, rl as TimestampNames, rn as getPersistedEnumTsType, ro as EachCallback, rr as RuntimePathInput, rs as min, rt as deriveCollectionFieldName, s as resolveRuntimeCompatibilityQuerySchemaOrThrow, sa as DelegateUpdateArgs, sc as ColumnExpressionNode, si as QueryExpressionCondition, sn as readPersistedColumnMappingsState, so as QueryBuilder, sr as getRegisteredMigrations, ss as where, st as deriveSingularFieldName, t as URLDriver, ta as DelegateInclude, tc as FactoryState, ti as QueryColumnComparisonCondition, tl as SchemaUniqueConstraint, tn as getPersistedColumnMap, to as RelationshipModelStatic, tr as RegisteredModel, ts as json, tt as buildUniqueConstraintLine, u as createPrismaDelegateMap, ua as EagerLoadConstraint, uc as ExpressionNode, ui as QueryGroupCondition, un as resolveColumnMappingsFilePath, uo as AttributeCreateInput, ur as getRegisteredSeeders, us as defineFactory, ut as findModelBlock, v as ensureArkormConfigLoading, va as PaginationOptions, vc as DatabaseTablePersistedMetadataOptions, vi as QueryJoinType, vn as RelationResolutionException, vo as GlobalScope, vr as registerPaths, vt as resolveMigrationClassName, w as getRuntimeDebugHandler, wa as PrismaLikeInclude, wc as HasOneRelationMetadata, wi as QueryOrderBy, wn as ArkormErrorContext, wo as ModelEventDispatcher, wr as SeederCallArgument, wt as supportsDatabaseMigrationExecution, x as getDefaultStubsPath, xa as PrismaClientLike, xc as ColumnMap, xi as QueryJsonConditionKind, xn as QueryConstraintException, xo as ModelAttributesOf, xr as resolveRegisteredModel, xt as runPrismaCommand, y as getActiveTransactionAdapter, ya as PaginationURLDriver, yc as BelongsToManyRelationMetadata, yi as QueryJoinValueConstraint, yn as QueryExecutionException, yo as ModelAttributeValue, yr as registerSeeders, yt as resolvePrismaType, z as applyAlterTableOperation, za as QuerySchemaRows, zc as GeneratedMigrationFile, zi as UpdateManySpec, zn as MigrateFreshCommand, zo as RegisteredModelName, zr as AdapterModelStructure, zs as JoinOn, zt as markMigrationRun } from "./index-ChLGDqKz.mjs";
|
|
2
2
|
export { AdapterBindableModel, AdapterCapabilities, AdapterCapability, AdapterDatabaseCreationResult, AdapterInspectionRequest, AdapterModelFieldStructure, AdapterModelIntrospectionOptions, AdapterModelStructure, AdapterQueryInspection, AdapterQueryOperation, AdapterTransactionContext, AggregateExpression, AggregateExpressionNode, AggregateOperation, AggregateSelection, AggregateSpec, AppliedMigrationEntry, AppliedMigrationRun, AppliedMigrationsState, Arkorm, ArkormBootContext, ArkormCollection, ArkormConfig, ArkormDebugEvent, ArkormDebugHandler, ArkormErrorContext, ArkormException, ArkormModelNameRegistry, ArkormModelRegistry, Arkormx, Attribute, AttributeCreateInput, AttributeOptions, AttributeOrderBy, AttributeQuerySchema, AttributeSchemaDelegate, AttributeSelect, AttributeUpdateInput, AttributeWhereInput, BelongsToManyRelationMetadata, BelongsToRelationMetadata, BinaryExpressionNode, CaseExpression, CaseExpressionBranch, CaseExpressionNode, CastDefinition, CastHandler, CastMap, CastType, ChunkCallback, CliApp, ClientResolver, ColumnExpressionNode, ColumnMap, DB, DatabaseAdapter, DatabasePrimitive, DatabaseRow, DatabaseRows, DatabaseTableOptions, DatabaseTablePersistedMetadataOptions, DatabaseValue, DbCommand, DelegateCreateData, DelegateFindManyArgs, DelegateForModelSchema, DelegateInclude, DelegateOrderBy, DelegateRow, DelegateRows, DelegateSelect, DelegateUniqueWhere, DelegateUpdateArgs, DelegateUpdateData, DelegateWhere, DeleteManySpec, DeleteSpec, EachCallback, EagerLoadConstraint, EagerLoadMap, EagerLoadQueryForRelationship, EagerLoadRelations, EnumBuilder, Expression, ExpressionBinaryOperator, ExpressionBuilder, ExpressionJsonCast, ExpressionNode, ExpressionSelectMap, FactoryAttributeResolver, FactoryAttributes, FactoryCallback, FactoryDefinition, FactoryDefinitionAttributes, FactoryModelConstructor, FactoryRelationshipResolver, FactoryState, ForeignKeyBuilder, FunctionExpressionNode, GenerateMigrationOptions, GeneratedColumnExpression, GeneratedMigrationFile, GetUserConfig, GlobalScope, GroupByAggregateRow, GroupByAggregateSpec, HasManyRelationMetadata, HasManyThroughRelationMetadata, HasOneRelationMetadata, HasOneThroughRelationMetadata, InExpressionNode, InitCommand, InlineFactory, InsertManySpec, InsertSpec, JoinClause, JoinOn, JoinSource, JsonExpression, JsonExpressionNode, KyselyDatabaseAdapter, LengthAwarePaginator, LoadedRuntimeModule, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MaybePromise, MigrateCommand, MigrateFreshCommand, MigrateRollbackCommand, Migration, MigrationClass, MigrationHistoryCommand, MigrationInstanceLike, MissingDelegateException, Model, ModelAttributeValue, ModelAttributes, ModelAttributesOf, ModelCreateData, ModelDeclaredAttributeKey, ModelEventDispatcher, ModelEventHandler, ModelEventHandlerConstructor, ModelEventListener, ModelEventName, ModelFactory, ModelLifecycleState, ModelMetadata, ModelNotFoundException, ModelOrderByInput, ModelQuerySchemaLike, ModelRelationshipKey, ModelRelationshipResult, ModelStatic, ModelTableCase, ModelUpdateData, ModelWhereInput, ModelsSyncCommand, MorphManyRelationMetadata, MorphOneRelationMetadata, MorphToManyRelationMetadata, MorphToRelationMetadata, MorphedByManyRelationMetadata, NamingCase, NullCheckExpressionNode, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, PaginationCurrentPageResolver, PaginationMeta, PaginationOptions, PaginationURLDriver, PaginationURLDriverFactory, Paginator, PartitionedSelectSpec, PersistedColumnMappingsState, PersistedMetadataFeatures, PersistedPrimaryKeyGeneration, PersistedTableMetadata, PersistedTimestampColumn, PivotModel, PivotModelStatic, PrimaryKeyGeneration, PrimaryKeyGenerationPlanner, PrismaClientLike, PrismaDatabaseAdapter, PrismaDelegateLike, PrismaDelegateMap, PrismaDelegateNameMapping, PrismaFindManyArgsLike, PrismaLikeInclude, PrismaLikeOrderBy, PrismaLikeScalarFilter, PrismaLikeSelect, PrismaLikeSortOrder, PrismaLikeWhereInput, PrismaMigrationWorkflowOptions, PrismaSchemaSyncOptions, PrismaTransactionCallback, PrismaTransactionCapableClient, PrismaTransactionContext, PrismaTransactionOptions, QueryBuilder, QueryColumnComparisonCondition, QueryComparisonCondition, QueryComparisonOperator, QueryCondition, QueryConstraintException, QueryDayCondition, QueryExecutionException, QueryExecutionExceptionContext, QueryExistsCondition, QueryExpressionCondition, QueryFullTextCondition, QueryGroupByItem, QueryGroupCondition, QueryJoin, QueryJoinBoolean, QueryJoinColumnConstraint, QueryJoinConstraint, QueryJoinNestedConstraint, QueryJoinNullConstraint, QueryJoinRawConstraint, QueryJoinType, QueryJoinValueConstraint, QueryJsonCondition, QueryJsonConditionKind, QueryLogicalOperator, QueryNotCondition, QueryOrderBy, QueryRawCondition, QueryRelationCondition, QueryScalarComparisonOperator, QuerySchemaCreateData, QuerySchemaFindManyArgs, QuerySchemaForModel, QuerySchemaForModelInstance, QuerySchemaInclude, QuerySchemaOrderBy, QuerySchemaRow, QuerySchemaRows, QuerySchemaSelect, QuerySchemaUniqueWhere, QuerySchemaUpdateArgs, QuerySchemaUpdateData, QuerySchemaWhere, QuerySelectColumn, QueryTarget, QueryTimeCondition, RawExpressionNode, RawQuerySpec, RawSelectInput, RegisteredFactory, RegisteredModel, RegisteredModelClass, RegisteredModelInstance, RegisteredModelName, RelatedModelClass, RelatedModelForRelationship, RelatedModelFromResult, RelationAggregateConstraint, RelationAggregateInput, RelationAggregateSpec, RelationAggregateType, RelationColumnLookupSpec, RelationConstraint, RelationDefaultResolver, RelationDefaultValue, RelationFilterSpec, RelationLoadPlan, RelationLoadSpec, RelationMetadata, RelationMetadataProvider, RelationMetadataType, RelationResolutionException, RelationResult, RelationResultCache, RelationTableLookupSpec, RelationshipModelStatic, RuntimeClientLike, RuntimeConstructor, RuntimeModuleLoader, RuntimePathInput, RuntimePathKey, RuntimePathMap, SEEDER_BRAND, SchemaBuilder, SchemaColumn, SchemaColumnType, SchemaForeignKey, SchemaForeignKeyAction, SchemaIndex, SchemaOperation, SchemaPrimaryKey, SchemaTableAlterOperation, SchemaTableCreateOperation, SchemaTableDropOperation, SchemaUniqueConstraint, ScopeNotDefinedException, SeedCommand, Seeder, SeederCallArgument, SeederConstructor, SeederInput, SelectSpec, Serializable, SimplePaginationMeta, SoftDeleteConfig, SoftDeleteQueryMode, SortDirection, TableBuilder, TimestampColumnBehavior, TimestampNames, TimestampNaming, TransactionCallback, TransactionCapableClient, TransactionContext, TransactionOptions, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, UpdateManySpec, UpdateSpec, UpsertSpec, ValueExpressionNode, WhereCallback, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToDatabase, applyMigrationRollbackToPrismaSchema, applyMigrationToDatabase, applyMigrationToPrismaSchema, applyOperationsToPersistedColumnMappingsState, applyOperationsToPrismaSchema, avg, awaitConfiguredModelsRegistration, bindAdapterToModels, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildPrimaryKeyLine, buildRelationLine, buildUniqueConstraintLine, caseWhen, coalesce, col, computeMigrationChecksum, configureArkormRuntime, count, createEmptyAppliedMigrationsState, createEmptyPersistedColumnMappingsState, createKyselyAdapter, createMigrationTimestamp, createPrismaAdapter, createPrismaCompatibilityAdapter, createPrismaDatabaseAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deleteAppliedMigrationsStateFromStore, deletePersistedColumnMappingsState, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, disposeArkormRuntime, emitRuntimeDebugEvent, ensureArkormConfigLoading, escapeRegex, expressionBuilder, findAppliedMigration, findEnumBlock, findModelBlock, fn, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, fromExpressionNode, generateMigrationFile, getActiveTransactionAdapter, getActiveTransactionClient, getDefaultStubsPath, getLastBatchMigrations, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getModel, getPersistedColumnMap, getPersistedEnumMap, getPersistedEnumTsType, getPersistedPrimaryKeyGeneration, getPersistedTableMetadata, getPersistedTimestampColumns, getRegisteredFactories, getRegisteredMigrations, getRegisteredModels, getRegisteredPaths, getRegisteredSeeders, getRuntimeAdapter, getRuntimeClient, getRuntimeCompatibilityAdapter, getRuntimeDebugHandler, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isQuerySchemaLike, isTransactionCapableClient, json, loadArkormConfig, loadFactoriesFrom, loadMigrationsFrom, loadModelsFrom, loadSeedersFrom, markMigrationApplied, markMigrationRun, max, min, pad, raw, readAppliedMigrationsState, readAppliedMigrationsStateFromStore, readPersistedColumnMappingsState, rebuildPersistedColumnMappingsState, registerFactories, registerMigrations, registerModels, registerPaths, registerSeeders, removeAppliedMigration, resetArkormRuntimeForTests, resetPersistedColumnMappingsCache, resetRuntimeRegistryForTests, resolveCast, resolveColumnMappingsFilePath, resolveEnumName, resolveGeneratedExpression, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePersistedMetadataFeatures, resolvePrismaType, resolveRegisteredModel, resolveRuntimeCompatibilityQuerySchema, resolveRuntimeCompatibilityQuerySchemaOrThrow, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, stripPrismaSchemaModelsAndEnums, sum, supportsDatabaseCreation, supportsDatabaseMigrationExecution, supportsDatabaseMigrationState, supportsDatabaseReset, syncPersistedColumnMappingsFromState, toMigrationFileSlug, toModelName, val, validatePersistedMetadataFeaturesForMigrations, where, writeAppliedMigrationsState, writeAppliedMigrationsStateToStore, writePersistedColumnMappingsState };
|
package/dist/index.mjs
CHANGED
|
@@ -5185,19 +5185,13 @@ var QueryBuilder = class QueryBuilder {
|
|
|
5185
5185
|
return operator;
|
|
5186
5186
|
}
|
|
5187
5187
|
/**
|
|
5188
|
-
* Appends a pre-built structured condition
|
|
5189
|
-
* legacy where into the structured representation so the two combine correctly.
|
|
5188
|
+
* Appends a pre-built structured condition.
|
|
5190
5189
|
*
|
|
5191
5190
|
* @param boolean
|
|
5192
5191
|
* @param condition
|
|
5193
5192
|
* @returns
|
|
5194
5193
|
*/
|
|
5195
5194
|
appendStructuredWhere(boolean, condition) {
|
|
5196
|
-
if (this.legacyWhere) {
|
|
5197
|
-
const existing = this.tryBuildQueryCondition(this.legacyWhere);
|
|
5198
|
-
this.legacyWhere = void 0;
|
|
5199
|
-
if (existing) this.queryWhere = existing;
|
|
5200
|
-
}
|
|
5201
5195
|
this.appendQueryCondition(boolean, condition);
|
|
5202
5196
|
return this;
|
|
5203
5197
|
}
|
|
@@ -5865,6 +5859,10 @@ var QueryBuilder = class QueryBuilder {
|
|
|
5865
5859
|
};
|
|
5866
5860
|
return this;
|
|
5867
5861
|
}
|
|
5862
|
+
if (!this.legacyWhere && this.queryWhere && !this.isSchemaWhereRepresentable(this.queryWhere)) throw new UnsupportedAdapterFeatureException("This where clause cannot be combined with the raw, JSON, relation, or expression constraints already on the query.", {
|
|
5863
|
+
operation: "query.where",
|
|
5864
|
+
model: this.model.name
|
|
5865
|
+
});
|
|
5868
5866
|
const existingWhere = this.legacyWhere ?? this.toQuerySchemaWhere(this.queryWhere);
|
|
5869
5867
|
this.queryWhere = void 0;
|
|
5870
5868
|
if (!existingWhere) {
|
|
@@ -7401,20 +7399,19 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7401
7399
|
* @returns
|
|
7402
7400
|
*/
|
|
7403
7401
|
async update(data) {
|
|
7404
|
-
const
|
|
7405
|
-
|
|
7406
|
-
operation: "update",
|
|
7407
|
-
model: this.model.name
|
|
7408
|
-
});
|
|
7409
|
-
const directSpec = this.tryBuildUpdateSpec(where, data);
|
|
7402
|
+
const condition = this.buildWriteCondition("update", "Update");
|
|
7403
|
+
const uniqueWhere = this.uniqueWhereFor(condition);
|
|
7410
7404
|
const adapter = this.requireAdapter();
|
|
7411
|
-
if (!
|
|
7412
|
-
const updated = await adapter.updateFirst(
|
|
7405
|
+
if (!uniqueWhere && typeof adapter.updateFirst === "function") {
|
|
7406
|
+
const updated = await adapter.updateFirst({
|
|
7407
|
+
target: this.buildQueryTarget(),
|
|
7408
|
+
where: condition,
|
|
7409
|
+
values: data
|
|
7410
|
+
});
|
|
7413
7411
|
if (!updated) throw new ModelNotFoundException(this.model.name, "Record not found for update operation.", { operation: "update" });
|
|
7414
7412
|
return this.model.hydrate(updated);
|
|
7415
7413
|
}
|
|
7416
|
-
const
|
|
7417
|
-
const updated = await this.executeUpdateRow(uniqueWhere, data);
|
|
7414
|
+
const updated = await this.executeUpdateRow(uniqueWhere ?? await this.resolveUniqueWhere(condition), data);
|
|
7418
7415
|
return this.model.hydrate(updated);
|
|
7419
7416
|
}
|
|
7420
7417
|
/**
|
|
@@ -7425,12 +7422,8 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7425
7422
|
* @returns
|
|
7426
7423
|
*/
|
|
7427
7424
|
async updateFrom(data) {
|
|
7428
|
-
const
|
|
7429
|
-
|
|
7430
|
-
operation: "updateFrom",
|
|
7431
|
-
model: this.model.name
|
|
7432
|
-
});
|
|
7433
|
-
return await this.executeUpdateManyRows(where, data);
|
|
7425
|
+
const condition = this.buildWriteCondition("updateFrom", "Update");
|
|
7426
|
+
return await this.executeUpdateManyRows(condition, data);
|
|
7434
7427
|
}
|
|
7435
7428
|
/**
|
|
7436
7429
|
* Insert a record when no match exists, otherwise update the matching record.
|
|
@@ -7519,12 +7512,7 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7519
7512
|
* @returns the count of deleted rows (0 when nothing matched)
|
|
7520
7513
|
*/
|
|
7521
7514
|
async delete() {
|
|
7522
|
-
|
|
7523
|
-
if (!where) throw new QueryConstraintException("Delete requires a where clause.", {
|
|
7524
|
-
operation: "delete",
|
|
7525
|
-
model: this.model.name
|
|
7526
|
-
});
|
|
7527
|
-
return this.executeDeleteManyRows(where);
|
|
7515
|
+
return this.executeDeleteManyRows(this.buildWriteCondition("delete", "Delete"));
|
|
7528
7516
|
}
|
|
7529
7517
|
/**
|
|
7530
7518
|
* Deletes every record matching the current query constraints and throws when
|
|
@@ -7572,9 +7560,7 @@ var QueryBuilder = class QueryBuilder {
|
|
|
7572
7560
|
values
|
|
7573
7561
|
};
|
|
7574
7562
|
}
|
|
7575
|
-
tryBuildUpdateManySpec(
|
|
7576
|
-
const condition = this.tryBuildQueryCondition(where);
|
|
7577
|
-
if (condition === null) return null;
|
|
7563
|
+
tryBuildUpdateManySpec(condition, values) {
|
|
7578
7564
|
return {
|
|
7579
7565
|
target: this.buildQueryTarget(),
|
|
7580
7566
|
where: condition,
|
|
@@ -8186,7 +8172,23 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8186
8172
|
}
|
|
8187
8173
|
return plans;
|
|
8188
8174
|
}
|
|
8175
|
+
/**
|
|
8176
|
+
* Appends a structured condition, first flushing any Prisma-like legacy
|
|
8177
|
+
* where into the structured representation so that neither is lost.
|
|
8178
|
+
*
|
|
8179
|
+
* @param operator
|
|
8180
|
+
* @param condition
|
|
8181
|
+
*/
|
|
8189
8182
|
appendQueryCondition(operator, condition) {
|
|
8183
|
+
if (this.legacyWhere) {
|
|
8184
|
+
const existing = this.tryBuildQueryCondition(this.legacyWhere);
|
|
8185
|
+
if (existing === null) throw new UnsupportedAdapterFeatureException("This constraint cannot be combined with the where clause already on the query.", {
|
|
8186
|
+
operation: "query.where",
|
|
8187
|
+
model: this.model.name
|
|
8188
|
+
});
|
|
8189
|
+
this.legacyWhere = void 0;
|
|
8190
|
+
if (existing) this.queryWhere = existing;
|
|
8191
|
+
}
|
|
8190
8192
|
if (!this.queryWhere) {
|
|
8191
8193
|
this.queryWhere = condition;
|
|
8192
8194
|
return;
|
|
@@ -8197,6 +8199,19 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8197
8199
|
conditions: [this.queryWhere, condition]
|
|
8198
8200
|
};
|
|
8199
8201
|
}
|
|
8202
|
+
/**
|
|
8203
|
+
* Whether a condition survives conversion to the Prisma-like where shape;
|
|
8204
|
+
* only comparisons and groups or negations of them do.
|
|
8205
|
+
*
|
|
8206
|
+
* @param condition
|
|
8207
|
+
* @returns
|
|
8208
|
+
*/
|
|
8209
|
+
isSchemaWhereRepresentable(condition) {
|
|
8210
|
+
if (condition.type === "comparison") return true;
|
|
8211
|
+
if (condition.type === "group") return condition.conditions.every((entry) => this.isSchemaWhereRepresentable(entry));
|
|
8212
|
+
if (condition.type === "not") return this.isSchemaWhereRepresentable(condition.condition);
|
|
8213
|
+
return false;
|
|
8214
|
+
}
|
|
8200
8215
|
toQuerySchemaWhere(condition) {
|
|
8201
8216
|
if (!condition) return void 0;
|
|
8202
8217
|
if (condition.type === "comparison") {
|
|
@@ -8577,14 +8592,10 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8577
8592
|
if (!updated) throw new ModelNotFoundException(this.model.name, "Record not found for update operation.", { operation: "update" });
|
|
8578
8593
|
return updated;
|
|
8579
8594
|
}
|
|
8580
|
-
async executeUpdateManyRows(
|
|
8595
|
+
async executeUpdateManyRows(condition, values) {
|
|
8581
8596
|
const adapter = this.requireAdapter();
|
|
8582
8597
|
const normalizedValues = this.normalizeUpdatePayload(values);
|
|
8583
|
-
const spec = this.tryBuildUpdateManySpec(
|
|
8584
|
-
if (!spec) throw new UnsupportedAdapterFeatureException("Update-many could not be compiled into an Arkorm update specification.", {
|
|
8585
|
-
operation: "query.updateMany",
|
|
8586
|
-
model: this.model.name
|
|
8587
|
-
});
|
|
8598
|
+
const spec = this.tryBuildUpdateManySpec(condition, normalizedValues);
|
|
8588
8599
|
if (typeof adapter.updateMany === "function") return await adapter.updateMany(spec);
|
|
8589
8600
|
const rows = await adapter.select({
|
|
8590
8601
|
target: spec.target,
|
|
@@ -8602,13 +8613,8 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8602
8613
|
}
|
|
8603
8614
|
return updated;
|
|
8604
8615
|
}
|
|
8605
|
-
async executeDeleteManyRows(
|
|
8616
|
+
async executeDeleteManyRows(condition) {
|
|
8606
8617
|
const adapter = this.requireAdapter();
|
|
8607
|
-
const condition = this.tryBuildQueryCondition(where);
|
|
8608
|
-
if (condition === null) throw new UnsupportedAdapterFeatureException("Delete could not be compiled into an Arkorm delete specification.", {
|
|
8609
|
-
operation: "query.delete",
|
|
8610
|
-
model: this.model.name
|
|
8611
|
-
});
|
|
8612
8618
|
const spec = {
|
|
8613
8619
|
target: this.buildQueryTarget(),
|
|
8614
8620
|
where: condition
|
|
@@ -8630,6 +8636,39 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8630
8636
|
return deleted;
|
|
8631
8637
|
}
|
|
8632
8638
|
/**
|
|
8639
|
+
* The complete where condition for a write, built the same way reads build
|
|
8640
|
+
* theirs so that every constraint (raw, JSON, relation, expression, and the
|
|
8641
|
+
* rest) narrows the write. A write without constraints is refused.
|
|
8642
|
+
*
|
|
8643
|
+
* @param operation
|
|
8644
|
+
* @param label
|
|
8645
|
+
* @returns
|
|
8646
|
+
*/
|
|
8647
|
+
buildWriteCondition(operation, label) {
|
|
8648
|
+
const condition = this.buildQueryWhereCondition();
|
|
8649
|
+
if (condition === null) throw new UnsupportedAdapterFeatureException(`${label} could not be compiled into an Arkorm ${label.toLowerCase()} specification.`, {
|
|
8650
|
+
operation: `query.${operation}`,
|
|
8651
|
+
model: this.model.name
|
|
8652
|
+
});
|
|
8653
|
+
if (!condition) throw new QueryConstraintException(`${label} requires a where clause.`, {
|
|
8654
|
+
operation,
|
|
8655
|
+
model: this.model.name
|
|
8656
|
+
});
|
|
8657
|
+
return condition;
|
|
8658
|
+
}
|
|
8659
|
+
/**
|
|
8660
|
+
* The primary-key lookup a condition amounts to, when it is nothing more
|
|
8661
|
+
* than an equality on the primary key.
|
|
8662
|
+
*
|
|
8663
|
+
* @param condition
|
|
8664
|
+
* @returns
|
|
8665
|
+
*/
|
|
8666
|
+
uniqueWhereFor(condition) {
|
|
8667
|
+
const primaryKey = this.model.getPrimaryKey();
|
|
8668
|
+
if (condition.type !== "comparison" || condition.column !== primaryKey || condition.operator !== "=" || condition.value == null) return null;
|
|
8669
|
+
return { [primaryKey]: condition.value };
|
|
8670
|
+
}
|
|
8671
|
+
/**
|
|
8633
8672
|
* Builds the where clause for the query, taking into account soft delete
|
|
8634
8673
|
* settings if applicable.
|
|
8635
8674
|
*
|
|
@@ -8652,17 +8691,12 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8652
8691
|
/**
|
|
8653
8692
|
* Resolves a unique where clause for update and delete operations.
|
|
8654
8693
|
*
|
|
8655
|
-
* @param
|
|
8694
|
+
* @param condition
|
|
8656
8695
|
* @returns
|
|
8657
8696
|
*/
|
|
8658
|
-
async resolveUniqueWhere(
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
if (!condition) throw new UniqueConstraintResolutionException("Unable to resolve a unique identifier for update/delete operation from the current query shape.", {
|
|
8662
|
-
operation: "resolveUniqueWhere",
|
|
8663
|
-
model: this.model.name,
|
|
8664
|
-
meta: { where }
|
|
8665
|
-
});
|
|
8697
|
+
async resolveUniqueWhere(condition, failIfMissing = true) {
|
|
8698
|
+
const unique = this.uniqueWhereFor(condition);
|
|
8699
|
+
if (unique) return unique;
|
|
8666
8700
|
const row = await this.requireAdapter().selectOne({
|
|
8667
8701
|
target: this.buildQueryTarget(),
|
|
8668
8702
|
columns: [{ column: this.model.getPrimaryKey() }],
|
|
@@ -8672,28 +8706,17 @@ var QueryBuilder = class QueryBuilder {
|
|
|
8672
8706
|
if (!row) return failIfMissing ? (() => {
|
|
8673
8707
|
throw new ModelNotFoundException(this.model.name, "Record not found for update/delete operation.", {
|
|
8674
8708
|
operation: "resolveUniqueWhere",
|
|
8675
|
-
meta: {
|
|
8709
|
+
meta: { condition }
|
|
8676
8710
|
});
|
|
8677
8711
|
})() : null;
|
|
8678
8712
|
const primaryKey = this.model.getPrimaryKey();
|
|
8679
8713
|
if (!Object.prototype.hasOwnProperty.call(row, primaryKey)) throw new UniqueConstraintResolutionException(`Unable to resolve a unique identifier for update/delete operation. Include [${primaryKey}] in the query constraints.`, {
|
|
8680
8714
|
operation: "resolveUniqueWhere",
|
|
8681
8715
|
model: this.model.name,
|
|
8682
|
-
meta: {
|
|
8716
|
+
meta: { condition }
|
|
8683
8717
|
});
|
|
8684
8718
|
return { [primaryKey]: row[primaryKey] };
|
|
8685
8719
|
}
|
|
8686
|
-
/**
|
|
8687
|
-
* Checks if the provided where clause is already a unique
|
|
8688
|
-
* identifier (i.e., contains only an 'id' field).
|
|
8689
|
-
*
|
|
8690
|
-
* @param where
|
|
8691
|
-
* @returns
|
|
8692
|
-
*/
|
|
8693
|
-
isUniqueWhere(where) {
|
|
8694
|
-
const primaryKey = this.model.getPrimaryKey();
|
|
8695
|
-
return Object.keys(where).length === 1 && Object.prototype.hasOwnProperty.call(where, primaryKey);
|
|
8696
|
-
}
|
|
8697
8720
|
shuffleRows(rows) {
|
|
8698
8721
|
const shuffled = [...rows];
|
|
8699
8722
|
for (let index = shuffled.length - 1; index > 0; index--) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Cs as BelongsToManyRelation, Ss as SingleResultRelation, Ts as RelationTableLoader, _s as HasOneThroughRelation, bs as HasManyRelation, ds as SetBasedEagerLoader, fs as MorphToRelation, gs as MorphManyRelation, hs as MorphOneRelation, ms as MorphToManyRelation, ps as MorphedByManyRelation, vs as HasOneRelation, ws as Relation, xs as BelongsToRelation, ys as HasManyThroughRelation } from "../index-
|
|
1
|
+
import { Cs as BelongsToManyRelation, Ss as SingleResultRelation, Ts as RelationTableLoader, _s as HasOneThroughRelation, bs as HasManyRelation, ds as SetBasedEagerLoader, fs as MorphToRelation, gs as MorphManyRelation, hs as MorphOneRelation, ms as MorphToManyRelation, ps as MorphedByManyRelation, vs as HasOneRelation, ws as Relation, xs as BelongsToRelation, ys as HasManyThroughRelation } from "../index-BbKMvoiA.cjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, MorphedByManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Cs as BelongsToManyRelation, Ss as SingleResultRelation, Ts as RelationTableLoader, _s as HasOneThroughRelation, bs as HasManyRelation, ds as SetBasedEagerLoader, fs as MorphToRelation, gs as MorphManyRelation, hs as MorphOneRelation, ms as MorphToManyRelation, ps as MorphedByManyRelation, vs as HasOneRelation, ws as Relation, xs as BelongsToRelation, ys as HasManyThroughRelation } from "../index-
|
|
1
|
+
import { Cs as BelongsToManyRelation, Ss as SingleResultRelation, Ts as RelationTableLoader, _s as HasOneThroughRelation, bs as HasManyRelation, ds as SetBasedEagerLoader, fs as MorphToRelation, gs as MorphManyRelation, hs as MorphOneRelation, ms as MorphToManyRelation, ps as MorphedByManyRelation, vs as HasOneRelation, ws as Relation, xs as BelongsToRelation, ys as HasManyThroughRelation } from "../index-ChLGDqKz.mjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, MorphedByManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|