@prisma/orm-family-sql 8.0.0-rc.12-dev.14 → 8.0.0-rc.12-dev.16

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.
Files changed (108) hide show
  1. package/dist/{authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs → authoring-type-constructors-C1ogrr_x-DHiQB5ea.mjs} +2 -2
  2. package/dist/{authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs.map → authoring-type-constructors-C1ogrr_x-DHiQB5ea.mjs.map} +1 -1
  3. package/dist/builder__runtime.d.mts +2 -2
  4. package/dist/builder__runtime.mjs +7 -7
  5. package/dist/builder__runtime.mjs.map +1 -1
  6. package/dist/{config-types-Dqe0LWuW.mjs → config-types-CP-ThN5d.mjs} +2 -2
  7. package/dist/{config-types-Dqe0LWuW.mjs.map → config-types-CP-ThN5d.mjs.map} +1 -1
  8. package/dist/{contract-builder-CojarVwS.mjs → contract-builder-DKKqszA0.mjs} +2 -2
  9. package/dist/{contract-builder-CojarVwS.mjs.map → contract-builder-DKKqszA0.mjs.map} +1 -1
  10. package/dist/contract-emitter.mjs +1 -1
  11. package/dist/contract-prisma7__provider.mjs +4 -4
  12. package/dist/contract-prisma7__provider.mjs.map +1 -1
  13. package/dist/contract-psl.d.mts +3 -3
  14. package/dist/contract-psl.d.mts.map +1 -1
  15. package/dist/contract-psl.mjs +1 -1
  16. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  17. package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
  18. package/dist/contract-psl__map-names.d.mts +16 -0
  19. package/dist/contract-psl__map-names.d.mts.map +1 -0
  20. package/dist/contract-psl__map-names.mjs +21 -0
  21. package/dist/contract-psl__map-names.mjs.map +1 -0
  22. package/dist/contract-psl__provider.mjs +2 -2
  23. package/dist/contract-psl__provider.mjs.map +1 -1
  24. package/dist/contract-ts.mjs +3 -3
  25. package/dist/contract-ts__config-types.mjs +1 -1
  26. package/dist/contract-ts__contract-builder.mjs +2 -2
  27. package/dist/{control-BynSKZfp.mjs → control-BHPQ-Suo.mjs} +19 -3
  28. package/dist/control-BHPQ-Suo.mjs.map +1 -0
  29. package/dist/{control-BLOiyNq-.d.mts → control-BKwzdenn.d.mts} +21 -8
  30. package/dist/control-BKwzdenn.d.mts.map +1 -0
  31. package/dist/{derived-checks-BiClpWj6-Czjj2esH.mjs → derived-checks-FqUZ3g9z-DH15uJjN.mjs} +16 -24
  32. package/dist/derived-checks-FqUZ3g9z-DH15uJjN.mjs.map +1 -0
  33. package/dist/{diff-CHX4XHhC.d.mts → diff-B2b34L_E.d.mts} +4 -4
  34. package/dist/{diff-CHX4XHhC.d.mts.map → diff-B2b34L_E.d.mts.map} +1 -1
  35. package/dist/{dist-D5__KJs-.mjs → dist-U61NPKN3.mjs} +2 -2
  36. package/dist/{dist-D5__KJs-.mjs.map → dist-U61NPKN3.mjs.map} +1 -1
  37. package/dist/family.d.mts +10 -8
  38. package/dist/family.mjs +5 -3
  39. package/dist/family__control.d.mts +4 -4
  40. package/dist/family__control.mjs +1 -1
  41. package/dist/family__diff.d.mts +1 -1
  42. package/dist/family__migration.d.mts +1 -1
  43. package/dist/family__pack.mjs +1 -1
  44. package/dist/family__psl-build.d.mts +3 -0
  45. package/dist/family__psl-build.mjs +3 -0
  46. package/dist/family__psl-infer.d.mts +2 -2
  47. package/dist/family__psl-infer.mjs +2 -2
  48. package/dist/family__runtime.d.mts +1 -1
  49. package/dist/family__runtime.mjs +1 -1
  50. package/dist/{index-C10GDLBQ.d.mts → index-B-CraAhf.d.mts} +4 -4
  51. package/dist/{index-C10GDLBQ.d.mts.map → index-B-CraAhf.d.mts.map} +1 -1
  52. package/dist/{interpreter-Cy7S6Jh9-BIa0lyc-.mjs → interpreter-BrW0_y8Q-hqrOH5mg.mjs} +27 -41
  53. package/dist/interpreter-BrW0_y8Q-hqrOH5mg.mjs.map +1 -0
  54. package/dist/{migration-BwA1d1OP.d.mts → migration-9GrLWqGg.d.mts} +2 -2
  55. package/dist/{migration-BwA1d1OP.d.mts.map → migration-9GrLWqGg.d.mts.map} +1 -1
  56. package/dist/orm-client.d.mts +6 -6
  57. package/dist/orm-client.mjs +10 -10
  58. package/dist/orm-client.mjs.map +1 -1
  59. package/dist/{prepared-statement-B6zvhJej-Dl488oBR.d.mts → prepared-statement-BHSj2pDk-CRzjNpcv.d.mts} +9 -26
  60. package/dist/prepared-statement-BHSj2pDk-CRzjNpcv.d.mts.map +1 -0
  61. package/dist/psl-build-Cp32ahjI.mjs +224 -0
  62. package/dist/psl-build-Cp32ahjI.mjs.map +1 -0
  63. package/dist/psl-build-yBrQQN3r.d.mts +13 -0
  64. package/dist/psl-build-yBrQQN3r.d.mts.map +1 -0
  65. package/dist/{psl-infer-CuTqC9UV.d.mts → psl-infer-BzjA7U3b.d.mts} +3 -50
  66. package/dist/psl-infer-BzjA7U3b.d.mts.map +1 -0
  67. package/dist/psl-infer-DwMyO-IV.mjs +195 -0
  68. package/dist/psl-infer-DwMyO-IV.mjs.map +1 -0
  69. package/dist/psl-names-C3cwe0rg-CsuHOV7E.mjs +66 -0
  70. package/dist/psl-names-C3cwe0rg-CsuHOV7E.mjs.map +1 -0
  71. package/dist/query-lane-context-BcXiJasG.d.mts +1 -0
  72. package/dist/{query-lane-context-Bi1GUXHp-Bo4OTjhW.d.mts → query-lane-context-D6o9YrEV-bouFPM6u.d.mts} +5 -31
  73. package/dist/query-lane-context-D6o9YrEV-bouFPM6u.d.mts.map +1 -0
  74. package/dist/relational-core.d.mts +4 -4
  75. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  76. package/dist/relational-core__codec-descriptor-registry.d.mts +1 -1
  77. package/dist/relational-core__query-lane-context.d.mts +3 -3
  78. package/dist/relational-core__types.d.mts +2 -2
  79. package/dist/{runtime-DYpzLADy.d.mts → runtime-DgOeosYa.d.mts} +5 -6
  80. package/dist/runtime-DgOeosYa.d.mts.map +1 -0
  81. package/dist/{runtime-DzmRvRj_.mjs → runtime-Z3nD7ix1.mjs} +4 -4
  82. package/dist/{runtime-DzmRvRj_.mjs.map → runtime-Z3nD7ix1.mjs.map} +1 -1
  83. package/dist/runtime.d.mts +4 -4
  84. package/dist/runtime.mjs +7 -85
  85. package/dist/runtime.mjs.map +1 -1
  86. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  87. package/dist/{schema-differ-DpG_gnur-CXVM1Oed.d.mts → schema-differ-DpG_gnur-B_rj2WAH.d.mts} +2 -2
  88. package/dist/{schema-differ-DpG_gnur-CXVM1Oed.d.mts.map → schema-differ-DpG_gnur-B_rj2WAH.d.mts.map} +1 -1
  89. package/dist/type-map-BwBI56i3-DDERtzxf.d.mts +49 -0
  90. package/dist/type-map-BwBI56i3-DDERtzxf.d.mts.map +1 -0
  91. package/dist/{types-BFPRCYGW-BheztqYQ.d.mts → types-BFPRCYGW-DWAEoFj7.d.mts} +2 -2
  92. package/dist/{types-BFPRCYGW-BheztqYQ.d.mts.map → types-BFPRCYGW-DWAEoFj7.d.mts.map} +1 -1
  93. package/dist/types-BvTYXSiS.d.mts +1 -0
  94. package/dist/{types-Bcujdkdw-2SDajXRo.d.mts → types-DFJNPLXY-vp6AGe5e.d.mts} +3 -3
  95. package/dist/{types-Bcujdkdw-2SDajXRo.d.mts.map → types-DFJNPLXY-vp6AGe5e.d.mts.map} +1 -1
  96. package/package.json +20 -18
  97. package/dist/control-BLOiyNq-.d.mts.map +0 -1
  98. package/dist/control-BynSKZfp.mjs.map +0 -1
  99. package/dist/derived-checks-BiClpWj6-Czjj2esH.mjs.map +0 -1
  100. package/dist/interpreter-Cy7S6Jh9-BIa0lyc-.mjs.map +0 -1
  101. package/dist/prepared-statement-B6zvhJej-Dl488oBR.d.mts.map +0 -1
  102. package/dist/psl-infer-CuTqC9UV.d.mts.map +0 -1
  103. package/dist/psl-infer-Df2DrvP-.mjs +0 -474
  104. package/dist/psl-infer-Df2DrvP-.mjs.map +0 -1
  105. package/dist/query-lane-context-Bi1GUXHp-Bo4OTjhW.d.mts.map +0 -1
  106. package/dist/query-lane-context-CJNBt8cm.d.mts +0 -1
  107. package/dist/runtime-DYpzLADy.d.mts.map +0 -1
  108. package/dist/types-nNy0nND_.d.mts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"psl-infer-DwMyO-IV.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.mjs"],"sourcesContent":["import { a as snakeToCamelCase, i as needsEscaping, n as escapeName, o as snakeToPascalCase, r as hasSeparators, t as escapeIfNeeded } from \"./psl-names-C3cwe0rg.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { defaultTableName } from \"@internal/sql-contract-psl/default-table-name\";\nimport pluralizeLib from \"pluralize\";\nimport { backingIndexColumnKeys, isBackedByColumnKeys } from \"@internal/sql-contract/foreign-key-materialization\";\n//#region src/core/psl-contract-infer/name-transforms.ts\nfunction toModelName(tableName) {\n\tlet name;\n\tif (hasSeparators(tableName)) name = snakeToPascalCase(tableName);\n\telse name = tableName.charAt(0).toUpperCase() + tableName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: tableName\n\t};\n\tif (defaultTableName(name) !== tableName) return {\n\t\tname,\n\t\tmap: tableName\n\t};\n\treturn { name };\n}\nfunction toFieldName(columnName) {\n\tlet name;\n\tif (hasSeparators(columnName)) name = snakeToCamelCase(columnName);\n\telse name = columnName.charAt(0).toLowerCase() + columnName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: columnName\n\t};\n\tif (name !== columnName) return {\n\t\tname,\n\t\tmap: columnName\n\t};\n\treturn { name };\n}\nfunction toEnumName(pgTypeName) {\n\tlet name;\n\tif (hasSeparators(pgTypeName)) name = snakeToPascalCase(pgTypeName);\n\telse name = pgTypeName.charAt(0).toUpperCase() + pgTypeName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: pgTypeName\n\t};\n\tif (name !== pgTypeName) return {\n\t\tname,\n\t\tmap: pgTypeName\n\t};\n\treturn { name };\n}\nfunction pluralize(word) {\n\treturn pluralizeLib.plural(word);\n}\nfunction deriveRelationFieldName(fkColumns, referencedTableName) {\n\tif (fkColumns.length === 1) {\n\t\tconst [col = referencedTableName] = fkColumns;\n\t\tconst stripped = col.replace(/_id$/i, \"\").replace(/Id$/, \"\");\n\t\tif (stripped.length > 0 && stripped !== col) return escapeIfNeeded(snakeToCamelCase(stripped));\n\t\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n\t}\n\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n}\nfunction deriveBackRelationFieldName(childModelName, isOneToOne) {\n\tconst base = childModelName.charAt(0).toLowerCase() + childModelName.slice(1);\n\treturn isOneToOne ? base : pluralize(base);\n}\n//#endregion\n//#region src/core/psl-contract-infer/relation-inference.ts\nconst DEFAULT_ON_DELETE = \"noAction\";\nconst DEFAULT_ON_UPDATE = \"noAction\";\nconst REFERENTIAL_ACTION_PSL = {\n\tnoAction: \"NoAction\",\n\trestrict: \"Restrict\",\n\tcascade: \"Cascade\",\n\tsetNull: \"SetNull\",\n\tsetDefault: \"SetDefault\"\n};\nfunction inferRelations(tables, modelNameMap) {\n\tconst relationsByTable = /* @__PURE__ */ new Map();\n\tconst fkCountByPair = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst pairKey = `${table.name}→${fk.referencedTable}`;\n\t\tfkCountByPair.set(pairKey, (fkCountByPair.get(pairKey) ?? 0) + 1);\n\t}\n\tconst usedFieldNames = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst names = /* @__PURE__ */ new Set();\n\t\tfor (const col of Object.values(table.columns)) names.add(col.name);\n\t\tusedFieldNames.set(table.name, names);\n\t}\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst childTableName = table.name;\n\t\tconst parentTableName = fk.referencedTable;\n\t\tconst childUsed = usedFieldNames.get(childTableName);\n\t\tif (childUsed === void 0) throw new InternalError(`Missing inferred field-name set for table \"${childTableName}\"`);\n\t\tconst childModelName = modelNameMap.get(childTableName) ?? childTableName;\n\t\tconst parentModelName = modelNameMap.get(parentTableName) ?? parentTableName;\n\t\tconst pairKey = `${childTableName}→${parentTableName}`;\n\t\tconst isSelfRelation = childTableName === parentTableName;\n\t\tconst needsRelationName = (fkCountByPair.get(pairKey) ?? 0) > 1 || isSelfRelation;\n\t\tconst isOneToOne = detectOneToOne(fk, table);\n\t\tconst childRelFieldName = resolveUniqueFieldName(deriveRelationFieldName(fk.columns, parentTableName), childUsed, parentModelName);\n\t\tconst relationName = needsRelationName ? deriveRelationName(fk, childRelFieldName, parentModelName, isSelfRelation) : void 0;\n\t\taddRelationField(relationsByTable, childTableName, buildChildRelationField(childRelFieldName, parentModelName, fk, fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false), relationName, table));\n\t\tchildUsed.add(childRelFieldName);\n\t\tconst parentUsed = usedFieldNames.get(parentTableName) ?? /* @__PURE__ */ new Set();\n\t\tusedFieldNames.set(parentTableName, parentUsed);\n\t\tconst backRelFieldName = resolveUniqueFieldName(deriveBackRelationFieldName(childModelName, isOneToOne), parentUsed, childModelName);\n\t\taddRelationField(relationsByTable, parentTableName, {\n\t\t\tfieldName: backRelFieldName,\n\t\t\ttypeName: childModelName,\n\t\t\toptional: isOneToOne,\n\t\t\tlist: !isOneToOne,\n\t\t\trelationName\n\t\t});\n\t\tparentUsed.add(backRelFieldName);\n\t}\n\treturn { relationsByTable };\n}\nfunction detectOneToOne(fk, table) {\n\tconst fkCols = [...fk.columns].sort();\n\tif (table.primaryKey) {\n\t\tconst pkCols = [...table.primaryKey.columns].sort();\n\t\tif (pkCols.length === fkCols.length && pkCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const unique of table.uniques) {\n\t\tconst uniqueCols = [...unique.columns].sort();\n\t\tif (uniqueCols.length === fkCols.length && uniqueCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const index of table.indexes) {\n\t\tif (!index.unique || index.partial || index.columns === void 0) continue;\n\t\tconst indexCols = [...index.columns].sort();\n\t\tif (indexCols.length === fkCols.length && indexCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\treturn false;\n}\nfunction deriveRelationName(fk, childRelationFieldName, parentModelName, isSelfRelation) {\n\tif (fk.name) return fk.name;\n\tif (isSelfRelation) return `${childRelationFieldName.charAt(0).toUpperCase() + childRelationFieldName.slice(1)}${pluralize(parentModelName)}`;\n\treturn fk.columns.join(\"_\");\n}\n/**\n* Builds the child-side {@link RelationField} for a single foreign key:\n* `typeName` is the parent model name, `fields`/`references` are the FK's raw\n* columns, and `onDelete`/`onUpdate` are normalized to their PSL spelling.\n* Exported so a caller resolving a foreign key against a model outside\n* `tables` (e.g. a cross-space reference into another contract) can reuse the\n* same normalization instead of duplicating it.\n*\n* `hostTable` is the table the FK is declared on (i.e. `table`, not the\n* referenced parent) — its own indexes/uniques/primary key are what a\n* backing index for this FK would be. When none of them exactly match the\n* FK's source columns (in order), `index: false` is stamped so the emitted\n* `@relation` opts out of the framework's default derived backing-index\n* expectation, matching what `db verify` will find live. Passing the table\n* is optional so existing single-FK callers (e.g. cross-space resolution\n* before a host table reference is threaded through) can omit it and keep\n* the framework default.\n*/\nfunction buildChildRelationField(fieldName, parentModelName, fk, optional, relationName, hostTable) {\n\tconst onDelete = fk.onDelete && fk.onDelete !== DEFAULT_ON_DELETE ? fk.onDelete : void 0;\n\tconst onUpdate = fk.onUpdate && fk.onUpdate !== DEFAULT_ON_UPDATE ? fk.onUpdate : void 0;\n\tconst index = hostTable && !isBackedByColumnKeys(fk.columns, backingIndexColumnKeys({\n\t\tindexes: hostTable.indexes.filter((i) => i.where === void 0),\n\t\tuniques: hostTable.uniques,\n\t\tprimaryKey: hostTable.primaryKey\n\t})) ? false : void 0;\n\treturn {\n\t\tfieldName,\n\t\ttypeName: parentModelName,\n\t\treferencedTableName: fk.referencedTable,\n\t\toptional,\n\t\tlist: false,\n\t\trelationName,\n\t\tfkName: fk.name,\n\t\tfields: fk.columns,\n\t\treferences: fk.referencedColumns,\n\t\tonDelete: onDelete ? REFERENTIAL_ACTION_PSL[onDelete] : void 0,\n\t\tonUpdate: onUpdate ? REFERENTIAL_ACTION_PSL[onUpdate] : void 0,\n\t\tindex\n\t};\n}\nfunction resolveUniqueFieldName(desired, usedNames, fallbackSuffix) {\n\tif (!usedNames.has(desired)) return desired;\n\tconst withSuffix = `${desired}${fallbackSuffix}`;\n\tif (!usedNames.has(withSuffix)) return withSuffix;\n\tlet counter = 2;\n\twhile (usedNames.has(`${desired}${counter}`)) counter++;\n\treturn `${desired}${counter}`;\n}\nfunction addRelationField(map, tableName, field) {\n\tconst existing = map.get(tableName);\n\tif (existing) existing.push(field);\n\telse map.set(tableName, [field]);\n}\n//#endregion\nexport { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };\n\n//# sourceMappingURL=psl-infer.mjs.map"],"mappings":";;;;;;AAMA,SAAS,YAAY,WAAW;CAC/B,IAAI;CACJ,IAAI,cAAc,SAAS,GAAG,OAAO,kBAAkB,SAAS;MAC3D,OAAO,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC;CACjE,IAAI,cAAc,IAAI,GAAG,OAAO;EAC/B,MAAM,WAAW,IAAI;EACrB,KAAK;CACN;CACA,IAAI,iBAAiB,IAAI,MAAM,WAAW,OAAO;EAChD;EACA,KAAK;CACN;CACA,OAAO,EAAE,KAAK;AACf;AACA,SAAS,YAAY,YAAY;CAChC,IAAI;CACJ,IAAI,cAAc,UAAU,GAAG,OAAO,iBAAiB,UAAU;MAC5D,OAAO,WAAW,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,WAAW,MAAM,CAAC;CACnE,IAAI,cAAc,IAAI,GAAG,OAAO;EAC/B,MAAM,WAAW,IAAI;EACrB,KAAK;CACN;C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 "types",
6
+ "type",
7
+ "generator",
8
+ "datasource"
9
+ ]);
10
+ const IDENTIFIER_PART_PATTERN = /[A-Za-z0-9]+/g;
11
+ function hasSeparators(input) {
12
+ return /[^A-Za-z0-9]/.test(input);
13
+ }
14
+ function extractIdentifierParts(input) {
15
+ return input.match(IDENTIFIER_PART_PATTERN) ?? [];
16
+ }
17
+ function createSyntheticIdentifier(input) {
18
+ let hash = 2166136261;
19
+ for (const char of input) {
20
+ hash ^= char.codePointAt(0) ?? 0;
21
+ hash = Math.imul(hash, 16777619);
22
+ }
23
+ return `x${(hash >>> 0).toString(16)}`;
24
+ }
25
+ function sanitizeIdentifierCharacters(input) {
26
+ const sanitized = input.replace(/[^\w]/g, "");
27
+ return sanitized.length > 0 ? sanitized : createSyntheticIdentifier(input);
28
+ }
29
+ function capitalize(word) {
30
+ return word.charAt(0).toUpperCase() + word.slice(1);
31
+ }
32
+ function snakeToPascalCase(input) {
33
+ const parts = extractIdentifierParts(input);
34
+ if (parts.length === 0) return capitalize(sanitizeIdentifierCharacters(input));
35
+ return parts.map(capitalize).join("");
36
+ }
37
+ function snakeToCamelCase(input) {
38
+ const parts = extractIdentifierParts(input);
39
+ if (parts.length === 0) return sanitizeIdentifierCharacters(input);
40
+ const [firstPart = input, ...rest] = parts;
41
+ return firstPart.charAt(0).toLowerCase() + firstPart.slice(1) + rest.map(capitalize).join("");
42
+ }
43
+ function needsEscaping(name) {
44
+ return PSL_RESERVED_WORDS.has(name.toLowerCase()) || /^\d/.test(name);
45
+ }
46
+ function escapeName(name) {
47
+ return `_${name}`;
48
+ }
49
+ function escapeIfNeeded(name) {
50
+ return needsEscaping(name) ? escapeName(name) : name;
51
+ }
52
+ const VALID_IDENTIFIER_PATTERN = /^[A-Za-z_]\w*$/;
53
+ /**
54
+ * PSL member name for a native-enum value. The value itself always prints
55
+ * explicitly (`member = "value"`), so the returned name never needs a map:
56
+ * a value that already is a valid, non-reserved identifier is kept verbatim
57
+ * (case included); anything else is camelCased/escaped like a field name.
58
+ */
59
+ function toEnumMemberName(value) {
60
+ if (VALID_IDENTIFIER_PATTERN.test(value) && !needsEscaping(value)) return value;
61
+ return escapeIfNeeded(snakeToCamelCase(value));
62
+ }
63
+ //#endregion
64
+ export { snakeToCamelCase as a, needsEscaping as i, escapeName as n, snakeToPascalCase as o, hasSeparators as r, toEnumMemberName as s, escapeIfNeeded as t };
65
+
66
+ //# sourceMappingURL=psl-names-C3cwe0rg-CsuHOV7E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"psl-names-C3cwe0rg-CsuHOV7E.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-names-C3cwe0rg.mjs"],"sourcesContent":["//#region src/core/psl-build/psl-names.ts\nconst PSL_RESERVED_WORDS = /* @__PURE__ */ new Set([\n\t\"model\",\n\t\"enum\",\n\t\"types\",\n\t\"type\",\n\t\"generator\",\n\t\"datasource\"\n]);\nconst IDENTIFIER_PART_PATTERN = /[A-Za-z0-9]+/g;\nfunction hasSeparators(input) {\n\treturn /[^A-Za-z0-9]/.test(input);\n}\nfunction extractIdentifierParts(input) {\n\treturn input.match(IDENTIFIER_PART_PATTERN) ?? [];\n}\nfunction createSyntheticIdentifier(input) {\n\tlet hash = 2166136261;\n\tfor (const char of input) {\n\t\thash ^= char.codePointAt(0) ?? 0;\n\t\thash = Math.imul(hash, 16777619);\n\t}\n\treturn `x${(hash >>> 0).toString(16)}`;\n}\nfunction sanitizeIdentifierCharacters(input) {\n\tconst sanitized = input.replace(/[^\\w]/g, \"\");\n\treturn sanitized.length > 0 ? sanitized : createSyntheticIdentifier(input);\n}\nfunction capitalize(word) {\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}\nfunction snakeToPascalCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return capitalize(sanitizeIdentifierCharacters(input));\n\treturn parts.map(capitalize).join(\"\");\n}\nfunction snakeToCamelCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return sanitizeIdentifierCharacters(input);\n\tconst [firstPart = input, ...rest] = parts;\n\treturn firstPart.charAt(0).toLowerCase() + firstPart.slice(1) + rest.map(capitalize).join(\"\");\n}\nfunction needsEscaping(name) {\n\treturn PSL_RESERVED_WORDS.has(name.toLowerCase()) || /^\\d/.test(name);\n}\nfunction escapeName(name) {\n\treturn `_${name}`;\n}\nfunction escapeIfNeeded(name) {\n\treturn needsEscaping(name) ? escapeName(name) : name;\n}\nconst VALID_IDENTIFIER_PATTERN = /^[A-Za-z_]\\w*$/;\n/**\n* PSL member name for a native-enum value. The value itself always prints\n* explicitly (`member = \"value\"`), so the returned name never needs a map:\n* a value that already is a valid, non-reserved identifier is kept verbatim\n* (case included); anything else is camelCased/escaped like a field name.\n*/\nfunction toEnumMemberName(value) {\n\tif (VALID_IDENTIFIER_PATTERN.test(value) && !needsEscaping(value)) return value;\n\treturn escapeIfNeeded(snakeToCamelCase(value));\n}\n//#endregion\nexport { snakeToCamelCase as a, needsEscaping as i, escapeName as n, snakeToPascalCase as o, hasSeparators as r, toEnumMemberName as s, escapeIfNeeded as t };\n\n//# sourceMappingURL=psl-names-C3cwe0rg.mjs.map"],"mappings":";AACA,MAAM,qCAAqC,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,MAAM,0BAA0B;AAChC,SAAS,cAAc,OAAO;CAC7B,OAAO,eAAe,KAAK,KAAK;AACjC;AACA,SAAS,uBAAuB,OAAO;CACtC,OAAO,MAAM,MAAM,uBAAuB,KAAK,CAAC;AACjD;AACA,SAAS,0BAA0B,OAAO;CACzC,IAAI,OAAO;CACX,KAAK,MAAM,QAAQ,OAAO;EACzB,QAAQ,KAAK,YAAY,CAAC,KAAK;EAC/B,OAAO,KAAK,KAAK,MAAM,QAAQ;CAChC;CACA,OAAO,KAAK,SAAS,EAAA,CAAG,SAAS,EAAE;AACpC;AACA,SAAS,6BAA6B,OAAO;CAC5C,MAAM,YAAY,MAAM,QAAQ,UAAU,EAAE;CAC5C,OAAO,UAAU,SAAS,IAAI,YAAY,0BAA0B,KAAK;AAC1E;AACA,SAAS,WAAW,MAAM;CACzB,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;AACnD;AACA,SAAS,kBAAkB,OAAO;CACjC,MAAM,QAAQ,uBAAuB,KAAK;CAC1C,IAAI,MAAM,WAAW,GAAG,OAAO,WAAW,6BAA6B,KAAK,CAAC;CAC7E,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,KAAK,EAAE;AACrC;AACA,SAAS,iBAAiB,OAAO;CAChC,MAAM,QAAQ,uBAAuB,KAAK;CAC1C,IAAI,MAAM,WAAW,GAAG,OAAO,6BAA6B,KAAK;CACjE,MAAM,CAAC,YAAY,OAAO,GAAG,QAAQ;CACrC,OAAO,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC,IAAI,KAAK,IAAI,UAAU,CAAC,CAAC,KAAK,EAAE;AAC7F;AACA,SAAS,cAAc,MAAM;CAC5B,OAAO,mBAAmB,IAAI,KAAK,YAAY,CAAC,KAAK,MAAM,KAAK,IAAI;AACrE;AACA,SAAS,WAAW,MAAM;CACzB,OAAO,IAAI;AACZ;AACA,SAAS,eAAe,MAAM;CAC7B,OAAO,cAAc,IAAI,IAAI,WAAW,IAAI,IAAI;AACjD;AACA,MAAM,2BAA2B;;;;;;;AAOjC,SAAS,iBAAiB,OAAO;CAChC,IAAI,yBAAyB,KAAK,KAAK,KAAK,CAAC,cAAc,KAAK,GAAG,OAAO;CAC1E,OAAO,eAAe,iBAAiB,KAAK,CAAC;AAC9C"}
@@ -0,0 +1 @@
1
+ import "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
@@ -3,9 +3,10 @@ import "./types-C36_3E6_.mjs";
3
3
  import { a as SqlOperationRegistry } from "./index-Cef8iy1o.mjs";
4
4
  import { c as AnyExpression, k as ContractCodecRegistry } from "./types-Yui2yFf6-TP-oRDTX.mjs";
5
5
  import { Contract } from "@prisma/orm-framework/contract/types";
6
+ import { MutationDefaults } from "@prisma/orm-framework/components/runtime";
6
7
  import { CodecDescriptor, CodecRef } from "@prisma/orm-framework/components/codec";
7
8
  import { AggregateDescriptor, AggregateResultNullability } from "@prisma/orm-framework/components/components";
8
- //#region ../../../2-sql/4-lanes/relational-core/dist/query-lane-context-Bi1GUXHp.d.mts
9
+ //#region ../../../2-sql/4-lanes/relational-core/dist/query-lane-context-D6o9YrEV.d.mts
9
10
  //#region src/aggregate-descriptor.d.ts
10
11
  /**
11
12
  * What a lowering hook is handed: the expression being aggregated (absent for operations that consume no value) and the codec of that expression.
@@ -94,35 +95,12 @@ interface SqlAggregateDescriptorRegistry {
94
95
  * Registry of initialized type helpers from storage.types. Each key is a type name from storage.types, and the value is the resolved codec materialized once for that named instance via `descriptor.factory(typeParams)(ctx)` (or the raw `StorageTypeInstance` metadata for codec ids whose descriptor isn't registered).
95
96
  */
96
97
  type TypeHelperRegistry = Record<string, unknown>;
97
- type MutationDefaultsOp = 'create' | 'update';
98
- type AppliedMutationDefault = {
99
- readonly column: string;
100
- readonly value: unknown;
101
- };
102
- type MutationDefaultsOptions = {
103
- readonly op: MutationDefaultsOp;
104
- readonly table: string;
105
- /**
106
- * Namespace of the target table. Execution-default refs are namespace-scoped,
107
- * so only defaults declared for `(namespace, table)` are applied — this is what
108
- * disambiguates same-named tables across namespaces. Required so the coordinate
109
- * is always part of the match; a missing namespace is a caller bug, not a
110
- * silent degrade to table-name-only matching.
111
- */
112
- readonly namespace: string;
113
- readonly values: Record<string, unknown>;
114
- /**
115
- * Per-ORM-operation cache for generators that declare `stability: 'query'`. The caller passes the same `Map` across every `applyMutationDefaults` invocation in one bulk operation; the framework keys by `generatorId` so the same value is reused across all rows and columns. Generators with `stability: 'row'` use a fresh per-call cache the framework manages internally; generators with `stability: 'field'` skip caching
116
- * entirely. Omit to make every call independent (degrades `'query'` to per-call behavior).
117
- */
118
- readonly defaultValueCache?: Map<string, unknown>;
119
- };
120
98
  /**
121
99
  * Minimal context interface for SQL query lanes.
122
100
  *
123
101
  * Lanes only need contract, operations, and codecs to build typed ASTs and attach operation builders. This interface explicitly excludes runtime concerns like adapters, connection management, and transaction state.
124
102
  */
125
- interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> {
103
+ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends MutationDefaults {
126
104
  readonly contract: TContract;
127
105
  /**
128
106
  * Contract-bound codec registry built once at context-construction time by walking the contract's columns and resolving each through its descriptor's factory. Runtime dispatch (`encodeParam` / `decodeRow`) resolves codecs via `forCodecRef(ref)` — the single dispatch shape for AST-bound codec resolution.
@@ -141,11 +119,7 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
141
119
  * Type helper registry for parameterized types. Schema builders expose these helpers via schema.types.
142
120
  */
143
121
  readonly types: TypeHelperRegistry;
144
- /**
145
- * Applies execution-time mutation defaults for the given table. Returns the applied defaults (caller-provided values always win).
146
- */
147
- applyMutationDefaults(options: MutationDefaultsOptions): ReadonlyArray<AppliedMutationDefault>;
148
122
  }
149
123
  //#endregion
150
- export { MutationDefaultsOptions as a, SqlAggregateDescriptorRegistry as c, TypeHelperRegistry as d, isSqlAggregateDescriptor as f, MutationDefaultsOp as i, SqlAggregateLowering as l, CodecDescriptorRegistry as n, ResolvedSqlAggregate as o, ExecutionContext as r, SqlAggregateDescriptor as s, AppliedMutationDefault as t, SqlAggregateLoweringContext as u };
151
- //# sourceMappingURL=query-lane-context-Bi1GUXHp-Bo4OTjhW.d.mts.map
124
+ export { SqlAggregateDescriptorRegistry as a, TypeHelperRegistry as c, SqlAggregateDescriptor as i, isSqlAggregateDescriptor as l, ExecutionContext as n, SqlAggregateLowering as o, ResolvedSqlAggregate as r, SqlAggregateLoweringContext as s, CodecDescriptorRegistry as t };
125
+ //# sourceMappingURL=query-lane-context-D6o9YrEV-bouFPM6u.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-lane-context-D6o9YrEV-bouFPM6u.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/query-lane-context-D6o9YrEV.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,MAAM;WACN,YAAY;;;;;;;KAOlB,wBAAwB,SAAS,gCAAgC;;;;;;;;KAQjE,yBAAyB;WACnB,QAAQ;;;iBAGF,yBAAyB,iBAAiB,SAAS;;;;;;UAM1D;;;;EAIR,cAAc,kBAAkB;;;;;;;;;;;;;;EAchC,kBAAkB,qBAAqB,eAAe,iBAAiB;;;;EAIvE,UAAU,iBAAiB;;;;EAI3B,aAAa,8BAA8B;;;;;;;KAOxC,uBAAuB;WACjB;WACA,QAAQ;WACR,OAAO;;;;;;;UAOR;;;;;;EAMR,QAAQ,mBAAmB,QAAQ,WAAW;;EAE9C,UAAU,iBAAiB;;;;;KAKxB,qBAAqB;;;;;;UAMhB,iBAAiB,kBAAkB,SAAS,cAAc,SAAS,qBAAqB;WACvF,UAAU;;;;WAIV,gBAAgB;;;;WAIhB,kBAAkB;;;;WAIlB,sBAAsB;WACtB,iBAAiB;;;;WAIjB,OAAO"}
@@ -6,8 +6,8 @@ import { n as SqlQueryPlan, r as planFromAst, t as Preparable } from "./plan-B7g
6
6
  import { C as buildOperation, D as param, E as isExpression, O as toExpr, S as TraitExpression, T as createRawSql, _ as RawSqlStatementBuilder, a as CodecValue, b as ScalarListExpression, c as RawAffectedCountQuery, d as RawRow, f as RawRowQuery, g as RawSqlInterpolation, h as RawSqlBuilder, i as CodecTypesBase, l as RawCodecInferer, m as RawRowSpecEntry, n as BuildOperationSpec, o as Expression, p as RawRowSpec, r as CodecExpression, s as NoReservedRowColumn, t as AffectedCount, u as RawPlanContext, v as RawSqlStatementTag, w as codecOf, x as ScopeField, y as RawSqlTag } from "./expression-BPoA5eEl.mjs";
7
7
  import { t as SqlExecutionPlan } from "./sql-execution-plan-Db0j752I-CI5WbdLi.mjs";
8
8
  import "./plan-DiT00Rg8.mjs";
9
- import { a as MutationDefaultsOptions, c as SqlAggregateDescriptorRegistry, d as TypeHelperRegistry, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as ResolvedSqlAggregate, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-Bi1GUXHp-Bo4OTjhW.mjs";
10
- import "./query-lane-context-CJNBt8cm.mjs";
9
+ import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
10
+ import "./query-lane-context-BcXiJasG.mjs";
11
+ import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-DFJNPLXY-vp6AGe5e.mjs";
11
12
  import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-CuGBptK0-C88HCnh5.mjs";
12
- import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-Bcujdkdw-2SDajXRo.mjs";
13
- export { Adapter, AdapterProfile, AdapterTarget, AffectedCount, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyCodecDescriptorTemplate, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec$1 as Codec, type CodecCallContext$1 as CodecCallContext, type CodecDescriptor$1 as CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, type CodecRef$1 as CodecRef, type CodecTrait$1 as CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecJson, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, IntegerStep, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NativeJsonValueProjection, NoReservedRowColumn, NotExpr, NullCheckExpr, NumberClassification, NumberClassifierSpec, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, OrderByNulls, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, Preparable, PreparedExecuteRequest, PreparedParamRef, PreparedStatementHandle, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawAffectedCountQuery, RawCodecInferer, RawExpr, RawPlanContext, RawQueryAst, RawQueryColumn, RawQueryResult, RawRow, RawRowQuery, RawRowSpec, RawRowSpecEntry, RawSqlBuilder, RawSqlInterpolation, RawSqlLiteral, RawSqlStatementBuilder, RawSqlStatementTag, RawSqlTag, ResolvedSqlAggregate, type RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlAggregateDescriptorRegistry, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryable, SqlStatementStats, SqlTextCodec, SqlTextDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, aggregateFnNames, buildOperation, canonicalNumeralText, codecOf, collectOrderedParamRefs, compact, createNumberClassifier, createRawSql, createSqlParamRefMutator, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isExpression, isNonFiniteText, isNumeralText, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, numeralText, param, parseJsonBody, planFromAst, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
13
+ export { Adapter, AdapterProfile, AdapterTarget, AffectedCount, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyCodecDescriptorTemplate, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec$1 as Codec, type CodecCallContext$1 as CodecCallContext, type CodecDescriptor$1 as CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, type CodecRef$1 as CodecRef, type CodecTrait$1 as CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecJson, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, IntegerStep, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, NativeJsonValueProjection, NoReservedRowColumn, NotExpr, NullCheckExpr, NumberClassification, NumberClassifierSpec, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, OrderByNulls, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, Preparable, PreparedExecuteRequest, PreparedParamRef, PreparedStatementHandle, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawAffectedCountQuery, RawCodecInferer, RawExpr, RawPlanContext, RawQueryAst, RawQueryColumn, RawQueryResult, RawRow, RawRowQuery, RawRowSpec, RawRowSpecEntry, RawSqlBuilder, RawSqlInterpolation, RawSqlLiteral, RawSqlStatementBuilder, RawSqlStatementTag, RawSqlTag, ResolvedSqlAggregate, type RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlAggregateDescriptorRegistry, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryable, SqlStatementStats, SqlTextCodec, SqlTextDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, aggregateFnNames, buildOperation, canonicalNumeralText, codecOf, collectOrderedParamRefs, compact, createNumberClassifier, createRawSql, createSqlParamRefMutator, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isExpression, isNonFiniteText, isNumeralText, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, numeralText, param, parseJsonBody, planFromAst, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
@@ -1,4 +1,4 @@
1
- import { c as SqlAggregateDescriptorRegistry, f as isSqlAggregateDescriptor, l as SqlAggregateLowering, n as CodecDescriptorRegistry, s as SqlAggregateDescriptor, u as SqlAggregateLoweringContext } from "./query-lane-context-Bi1GUXHp-Bo4OTjhW.mjs";
1
+ import { a as SqlAggregateDescriptorRegistry, i as SqlAggregateDescriptor, l as isSqlAggregateDescriptor, o as SqlAggregateLowering, s as SqlAggregateLoweringContext, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
2
2
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.d.mts
3
3
  //#region src/aggregate-descriptor-registry.d.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import "./types-C36_3E6_.mjs";
3
3
  import { o as AnyCodecDescriptor$1 } from "./types-Yui2yFf6-TP-oRDTX.mjs";
4
- import { n as CodecDescriptorRegistry } from "./query-lane-context-Bi1GUXHp-Bo4OTjhW.mjs";
4
+ import { t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
5
5
  import { CodecRef } from "@prisma/orm-framework/components/codec";
6
6
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.d.mts
7
7
  //#region src/codec-descriptor-registry.d.ts
@@ -1,3 +1,3 @@
1
- import { a as MutationDefaultsOptions, c as SqlAggregateDescriptorRegistry, d as TypeHelperRegistry, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as ResolvedSqlAggregate, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-Bi1GUXHp-Bo4OTjhW.mjs";
2
- import "./query-lane-context-CJNBt8cm.mjs";
3
- export { AppliedMutationDefault, CodecDescriptorRegistry, ExecutionContext, MutationDefaultsOp, MutationDefaultsOptions, ResolvedSqlAggregate, SqlAggregateDescriptorRegistry, TypeHelperRegistry };
1
+ import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
2
+ import "./query-lane-context-BcXiJasG.mjs";
3
+ export { CodecDescriptorRegistry, ExecutionContext, ResolvedSqlAggregate, SqlAggregateDescriptorRegistry, TypeHelperRegistry };
@@ -1,3 +1,3 @@
1
- import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-Bcujdkdw-2SDajXRo.mjs";
2
- import "./types-nNy0nND_.mjs";
1
+ import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-DFJNPLXY-vp6AGe5e.mjs";
2
+ import "./types-BvTYXSiS.mjs";
3
3
  export { BuildOptions, BuildParamsMap, CodecTypes, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, Expr, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, type RuntimeScope, SqlBuilderOptions, type SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
@@ -1,7 +1,6 @@
1
1
  import "./resolve-storage-table-Nyrgk4h8.mjs";
2
- import { S as RuntimeMutationDefaultGenerator } from "./prepared-statement-B6zvhJej-Dl488oBR.mjs";
3
- import "./index-C10GDLBQ.mjs";
4
2
  import { ResolvedDomainModel, UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from "@prisma/orm-framework/contract/types";
3
+ import { RuntimeMutationDefaultGenerator } from "@prisma/orm-framework/components/runtime";
5
4
  import { RuntimeFamilyDescriptor, RuntimeFamilyInstance } from "@prisma/orm-framework/components/execution";
6
5
  //#region ../../../2-sql/9-family/dist/runtime.d.mts
7
6
  //#region src/core/runtime-instance.d.ts
@@ -37,11 +36,11 @@ declare const sqlRuntimeFamilyDescriptor: RuntimeFamilyDescriptor<'sql', SqlRunt
37
36
  * every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`
38
37
  * semantics: one `new Date()` per lowered mutation, not per row.
39
38
  *
40
- * Lives in a runtime-plane-only module so the control-plane
41
- * `timestamp-now-generator.ts` (descriptor + authoring presets) stays
42
- * free of `@internal/sql-runtime` imports.
39
+ * Lives in its own module, exported only through `exports/runtime.ts`,
40
+ * so the control-plane `timestamp-now-generator.ts` (descriptor +
41
+ * authoring presets) stays free of runtime-plane imports.
43
42
  */
44
43
  declare function timestampNowRuntimeGenerator(): RuntimeMutationDefaultGenerator;
45
44
  //#endregion
46
45
  export { timestampNowRuntimeGenerator as a, sqlRuntimeFamilyDescriptor as i, UNBOUND_DOMAIN_NAMESPACE_ID as n, resolveDomainModel as r, ResolvedDomainModel as t };
47
- //# sourceMappingURL=runtime-DYpzLADy.d.mts.map
46
+ //# sourceMappingURL=runtime-DgOeosYa.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-DgOeosYa.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;UAaU,iCAAiC;;;;;;;;;;;cAW7B,4BAA4B,+BAA+B;;;;;;;;;;;;;;;;;iBAiBxD,gCAAgC"}
@@ -37,9 +37,9 @@ Object.freeze(sqlRuntimeFamilyDescriptor);
37
37
  * every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`
38
38
  * semantics: one `new Date()` per lowered mutation, not per row.
39
39
  *
40
- * Lives in a runtime-plane-only module so the control-plane
41
- * `timestamp-now-generator.ts` (descriptor + authoring presets) stays
42
- * free of `@internal/sql-runtime` imports.
40
+ * Lives in its own module, exported only through `exports/runtime.ts`,
41
+ * so the control-plane `timestamp-now-generator.ts` (descriptor +
42
+ * authoring presets) stays free of runtime-plane imports.
43
43
  */
44
44
  function timestampNowRuntimeGenerator() {
45
45
  return {
@@ -52,4 +52,4 @@ var runtime_default = sqlRuntimeFamilyDescriptor;
52
52
  //#endregion
53
53
  export { timestampNowRuntimeGenerator as i, resolveDomainModel as n, runtime_default as r, UNBOUND_DOMAIN_NAMESPACE_ID as t };
54
54
 
55
- //# sourceMappingURL=runtime-DzmRvRj_.mjs.map
55
+ //# sourceMappingURL=runtime-Z3nD7ix1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-DzmRvRj_.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.mjs"],"sourcesContent":["import { TIMESTAMP_NOW_GENERATOR_ID } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from \"@internal/contract/types\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\n//#region src/core/runtime-instance.ts\n/**\n* Creates a SQL execution-plane family instance.\n*\n* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n*/\nfunction createSqlRuntimeFamilyInstance() {\n\treturn { familyId: \"sql\" };\n}\n//#endregion\n//#region src/core/runtime-descriptor.ts\n/**\n* SQL execution-plane family descriptor.\n*\n* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n*\n* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n*/\nconst sqlRuntimeFamilyDescriptor = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tcreate() {\n\t\treturn createSqlRuntimeFamilyInstance();\n\t}\n};\nObject.freeze(sqlRuntimeFamilyDescriptor);\n//#endregion\n//#region src/core/timestamp-now-runtime-generator.ts\n/**\n* Builds the canonical runtime-plane generator for the wall-clock-now\n* mutation default. Returns `new Date()`; semantics are target-agnostic\n* so all SQL targets share this single implementation.\n*\n* Declares `stability: 'query'` so a single ORM bulk operation\n* (e.g. `createAll([...])`) shares one timestamp across every row and\n* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`\n* semantics: one `new Date()` per lowered mutation, not per row.\n*\n* Lives in a runtime-plane-only module so the control-plane\n* `timestamp-now-generator.ts` (descriptor + authoring presets) stays\n* free of `@internal/sql-runtime` imports.\n*/\nfunction timestampNowRuntimeGenerator() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tgenerate: () => /* @__PURE__ */ new Date(),\n\t\tstability: \"query\"\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = sqlRuntimeFamilyDescriptor;\n//#endregion\nexport { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AASA,SAAS,iCAAiC;CACzC,OAAO,EAAE,UAAU,MAAM;AAC1B;;;;;;;;;AAWA,MAAM,6BAA6B;CAClC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;EACR,OAAO,+BAA+B;CACvC;AACD;AACA,OAAO,OAAO,0BAA0B;;;;;;;;;;;;;;;AAiBxC,SAAS,+BAA+B;CACvC,OAAO;EACN,IAAI;EACJ,gCAAgC,IAAI,KAAK;EACzC,WAAW;CACZ;AACD;AAGA,IAAI,kBAAkB"}
1
+ {"version":3,"file":"runtime-Z3nD7ix1.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.mjs"],"sourcesContent":["import { TIMESTAMP_NOW_GENERATOR_ID } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from \"@internal/contract/types\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\n//#region src/core/runtime-instance.ts\n/**\n* Creates a SQL execution-plane family instance.\n*\n* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n*/\nfunction createSqlRuntimeFamilyInstance() {\n\treturn { familyId: \"sql\" };\n}\n//#endregion\n//#region src/core/runtime-descriptor.ts\n/**\n* SQL execution-plane family descriptor.\n*\n* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n*\n* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n*/\nconst sqlRuntimeFamilyDescriptor = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tcreate() {\n\t\treturn createSqlRuntimeFamilyInstance();\n\t}\n};\nObject.freeze(sqlRuntimeFamilyDescriptor);\n//#endregion\n//#region src/core/timestamp-now-runtime-generator.ts\n/**\n* Builds the canonical runtime-plane generator for the wall-clock-now\n* mutation default. Returns `new Date()`; semantics are target-agnostic\n* so all SQL targets share this single implementation.\n*\n* Declares `stability: 'query'` so a single ORM bulk operation\n* (e.g. `createAll([...])`) shares one timestamp across every row and\n* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`\n* semantics: one `new Date()` per lowered mutation, not per row.\n*\n* Lives in its own module, exported only through `exports/runtime.ts`,\n* so the control-plane `timestamp-now-generator.ts` (descriptor +\n* authoring presets) stays free of runtime-plane imports.\n*/\nfunction timestampNowRuntimeGenerator() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tgenerate: () => /* @__PURE__ */ new Date(),\n\t\tstability: \"query\"\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = sqlRuntimeFamilyDescriptor;\n//#endregion\nexport { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AASA,SAAS,iCAAiC;CACzC,OAAO,EAAE,UAAU,MAAM;AAC1B;;;;;;;;;AAWA,MAAM,6BAA6B;CAClC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;EACR,OAAO,+BAA+B;CACvC;AACD;AACA,OAAO,OAAO,0BAA0B;;;;;;;;;;;;;;;AAiBxC,SAAS,+BAA+B;CACvC,OAAO;EACN,IAAI;EACJ,gCAAgC,IAAI,KAAK;EACzC,WAAW;CACZ;AACD;AAGA,IAAI,kBAAkB"}
@@ -1,5 +1,5 @@
1
1
  import { s as MarkerReadResult } from "./ast-B9jF6tRJ.mjs";
2
- import { d as TypeHelperRegistry, r as ExecutionContext } from "./query-lane-context-Bi1GUXHp-Bo4OTjhW.mjs";
3
- import { A as SqlMiddleware, B as TelemetryOutcome, C as RuntimeOptions, D as RuntimeTransaction, E as RuntimeTelemetryEvent, F as SqlRuntimeDriverInstance, G as deriveParamMetadata, H as VerifyMarkerOption, I as SqlRuntimeExtensionDescriptor, K as encodeParamsWithMetadata, L as SqlRuntimeExtensionInstance, M as SqlRuntimeAdapterDescriptor, N as SqlRuntimeAdapterInstance, O as SqlExecutionStack, P as SqlRuntimeBase, R as SqlRuntimeTargetDescriptor, S as RuntimeMutationDefaultGenerator, T as RuntimeQueryable, U as createExecutionContext, V as TransactionContext, W as createSqlExecutionStack, Y as withTransaction, _ as PreparedStatementInternals, a as DeclaredNullable, b as RuntimeConnection, c as ParamSpec, d as PreparedExecution, f as PreparedExecutionImpl, g as PreparedStatementImpl, i as DeclaredCodecId, j as SqlMiddlewareContext, k as SqlExecutionStackWithDriver, l as ParamsFromDeclaration, m as PreparedStatement, n as ConnectionProvider, o as GeneratorStability, p as PreparedFor, r as Declaration, s as MarkerReader, t as BindSiteParams, u as PrepareCallback, w as RuntimeParameterizedCodecDescriptor, x as RuntimeFamilyAdapter, y as Runtime, z as SqlStaticContributions } from "./prepared-statement-B6zvhJej-Dl488oBR.mjs";
4
- import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-C10GDLBQ.mjs";
5
- export { type AfterExecuteResult, type AfterQueryResult, type BindSiteParams, type BudgetsOptions, type ConnectionProvider, type Declaration, type DeclaredCodecId, type DeclaredNullable, type ExecuteInterceptResult, type ExecutionContext, type GeneratorStability, type LintsOptions, type Log, type MarkerReadResult, type MarkerReader, type ParamSpec, type ParamsFromDeclaration, type PrepareCallback, type PreparedExecution, PreparedExecutionImpl, type PreparedFor, type PreparedStatement, PreparedStatementImpl, type PreparedStatementInternals, type QueryInterceptResult, type Runtime, type RuntimeConnection, type RuntimeFamilyAdapter, type RuntimeMutationDefaultGenerator, type RuntimeOptions, type RuntimeParameterizedCodecDescriptor, type RuntimeQueryable, type RuntimeTelemetryEvent, type RuntimeTransaction, type SqlExecutionStack, type SqlExecutionStackWithDriver, type SqlMiddleware, type SqlMiddlewareContext, type SqlRuntimeAdapterDescriptor, type SqlRuntimeAdapterInstance, SqlRuntimeBase, type SqlRuntimeDriverInstance, type SqlRuntimeExtensionDescriptor, type SqlRuntimeExtensionInstance, type SqlRuntimeTargetDescriptor, type SqlStaticContributions, type TelemetryOutcome, type TransactionContext, type TypeHelperRegistry, type VerifyMarkerOption, budgets, createAstCodecRegistry, createExecutionContext, createSqlExecutionStack, deriveParamMetadata, encodeParamsWithMetadata, extractCodecIds, lints, lowerSqlPlan, validateCodecRegistryCompleteness, validateContractCodecMappings, withTransaction };
2
+ import { c as TypeHelperRegistry, n as ExecutionContext } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
3
+ import { A as SqlRuntimeAdapterDescriptor, B as VerifyMarkerOption, C as RuntimeQueryable, D as SqlExecutionStackWithDriver, E as SqlExecutionStack, F as SqlRuntimeExtensionInstance, H as createSqlExecutionStack, I as SqlRuntimeTargetDescriptor, L as SqlStaticContributions, M as SqlRuntimeBase, N as SqlRuntimeDriverInstance, O as SqlMiddleware, P as SqlRuntimeExtensionDescriptor, R as TelemetryOutcome, S as RuntimeParameterizedCodecDescriptor, T as RuntimeTransaction, U as deriveParamMetadata, V as createExecutionContext, W as encodeParamsWithMetadata, a as DeclaredNullable, b as RuntimeFamilyAdapter, c as ParamsFromDeclaration, d as PreparedExecutionImpl, f as PreparedFor, g as PreparedStatementInternals, h as PreparedStatementImpl, i as DeclaredCodecId, j as SqlRuntimeAdapterInstance, k as SqlMiddlewareContext, l as PrepareCallback, n as ConnectionProvider, o as MarkerReader, p as PreparedStatement, q as withTransaction, r as Declaration, s as ParamSpec, t as BindSiteParams, u as PreparedExecution, v as Runtime, w as RuntimeTelemetryEvent, x as RuntimeOptions, y as RuntimeConnection, z as TransactionContext } from "./prepared-statement-BHSj2pDk-CRzjNpcv.mjs";
4
+ import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-B-CraAhf.mjs";
5
+ export { type AfterExecuteResult, type AfterQueryResult, type BindSiteParams, type BudgetsOptions, type ConnectionProvider, type Declaration, type DeclaredCodecId, type DeclaredNullable, type ExecuteInterceptResult, type ExecutionContext, type LintsOptions, type Log, type MarkerReadResult, type MarkerReader, type ParamSpec, type ParamsFromDeclaration, type PrepareCallback, type PreparedExecution, PreparedExecutionImpl, type PreparedFor, type PreparedStatement, PreparedStatementImpl, type PreparedStatementInternals, type QueryInterceptResult, type Runtime, type RuntimeConnection, type RuntimeFamilyAdapter, type RuntimeOptions, type RuntimeParameterizedCodecDescriptor, type RuntimeQueryable, type RuntimeTelemetryEvent, type RuntimeTransaction, type SqlExecutionStack, type SqlExecutionStackWithDriver, type SqlMiddleware, type SqlMiddlewareContext, type SqlRuntimeAdapterDescriptor, type SqlRuntimeAdapterInstance, SqlRuntimeBase, type SqlRuntimeDriverInstance, type SqlRuntimeExtensionDescriptor, type SqlRuntimeExtensionInstance, type SqlRuntimeTargetDescriptor, type SqlStaticContributions, type TelemetryOutcome, type TransactionContext, type TypeHelperRegistry, type VerifyMarkerOption, budgets, createAstCodecRegistry, createExecutionContext, createSqlExecutionStack, deriveParamMetadata, encodeParamsWithMetadata, extractCodecIds, lints, lowerSqlPlan, validateCodecRegistryCompleteness, validateContractCodecMappings, withTransaction };
package/dist/runtime.mjs CHANGED
@@ -9,7 +9,7 @@ import { isStructuredError } from "@prisma/orm-framework/utils/structured-error"
9
9
  import { createHash } from "node:crypto";
10
10
  import { assertNever } from "@prisma/orm-framework/utils/internal-error";
11
11
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
12
- import { AsyncIterableResult, RuntimeCore, checkAborted, checkMiddlewareCompatibility, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
12
+ import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
13
13
  import { blindCast } from "@prisma/orm-framework/utils/casts";
14
14
  import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
15
15
  import { materializeCodec, resolveCodecDescriptorOrThrow } from "@prisma/orm-framework/components/codec";
@@ -17,7 +17,7 @@ import { checkContractComponentRequirements, mergeCapabilityMatrices } from "@pr
17
17
  import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
18
18
  import { createExecutionStack } from "@prisma/orm-framework/components/execution";
19
19
  import { hashContent } from "@prisma/orm-framework/utils/hash-content";
20
- //#region ../../../2-sql/5-runtime/dist/exports-cGWDoah9.mjs
20
+ //#region ../../../2-sql/5-runtime/dist/exports-CCSITeUw.mjs
21
21
  /**
22
22
  * Build an {@link AstCodecResolver} bound to a descriptor registry and a per-call instance-context factory.
23
23
  *
@@ -557,7 +557,7 @@ function validateTypeParams(typeParams, descriptor, context) {
557
557
  typeParams
558
558
  });
559
559
  }
560
- return result.value;
560
+ return blindCast(result.value);
561
561
  }
562
562
  /**
563
563
  * Collect every {@link CodecDescriptor} contributed by the SQL stack and partition into "parameterized" vs "non-parameterized" via the descriptor's own {@link CodecDescriptorImpl.isParameterized} getter: a descriptor is parameterized when it has a `paramsSchema`.
@@ -572,7 +572,7 @@ function collectCodecDescriptors(contributors) {
572
572
  if (seen.has(descriptor.codecId)) throw runtimeError("RUNTIME.DUPLICATE_CODEC", `Duplicate codec descriptor for codecId '${descriptor.codecId}'.`, { codecId: descriptor.codecId });
573
573
  seen.add(descriptor.codecId);
574
574
  all.push(descriptor);
575
- if (descriptor.isParameterized) parameterized.set(descriptor.codecId, descriptor);
575
+ if (descriptor.isParameterized) parameterized.set(descriptor.codecId, blindCast(descriptor));
576
576
  }
577
577
  return {
578
578
  all,
@@ -705,7 +705,7 @@ function buildContractCodecRegistry(contract, codecDescriptors) {
705
705
  const instanceTypeParams = typeInstance.typeParams;
706
706
  const key = refKeyOf(instanceTypeParams !== void 0 && Object.keys(instanceTypeParams).length > 0 ? {
707
707
  codecId: typeInstance.codecId,
708
- typeParams: instanceTypeParams
708
+ typeParams: blindCast(instanceTypeParams)
709
709
  } : { codecId: typeInstance.codecId });
710
710
  const sites = typeRefSites.get(typeName) ?? [];
711
711
  const existing = usedAtByKey.get(key);
@@ -754,84 +754,6 @@ function buildContractCodecRegistry(contract, codecDescriptors) {
754
754
  }
755
755
  };
756
756
  }
757
- function assertMutationDefaultGeneratorsAvailable(contract, generatorRegistry) {
758
- const defaults = contract.execution?.mutations.defaults ?? [];
759
- if (defaults.length === 0) return;
760
- const missing = /* @__PURE__ */ new Set();
761
- for (const mutationDefault of defaults) for (const phase of [mutationDefault.onCreate, mutationDefault.onUpdate]) {
762
- if (!phase) continue;
763
- if (phase.kind === "generator" && !generatorRegistry.has(phase.id)) missing.add(phase.id);
764
- }
765
- if (missing.size === 0) return;
766
- const ids = Array.from(missing);
767
- throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract requires mutation default generator(s) ${ids.map((id) => `'${id}'`).join(", ")}, but no runtime component provides them.`, { ids });
768
- }
769
- function collectMutationDefaultGenerators(contributors) {
770
- const generators = /* @__PURE__ */ new Map();
771
- const owners = /* @__PURE__ */ new Map();
772
- for (const contributor of contributors) {
773
- const nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];
774
- for (const generator of nextGenerators) {
775
- const existingOwner = owners.get(generator.id);
776
- if (existingOwner !== void 0) throw runtimeError("RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR", `Duplicate mutation default generator '${generator.id}'.`, {
777
- id: generator.id,
778
- existingOwner,
779
- incomingOwner: contributor.id
780
- });
781
- generators.set(generator.id, generator);
782
- owners.set(generator.id, contributor.id);
783
- }
784
- }
785
- return generators;
786
- }
787
- function computeExecutionDefaultValue(spec, generatorRegistry) {
788
- switch (spec.kind) {
789
- case "generator": {
790
- const generator = generatorRegistry.get(spec.id);
791
- if (!generator) throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract references mutation default generator '${spec.id}' but no runtime component provides it.`, { id: spec.id });
792
- return generator.generate(spec.params);
793
- }
794
- }
795
- }
796
- function applyMutationDefaults(contract, generatorRegistry, options) {
797
- const defaults = contract.execution?.mutations.defaults ?? [];
798
- if (defaults.length === 0) return [];
799
- const isEmptyUpdate = options.op === "update" && Object.keys(options.values).length === 0;
800
- const applied = [];
801
- const appliedColumns = /* @__PURE__ */ new Set();
802
- const rowCache = /* @__PURE__ */ new Map();
803
- for (const mutationDefault of defaults) {
804
- if (mutationDefault.ref.entry !== options.table) continue;
805
- if (mutationDefault.ref.namespace !== options.namespace) continue;
806
- const defaultSpec = options.op === "create" ? mutationDefault.onCreate : mutationDefault.onUpdate;
807
- if (!defaultSpec) continue;
808
- if (isEmptyUpdate) continue;
809
- const columnName = mutationDefault.ref.field;
810
- if (Object.hasOwn(options.values, columnName) || appliedColumns.has(columnName)) continue;
811
- applied.push({
812
- column: columnName,
813
- value: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)
814
- });
815
- appliedColumns.add(columnName);
816
- }
817
- return applied;
818
- }
819
- function resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {
820
- if (spec.kind !== "generator") return computeExecutionDefaultValue(spec, generatorRegistry);
821
- const cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);
822
- if (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);
823
- if (cache.has(spec.id)) return cache.get(spec.id);
824
- const value = computeExecutionDefaultValue(spec, generatorRegistry);
825
- cache.set(spec.id, value);
826
- return value;
827
- }
828
- function scopedCache(stability, rowCache, queryCache) {
829
- switch (stability) {
830
- case "row": return rowCache;
831
- case "query": return queryCache;
832
- default: return;
833
- }
834
- }
835
757
  function createExecutionContext(options) {
836
758
  const { stack, driver } = options;
837
759
  assertExecutionStackContractRequirements(options.contract, stack);
@@ -861,7 +783,7 @@ function createExecutionContext(options) {
861
783
  assertColumnCodecIntegrity(contract.storage, codecDescriptors);
862
784
  const aggregateDescriptors = buildSqlAggregateDescriptorRegistry(collectAggregateDescriptorContributions(contributors), codecDescriptors);
863
785
  const mutationDefaultGeneratorRegistry = collectMutationDefaultGenerators(contributors);
864
- assertMutationDefaultGeneratorsAvailable(contract, mutationDefaultGeneratorRegistry);
786
+ assertMutationDefaultGeneratorsAvailable(contract.execution, mutationDefaultGeneratorRegistry);
865
787
  if (parameterizedCodecDescriptors.size > 0) validateColumnTypeParams(contract.storage, parameterizedCodecDescriptors);
866
788
  const types = initializeTypeHelpers(contract.storage, documentScopedCodecTypes(contract), parameterizedCodecDescriptors);
867
789
  return {
@@ -871,7 +793,7 @@ function createExecutionContext(options) {
871
793
  aggregateDescriptors,
872
794
  queryOperations: queryOperationRegistry,
873
795
  types,
874
- applyMutationDefaults: (options) => applyMutationDefaults(contract, mutationDefaultGeneratorRegistry, options)
796
+ applyMutationDefaults: (options) => applyMutationDefaults(contract.execution, mutationDefaultGeneratorRegistry, options)
875
797
  };
876
798
  }
877
799
  const sqlNativeArrayListDecoder = async (wireValue, decodeElement) => {