@prisma/orm-family-sql 8.0.0-rc.12-dev.17 → 8.0.0-rc.12-dev.18

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.
@@ -4493,13 +4493,21 @@ var CollectionImpl = class CollectionImpl {
4493
4493
  method,
4494
4494
  model: this.modelName
4495
4495
  } });
4496
- this.#assertNotMtiVariant(method);
4496
+ if (method === "createAll()") this.#assertConflictSkipNotOnMtiVariant(method);
4497
+ else this.#assertNotMtiVariant(method);
4497
4498
  const conflictOn = options.conflictOn ?? [];
4498
4499
  assertInsertConflictSkipCapability(this.contract, method, conflictOn.length > 0);
4499
4500
  return { columns: resolveInsertConflictColumns(this.contract, this.namespaceId, this.modelName, conflictOn, method) };
4500
4501
  }
4501
4502
  #assertNotMtiVariant(method) {
4502
- if (this.#resolveMtiCreateContext()) throw ormError("ORM.OPERATION_UNSUPPORTED", `${method} is not supported for MTI variant "${this.state.variantName}" on model "${this.modelName}". Use createAll() instead.`, { meta: {
4503
+ this.#refuseOnMtiVariant(method, `${method} is not supported for MTI variant "${this.state.variantName}" on model "${this.modelName}". Use createAll() instead.`);
4504
+ }
4505
+ #assertConflictSkipNotOnMtiVariant(method) {
4506
+ this.#refuseOnMtiVariant(method, `The onConflict option is not supported on variant "${this.state.variantName}" of model "${this.modelName}" because the variant is stored in its own table. Call createAll(rows) without the option; a duplicate row then makes the call fail.`);
4507
+ }
4508
+ #refuseOnMtiVariant(method, message) {
4509
+ if (!this.#resolveMtiCreateContext()) return;
4510
+ throw ormError("ORM.OPERATION_UNSUPPORTED", message, { meta: {
4503
4511
  method,
4504
4512
  model: this.modelName,
4505
4513
  variant: this.state.variantName,