@prisma/orm-family-sql 8.0.0-rc.11-dev.37 → 8.0.0-rc.11-dev.39

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 (139) hide show
  1. package/dist/{aggregate-descriptor-registry-YRK_hT8V.mjs → aggregate-descriptor-registry-DzThdoju.mjs} +2 -2
  2. package/dist/{aggregate-descriptor-registry-YRK_hT8V.mjs.map → aggregate-descriptor-registry-DzThdoju.mjs.map} +1 -1
  3. package/dist/{ast-D7JjbK8E.d.mts → ast-BHZ0g4iL.d.mts} +3 -3
  4. package/dist/{ast-D7JjbK8E.d.mts.map → ast-BHZ0g4iL.d.mts.map} +1 -1
  5. package/dist/{ast-CS0lZ0OC.mjs → ast-C8jX7HNs.mjs} +2 -2
  6. package/dist/{ast-CS0lZ0OC.mjs.map → ast-C8jX7HNs.mjs.map} +1 -1
  7. package/dist/{authored-check-naming-BEvfamnI.mjs → authored-check-naming-9UFx77db.mjs} +2 -2
  8. package/dist/{authored-check-naming-BEvfamnI.mjs.map → authored-check-naming-9UFx77db.mjs.map} +1 -1
  9. package/dist/{authoring-type-constructors-C1ogrr_x-BbEHaj9p.mjs → authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs} +2 -2
  10. package/dist/{authoring-type-constructors-C1ogrr_x-BbEHaj9p.mjs.map → authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs.map} +1 -1
  11. package/dist/builder.d.mts +2 -2
  12. package/dist/builder__runtime.d.mts +6 -6
  13. package/dist/builder__runtime.mjs +2 -2
  14. package/dist/builder__types.d.mts +2 -2
  15. package/dist/{config-types-BZyzSC1w.mjs → config-types-B98UYjF0.mjs} +2 -2
  16. package/dist/{config-types-BZyzSC1w.mjs.map → config-types-B98UYjF0.mjs.map} +1 -1
  17. package/dist/{contract-builder-BVjdRPs_.d.mts → contract-builder-5ipbzeN-.d.mts} +26 -5
  18. package/dist/contract-builder-5ipbzeN-.d.mts.map +1 -0
  19. package/dist/{contract-builder-luQwHUCq.mjs → contract-builder-BCqPVNbs.mjs} +24 -3
  20. package/dist/contract-builder-BCqPVNbs.mjs.map +1 -0
  21. package/dist/contract-prisma7__provider.mjs +2 -2
  22. package/dist/contract-psl.d.mts +1 -1
  23. package/dist/contract-psl.mjs +1 -1
  24. package/dist/contract-psl__provider.mjs +2 -2
  25. package/dist/contract-psl__provider.mjs.map +1 -1
  26. package/dist/contract-ts.d.mts +2 -2
  27. package/dist/contract-ts.mjs +3 -3
  28. package/dist/contract-ts__config-types.mjs +1 -1
  29. package/dist/contract-ts__contract-builder.d.mts +2 -2
  30. package/dist/contract-ts__contract-builder.mjs +2 -2
  31. package/dist/contract.d.mts +2 -2
  32. package/dist/contract.mjs +4 -4
  33. package/dist/contract__authored-check-naming.mjs +1 -1
  34. package/dist/contract__foreign-key-materialization.mjs +1 -1
  35. package/dist/contract__index-naming.d.mts +2 -2
  36. package/dist/contract__index-naming.mjs +2 -2
  37. package/dist/{control-l65wQ2NY.mjs → control-BGi7ayGb.mjs} +2 -2
  38. package/dist/{control-l65wQ2NY.mjs.map → control-BGi7ayGb.mjs.map} +1 -1
  39. package/dist/{control-CuiTzy6O.d.mts → control-C9oCqe39.d.mts} +6 -6
  40. package/dist/{control-CuiTzy6O.d.mts.map → control-C9oCqe39.d.mts.map} +1 -1
  41. package/dist/control-adapter-Bx5ZQKj-.d.mts +1 -0
  42. package/dist/{control-adapter-C99J7aEF-QiVMjPGA.d.mts → control-adapter-C99J7aEF-B2G4GA5s.d.mts} +4 -4
  43. package/dist/{control-adapter-C99J7aEF-QiVMjPGA.d.mts.map → control-adapter-C99J7aEF-B2G4GA5s.d.mts.map} +1 -1
  44. package/dist/{db-BhQdL6Za-CnAcF6Zh.d.mts → db-BhQdL6Za-Dod07quT.d.mts} +6 -6
  45. package/dist/{db-BhQdL6Za-CnAcF6Zh.d.mts.map → db-BhQdL6Za-Dod07quT.d.mts.map} +1 -1
  46. package/dist/{ddl-types-CA-aj1rO-_giNpXNM.d.mts → ddl-types-Biy7miT--CSyPnOHq.d.mts} +3 -3
  47. package/dist/{ddl-types-CA-aj1rO-_giNpXNM.d.mts.map → ddl-types-Biy7miT--CSyPnOHq.d.mts.map} +1 -1
  48. package/dist/{derived-checks-C4BPtrnO-CmWM7df_.mjs → derived-checks-C4BPtrnO-B9MQRh6W.mjs} +4 -4
  49. package/dist/{derived-checks-C4BPtrnO-CmWM7df_.mjs.map → derived-checks-C4BPtrnO-B9MQRh6W.mjs.map} +1 -1
  50. package/dist/{diff-BB4zE5J1.d.mts → diff-CwozLSiO.d.mts} +3 -3
  51. package/dist/{diff-BB4zE5J1.d.mts.map → diff-CwozLSiO.d.mts.map} +1 -1
  52. package/dist/{expression-C7JqFgwS.d.mts → expression-CTADTPZW.d.mts} +3 -3
  53. package/dist/{expression-C7JqFgwS.d.mts.map → expression-CTADTPZW.d.mts.map} +1 -1
  54. package/dist/{expression-CiiHMYqY.mjs → expression-DqrE3myO.mjs} +2 -2
  55. package/dist/{expression-CiiHMYqY.mjs.map → expression-DqrE3myO.mjs.map} +1 -1
  56. package/dist/family.d.mts +7 -7
  57. package/dist/family.mjs +2 -2
  58. package/dist/family__control-adapter.d.mts +2 -2
  59. package/dist/family__control.d.mts +2 -2
  60. package/dist/family__control.mjs +1 -1
  61. package/dist/family__diff.d.mts +2 -2
  62. package/dist/family__migration.d.mts +1 -1
  63. package/dist/family__pack.mjs +1 -1
  64. package/dist/family__psl-infer.mjs +1 -1
  65. package/dist/family__runtime.d.mts +1 -1
  66. package/dist/{foreign-key-materialization-0TrwfShD.mjs → foreign-key-materialization-B3HQzQIA.mjs} +2 -2
  67. package/dist/{foreign-key-materialization-0TrwfShD.mjs.map → foreign-key-materialization-B3HQzQIA.mjs.map} +1 -1
  68. package/dist/{index-DfRCPDMK.d.mts → index-CA_WLNy1.d.mts} +9 -9
  69. package/dist/{index-DfRCPDMK.d.mts.map → index-CA_WLNy1.d.mts.map} +1 -1
  70. package/dist/{index-naming-Ct65z5Xk.d.mts → index-naming-BNIXvg5R.d.mts} +11 -2
  71. package/dist/index-naming-BNIXvg5R.d.mts.map +1 -0
  72. package/dist/{index-naming-fQMLqyC4-4FzPVtCR.mjs → index-naming-Cj1Anq-T-w1JL7-EM.mjs} +27 -3
  73. package/dist/index-naming-Cj1Anq-T-w1JL7-EM.mjs.map +1 -0
  74. package/dist/{interpreter-C8N5eRW1-CwRYmHO7.mjs → interpreter-Bf7Um__3-DC_thY44.mjs} +15 -4
  75. package/dist/interpreter-Bf7Um__3-DC_thY44.mjs.map +1 -0
  76. package/dist/{middleware-CAQqWuBd-D-9cpkrQ.d.mts → middleware-0yjzaoBT-BqmCD6Dt.d.mts} +3 -3
  77. package/dist/{middleware-CAQqWuBd-D-9cpkrQ.d.mts.map → middleware-0yjzaoBT-BqmCD6Dt.d.mts.map} +1 -1
  78. package/dist/middleware-Di3_d2T5.d.mts +1 -0
  79. package/dist/{migration-ClbaU5Om.d.mts → migration-CniGZoFt.d.mts} +2 -2
  80. package/dist/{migration-ClbaU5Om.d.mts.map → migration-CniGZoFt.d.mts.map} +1 -1
  81. package/dist/orm-client.d.mts +44 -15
  82. package/dist/orm-client.d.mts.map +1 -1
  83. package/dist/orm-client.mjs +97 -26
  84. package/dist/orm-client.mjs.map +1 -1
  85. package/dist/plan-BEJGOQ-l.d.mts +2 -0
  86. package/dist/{plan-oIjoMLQN-VIXmqAKW.d.mts → plan-Bs-Pdirc-BCy94--G.d.mts} +3 -3
  87. package/dist/plan-Bs-Pdirc-BCy94--G.d.mts.map +1 -0
  88. package/dist/{prepared-statement-DZtymlzd-D_INawdF.d.mts → prepared-statement-DZtymlzd-DFIuG_WK.d.mts} +13 -13
  89. package/dist/{prepared-statement-DZtymlzd-D_INawdF.d.mts.map → prepared-statement-DZtymlzd-DFIuG_WK.d.mts.map} +1 -1
  90. package/dist/{psl-infer-CsCbcmXS.mjs → psl-infer-6p4x9ebN.mjs} +2 -2
  91. package/dist/{psl-infer-CsCbcmXS.mjs.map → psl-infer-6p4x9ebN.mjs.map} +1 -1
  92. package/dist/{query-lane-context-cqWxvUWZ-Cl8U5ljU.d.mts → query-lane-context-QIUURgPP-CvQ9jQRm.d.mts} +3 -3
  93. package/dist/{query-lane-context-cqWxvUWZ-Cl8U5ljU.d.mts.map → query-lane-context-QIUURgPP-CvQ9jQRm.d.mts.map} +1 -1
  94. package/dist/query-lane-context-yy5kDAlG.d.mts +1 -0
  95. package/dist/relational-core.d.mts +11 -11
  96. package/dist/relational-core.mjs +3 -3
  97. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  98. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  99. package/dist/relational-core__ast.d.mts +3 -3
  100. package/dist/relational-core__ast.mjs +2 -2
  101. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  102. package/dist/relational-core__contract-free.d.mts +2 -2
  103. package/dist/relational-core__contract-free.mjs +1 -1
  104. package/dist/relational-core__contract-free.mjs.map +1 -1
  105. package/dist/relational-core__expression.d.mts +1 -1
  106. package/dist/relational-core__expression.mjs +1 -1
  107. package/dist/relational-core__middleware.d.mts +2 -2
  108. package/dist/relational-core__plan.d.mts +3 -3
  109. package/dist/relational-core__query-lane-context.d.mts +2 -2
  110. package/dist/relational-core__types.d.mts +2 -2
  111. package/dist/{runtime-C-gasTpn.d.mts → runtime-gCSNgykk.d.mts} +3 -3
  112. package/dist/{runtime-C-gasTpn.d.mts.map → runtime-gCSNgykk.d.mts.map} +1 -1
  113. package/dist/runtime.d.mts +4 -4
  114. package/dist/runtime.mjs +2 -2
  115. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  116. package/dist/{sql-execution-plan-2C68q5Jo-BCQaqOt4.d.mts → sql-execution-plan-S3HvDKIP-8KF1nBHu.d.mts} +3 -3
  117. package/dist/sql-execution-plan-S3HvDKIP-8KF1nBHu.d.mts.map +1 -0
  118. package/dist/{types-BFPRCYGW-Cmlh0DI_.d.mts → types-BFPRCYGW-CvvVz-AC.d.mts} +2 -2
  119. package/dist/{types-BFPRCYGW-Cmlh0DI_.d.mts.map → types-BFPRCYGW-CvvVz-AC.d.mts.map} +1 -1
  120. package/dist/{types-DhYcyD0K-DImmT7YD.d.mts → types-BXSw7th1-pL1Iggyd.d.mts} +8 -2
  121. package/dist/{types-DhYcyD0K-DImmT7YD.d.mts.map → types-BXSw7th1-pL1Iggyd.d.mts.map} +1 -1
  122. package/dist/{types-thCvr3t--B9fvzq0z.d.mts → types-CRU1CBUk-CR2_opbw.d.mts} +6 -6
  123. package/dist/{types-thCvr3t--B9fvzq0z.d.mts.map → types-CRU1CBUk-CR2_opbw.d.mts.map} +1 -1
  124. package/dist/types-RPn42d0t.d.mts +1 -0
  125. package/dist/{types-CWwta5EN-BS4OsQAL.mjs → types-ZNKYVjLr-DzjvSHKB.mjs} +10 -2
  126. package/dist/{types-CWwta5EN-BS4OsQAL.mjs.map → types-ZNKYVjLr-DzjvSHKB.mjs.map} +1 -1
  127. package/package.json +18 -18
  128. package/dist/contract-builder-BVjdRPs_.d.mts.map +0 -1
  129. package/dist/contract-builder-luQwHUCq.mjs.map +0 -1
  130. package/dist/control-adapter-DjoDaUzQ.d.mts +0 -1
  131. package/dist/index-naming-Ct65z5Xk.d.mts.map +0 -1
  132. package/dist/index-naming-fQMLqyC4-4FzPVtCR.mjs.map +0 -1
  133. package/dist/interpreter-C8N5eRW1-CwRYmHO7.mjs.map +0 -1
  134. package/dist/middleware-Bef0uiio.d.mts +0 -1
  135. package/dist/plan-BcpzUEU8.d.mts +0 -2
  136. package/dist/plan-oIjoMLQN-VIXmqAKW.d.mts.map +0 -1
  137. package/dist/query-lane-context-C708TwHD.d.mts +0 -1
  138. package/dist/sql-execution-plan-2C68q5Jo-BCQaqOt4.d.mts.map +0 -1
  139. package/dist/types-ZDEZdGgX.d.mts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"expression-CiiHMYqY.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.mjs"],"sourcesContent":["import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from \"../types-CWwta5EN.mjs\";\nimport { t as planFromAst } from \"../plan-Dh0LbYIv.mjs\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/expression.ts\n/**\n* Resolve a raw value or an Expression into an AST expression node.\n*\n* When `value` is an object with a callable `buildAst`, the AST it wraps is returned. Otherwise the value is embedded as a ParamRef tagged with the caller-supplied {@link CodecRef} (when known). The runtime resolves the ref via `contractCodecs.forCodecRef(codec)`; content-keyed memoisation collapses repeated lookups for the same logical column onto one shared codec.\n*\n* Operation implementations that compare a column-bound expression to a user value derive the column's {@link CodecRef} from the column-bound side (via {@link codecOf}) and forward it here so encode-side dispatch resolves to the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction toExpr(value, codec) {\n\tif (isExpression(value)) return value.buildAst();\n\tif (codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_CODEC_REQUIRED\", `Cannot construct a ParamRef for a ${value === null ? \"null\" : typeof value} value without an explicit codec. Provide a CodecRef at the call site or use a column-bound builder path.`);\n\treturn ParamRef.of(value, { codec });\n}\n/**\n* Construct a `ParamRef` for a value whose codec identity is known at call time. Use this when interpolating a value into a raw SQL expression and the codec cannot be inferred from context — e.g. `param(myDate, { codecId: 'pg/timestamptz-temporal@1' })`.\n*/\nfunction param(value, opts) {\n\treturn ParamRef.of(value, { codec: { codecId: opts.codecId } });\n}\n/**\n* Derive the {@link CodecRef} carried by an expression-like value.\n*\n* Resolution order:\n* 1. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.\n* 2. `{ codecId: wrapper.returnType.codecId }` — minimal ref derived from the expression's declared codec id (covers synthetic expressions like `count()` whose returnType has a known codec id but no explicit column binding).\n*\n* Returns `undefined` for raw scalar values (non-expression-like).\n*/\nfunction codecOf(value) {\n\tif (!isExpression(value)) return void 0;\n\treturn value.returnType?.codec ?? (value.returnType?.codecId ? { codecId: value.returnType.codecId } : void 0);\n}\nfunction isExpression(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Construct an OperationExpr AST node and wrap it as a typed Expression. Operation implementations use this to turn their user-facing arguments into the AST node the compilation pipeline eventually lowers to SQL.\n*/\nfunction buildOperation(spec) {\n\tconst [self, ...rest] = spec.args;\n\tconst op = new OperationExpr({\n\t\tmethod: spec.method,\n\t\tself,\n\t\targs: rest.length > 0 ? rest : void 0,\n\t\treturns: spec.returns,\n\t\tlowering: spec.lowering\n\t});\n\treturn {\n\t\treturnType: spec.returns,\n\t\tbuildAst: () => op\n\t};\n}\nfunction resolveInterpolation(adapter, value) {\n\tif (isExpression(value)) return value.buildAst();\n\tif (value instanceof ParamRef) return value;\n\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"string\" || typeof value === \"boolean\" || value instanceof Uint8Array) return ParamRef.of(value, { codec: { codecId: adapter.inferCodec(value) } });\n\tthrow runtimeError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\");\n}\nfunction isRawRowQuery(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\" && \"build\" in value && typeof value.build === \"function\";\n}\nfunction templateParts(adapter, strings, values) {\n\tconst parts = [strings[0] ?? \"\"];\n\tvalues.forEach((value, i) => {\n\t\tif (isRawRowQuery(value)) parts.push(...value.buildAst().parts);\n\t\telse parts.push(resolveInterpolation(adapter, value));\n\t\tparts.push(strings[i + 1] ?? \"\");\n\t});\n\treturn parts;\n}\n/**\n* Normalizes each authored entry to a {@link RawQueryColumn}. The record is\n* assembled with `Object.fromEntries`, which defines each key as an own\n* property: a spec built at runtime with a `__proto__` key reaches the AST,\n* which refuses it by name, rather than silently setting the record's\n* prototype and leaving the column to vanish.\n*/\nfunction resolveRowSpec(spec) {\n\treturn Object.fromEntries(Object.entries(spec).map(([name, entry]) => [name, typeof entry === \"string\" ? {\n\t\tcodecId: entry,\n\t\tnullable: false\n\t} : {\n\t\tcodecId: entry.codecId,\n\t\tnullable: entry.nullable ?? false\n\t}]));\n}\nfunction createRawSql(adapter, planContext) {\n\tif (planContext === void 0) return (strings, ...values) => new RawSqlBuilderImpl(templateParts(adapter, strings, values));\n\tconst context = planContext;\n\treturn (strings, ...values) => new RawSqlStatementBuilderImpl(templateParts(adapter, strings, values), context);\n}\nvar RawSqlBuilderImpl = class {\n\tparts;\n\tconstructor(parts) {\n\t\tthis.parts = parts;\n\t}\n\treturns(spec) {\n\t\tconst codecId = typeof spec === \"string\" ? spec : spec.codecId;\n\t\tconst nullable = typeof spec === \"string\" ? false : spec.nullable ?? false;\n\t\tconst paramSpec = {\n\t\t\tcodecId,\n\t\t\tnullable\n\t\t};\n\t\tconst node = new RawExpr({\n\t\t\tparts: this.parts,\n\t\t\treturns: paramSpec\n\t\t});\n\t\treturn {\n\t\t\treturnType: {\n\t\t\t\tcodecId,\n\t\t\t\tnullable\n\t\t\t},\n\t\t\tbuildAst: () => node\n\t\t};\n\t}\n};\nvar RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {\n\tplanContext;\n\tconstructor(parts, planContext) {\n\t\tsuper(parts);\n\t\tthis.planContext = planContext;\n\t}\n\treturnsRow(spec) {\n\t\tconst node = RawQueryAst.rows(this.parts, resolveRowSpec(spec));\n\t\tconst result = node.result;\n\t\tinvariant(result.kind === \"rows\", \"RawQueryAst.rows built a non-rows result\");\n\t\treturn {\n\t\t\treturns: result.columns,\n\t\t\tbuildAst: () => node,\n\t\t\tbuild: () => this.planFor(node)\n\t\t};\n\t}\n\taffectedCount() {\n\t\tconst node = RawQueryAst.affectedCount(this.parts);\n\t\treturn { build: () => this.planFor(node) };\n\t}\n\tplanFor(node) {\n\t\treturn planFromAst(node, this.planContext.contract, this.planContext.laneId);\n\t}\n};\n//#endregion\nexport {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EACrE,MAAM,YAAY;GACjB;GACA;EACD;EACA,MAAM,OAAO,IAAI,QAAQ;GACxB,OAAO,KAAK;GACZ,SAAS;EACV,CAAC;EACD,OAAO;GACN,YAAY;IACX;IACA;GACD;GACA,gBAAgB;EACjB;CACD;AACD;AACA,IAAI,6BAA6B,cAAc,kBAAkB;CAChE;CACA,YAAY,OAAO,aAAa;EAC/B,MAAM,KAAK;EACX,KAAK,cAAc;CACpB;CACA,WAAW,MAAM;EAChB,MAAM,OAAO,YAAY,KAAK,KAAK,OAAO,eAAe,IAAI,CAAC;EAC9D,MAAM,SAAS,KAAK;EACpB,UAAU,OAAO,SAAS,QAAQ,0CAA0C;EAC5E,OAAO;GACN,SAAS,OAAO;GAChB,gBAAgB;GAChB,aAAa,KAAK,QAAQ,IAAI;EAC/B;CACD;CACA,gBAAgB;EACf,MAAM,OAAO,YAAY,cAAc,KAAK,KAAK;EACjD,OAAO,EAAE,aAAa,KAAK,QAAQ,IAAI,EAAE;CAC1C;CACA,QAAQ,MAAM;EACb,OAAO,YAAY,MAAM,KAAK,YAAY,UAAU,KAAK,YAAY,MAAM;CAC5E;AACD"}
1
+ {"version":3,"file":"expression-DqrE3myO.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.mjs"],"sourcesContent":["import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from \"../types-ZNKYVjLr.mjs\";\nimport { t as planFromAst } from \"../plan-Dh0LbYIv.mjs\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/expression.ts\n/**\n* Resolve a raw value or an Expression into an AST expression node.\n*\n* When `value` is an object with a callable `buildAst`, the AST it wraps is returned. Otherwise the value is embedded as a ParamRef tagged with the caller-supplied {@link CodecRef} (when known). The runtime resolves the ref via `contractCodecs.forCodecRef(codec)`; content-keyed memoisation collapses repeated lookups for the same logical column onto one shared codec.\n*\n* Operation implementations that compare a column-bound expression to a user value derive the column's {@link CodecRef} from the column-bound side (via {@link codecOf}) and forward it here so encode-side dispatch resolves to the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction toExpr(value, codec) {\n\tif (isExpression(value)) return value.buildAst();\n\tif (codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_CODEC_REQUIRED\", `Cannot construct a ParamRef for a ${value === null ? \"null\" : typeof value} value without an explicit codec. Provide a CodecRef at the call site or use a column-bound builder path.`);\n\treturn ParamRef.of(value, { codec });\n}\n/**\n* Construct a `ParamRef` for a value whose codec identity is known at call time. Use this when interpolating a value into a raw SQL expression and the codec cannot be inferred from context — e.g. `param(myDate, { codecId: 'pg/timestamptz-temporal@1' })`.\n*/\nfunction param(value, opts) {\n\treturn ParamRef.of(value, { codec: { codecId: opts.codecId } });\n}\n/**\n* Derive the {@link CodecRef} carried by an expression-like value.\n*\n* Resolution order:\n* 1. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.\n* 2. `{ codecId: wrapper.returnType.codecId }` — minimal ref derived from the expression's declared codec id (covers synthetic expressions like `count()` whose returnType has a known codec id but no explicit column binding).\n*\n* Returns `undefined` for raw scalar values (non-expression-like).\n*/\nfunction codecOf(value) {\n\tif (!isExpression(value)) return void 0;\n\treturn value.returnType?.codec ?? (value.returnType?.codecId ? { codecId: value.returnType.codecId } : void 0);\n}\nfunction isExpression(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Construct an OperationExpr AST node and wrap it as a typed Expression. Operation implementations use this to turn their user-facing arguments into the AST node the compilation pipeline eventually lowers to SQL.\n*/\nfunction buildOperation(spec) {\n\tconst [self, ...rest] = spec.args;\n\tconst op = new OperationExpr({\n\t\tmethod: spec.method,\n\t\tself,\n\t\targs: rest.length > 0 ? rest : void 0,\n\t\treturns: spec.returns,\n\t\tlowering: spec.lowering\n\t});\n\treturn {\n\t\treturnType: spec.returns,\n\t\tbuildAst: () => op\n\t};\n}\nfunction resolveInterpolation(adapter, value) {\n\tif (isExpression(value)) return value.buildAst();\n\tif (value instanceof ParamRef) return value;\n\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"string\" || typeof value === \"boolean\" || value instanceof Uint8Array) return ParamRef.of(value, { codec: { codecId: adapter.inferCodec(value) } });\n\tthrow runtimeError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\");\n}\nfunction isRawRowQuery(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\" && \"build\" in value && typeof value.build === \"function\";\n}\nfunction templateParts(adapter, strings, values) {\n\tconst parts = [strings[0] ?? \"\"];\n\tvalues.forEach((value, i) => {\n\t\tif (isRawRowQuery(value)) parts.push(...value.buildAst().parts);\n\t\telse parts.push(resolveInterpolation(adapter, value));\n\t\tparts.push(strings[i + 1] ?? \"\");\n\t});\n\treturn parts;\n}\n/**\n* Normalizes each authored entry to a {@link RawQueryColumn}. The record is\n* assembled with `Object.fromEntries`, which defines each key as an own\n* property: a spec built at runtime with a `__proto__` key reaches the AST,\n* which refuses it by name, rather than silently setting the record's\n* prototype and leaving the column to vanish.\n*/\nfunction resolveRowSpec(spec) {\n\treturn Object.fromEntries(Object.entries(spec).map(([name, entry]) => [name, typeof entry === \"string\" ? {\n\t\tcodecId: entry,\n\t\tnullable: false\n\t} : {\n\t\tcodecId: entry.codecId,\n\t\tnullable: entry.nullable ?? false\n\t}]));\n}\nfunction createRawSql(adapter, planContext) {\n\tif (planContext === void 0) return (strings, ...values) => new RawSqlBuilderImpl(templateParts(adapter, strings, values));\n\tconst context = planContext;\n\treturn (strings, ...values) => new RawSqlStatementBuilderImpl(templateParts(adapter, strings, values), context);\n}\nvar RawSqlBuilderImpl = class {\n\tparts;\n\tconstructor(parts) {\n\t\tthis.parts = parts;\n\t}\n\treturns(spec) {\n\t\tconst codecId = typeof spec === \"string\" ? spec : spec.codecId;\n\t\tconst nullable = typeof spec === \"string\" ? false : spec.nullable ?? false;\n\t\tconst paramSpec = {\n\t\t\tcodecId,\n\t\t\tnullable\n\t\t};\n\t\tconst node = new RawExpr({\n\t\t\tparts: this.parts,\n\t\t\treturns: paramSpec\n\t\t});\n\t\treturn {\n\t\t\treturnType: {\n\t\t\t\tcodecId,\n\t\t\t\tnullable\n\t\t\t},\n\t\t\tbuildAst: () => node\n\t\t};\n\t}\n};\nvar RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {\n\tplanContext;\n\tconstructor(parts, planContext) {\n\t\tsuper(parts);\n\t\tthis.planContext = planContext;\n\t}\n\treturnsRow(spec) {\n\t\tconst node = RawQueryAst.rows(this.parts, resolveRowSpec(spec));\n\t\tconst result = node.result;\n\t\tinvariant(result.kind === \"rows\", \"RawQueryAst.rows built a non-rows result\");\n\t\treturn {\n\t\t\treturns: result.columns,\n\t\t\tbuildAst: () => node,\n\t\t\tbuild: () => this.planFor(node)\n\t\t};\n\t}\n\taffectedCount() {\n\t\tconst node = RawQueryAst.affectedCount(this.parts);\n\t\treturn { build: () => this.planFor(node) };\n\t}\n\tplanFor(node) {\n\t\treturn planFromAst(node, this.planContext.contract, this.planContext.laneId);\n\t}\n};\n//#endregion\nexport { buildOperation, codecOf, createRawSql, isExpression, param, toExpr };\n\n//# sourceMappingURL=expression.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,OAAO,OAAO,OAAO;CAC7B,IAAI,aAAa,KAAK,GAAG,OAAO,MAAM,SAAS;CAC/C,IAAI,UAAU,KAAK,GAAG,MAAM,aAAa,oCAAoC,qCAAqC,UAAU,OAAO,SAAS,OAAO,MAAM,0GAA0G;CACnQ,OAAO,SAAS,GAAG,OAAO,EAAE,MAAM,CAAC;AACpC;;;;AAIA,SAAS,MAAM,OAAO,MAAM;CAC3B,OAAO,SAAS,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AA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AAS,OAAO;GAChB,gBAAgB;GAChB,aAAa,KAAK,QAAQ,IAAI;EAC/B;CACD;CACA,gBAAgB;EACf,MAAM,OAAO,YAAY,cAAc,KAAK,KAAK;EACjD,OAAO,EAAE,aAAa,KAAK,QAAQ,IAAI,EAAE;CAC1C;CACA,QAAQ,MAAM;EACb,OAAO,YAAY,MAAM,KAAK,YAAY,UAAU,KAAK,YAAY,MAAM;CAC5E;AACD"}
package/dist/family.d.mts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
2
  import { h as checkSqlDefaultBody } from "./validators-DvtOcB04.mjs";
3
- import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-QiVMjPGA.mjs";
4
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BFPRCYGW-Cmlh0DI_.mjs";
3
+ import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-B2G4GA5s.mjs";
4
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BFPRCYGW-CvvVz-AC.mjs";
5
5
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DrAcUO68.mjs";
6
- import { A as controlPolicyForCall, B as runnerFailure, C as TableNameCaseGuardTable, D as buildNativeTypeExpander, E as assembleAuthoringContributions, F as partitionCallsByControlPolicy, G as temporalCodecPresetWithPrecision, H as sqlDefaultLiteralTagEntry, I as partitionIssuesByControlPolicy, K as temporalStringAuthoringPresets, L as planFieldEventOperations, M as detectDestructiveChanges, N as detectTableNameCaseChanges, O as contractNamespaceToSchemaIR, P as extractCodecControlHooks, R as plannerFailure, S as TIMESTAMP_NOW_GENERATOR_ID, U as temporalAuthoringPresets, V as runnerSuccess, W as temporalCodecPreset, _ as SqlControlFamilyInstance, a as EnumNamespaceSchemaResolver, b as SuppressionRecord, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as PlanFieldEventOperationsOptions, h as PSL_INVALID_DEFAULT_SQL, i as DefaultResolver, j as createMigrationPlan, k as contractToSchemaIR, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, q as timestampNowControlDescriptor, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlControlTargetDescriptor, w as TargetMigrationsCapability, x as TABLE_NAME_CASE_CHANGED_CODE, y as SqlDescribedContractSpace, z as plannerSuccess } from "./control-CuiTzy6O.mjs";
7
- import "./control-adapter-DjoDaUzQ.mjs";
8
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-BB4zE5J1.mjs";
6
+ import { A as controlPolicyForCall, B as runnerFailure, C as TableNameCaseGuardTable, D as buildNativeTypeExpander, E as assembleAuthoringContributions, F as partitionCallsByControlPolicy, G as temporalCodecPresetWithPrecision, H as sqlDefaultLiteralTagEntry, I as partitionIssuesByControlPolicy, K as temporalStringAuthoringPresets, L as planFieldEventOperations, M as detectDestructiveChanges, N as detectTableNameCaseChanges, O as contractNamespaceToSchemaIR, P as extractCodecControlHooks, R as plannerFailure, S as TIMESTAMP_NOW_GENERATOR_ID, U as temporalAuthoringPresets, V as runnerSuccess, W as temporalCodecPreset, _ as SqlControlFamilyInstance, a as EnumNamespaceSchemaResolver, b as SuppressionRecord, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as PlanFieldEventOperationsOptions, h as PSL_INVALID_DEFAULT_SQL, i as DefaultResolver, j as createMigrationPlan, k as contractToSchemaIR, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, q as timestampNowControlDescriptor, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlControlTargetDescriptor, w as TargetMigrationsCapability, x as TABLE_NAME_CASE_CHANGED_CODE, y as SqlDescribedContractSpace, z as plannerSuccess } from "./control-C9oCqe39.mjs";
7
+ import "./control-adapter-Bx5ZQKj-.mjs";
8
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-CwozLSiO.mjs";
9
9
  import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-BLgW_h-1.mjs";
10
- import { t as SqlMigration } from "./migration-ClbaU5Om.mjs";
10
+ import { t as SqlMigration } from "./migration-CniGZoFt.mjs";
11
11
  import { _ as toEnumName, a as PslPrinterOptions, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as toEnumMemberName, h as pluralize, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toFieldName, y as toModelName } from "./psl-infer-CLZsT2Hz.mjs";
12
- import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-C-gasTpn.mjs";
12
+ import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-gCSNgykk.mjs";
13
13
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
14
14
  export { type CodecControlHooks, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultRenderer, type DefaultResolver, type EnumInfo, type EnumNamespaceSchemaResolver, type ExecuteRequestLowerer, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type InferredRelations, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type NativeTypeNormalizer, PSL_INVALID_DEFAULT_SQL, type PlanFieldEventOperationsOptions, type PslPrinterOptions, type PslTypeMap, type PslTypeReference, type PslTypeResolution, type RelationField, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, TIMESTAMP_NOW_GENERATOR_ID, type TableNameCaseGuardTable, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, checkSqlDefaultBody, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, sqlDefaultLiteralTagEntry, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, verifySqlSchemaByDiff };
package/dist/family.mjs CHANGED
@@ -4,10 +4,10 @@ import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classi
4
4
  import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-C4HbCKFe-BD1Fx4JX.mjs";
5
5
  import { n as parseContractMarkerRow } from "./verify-BVk5bjdH-BXgGLM2U.mjs";
6
6
  import { a as temporalStringAuthoringPresets, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, o as timestampNowControlDescriptor, r as temporalCodecPreset, t as TIMESTAMP_NOW_GENERATOR_ID } from "./timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs";
7
- import { _ as plannerSuccess, a as buildNativeTypeExpander, b as sqlDefaultLiteralTagEntry, c as controlPolicyForCall, d as detectDestructiveChanges, f as detectTableNameCaseChanges, g as plannerFailure, h as planFieldEventOperations, i as assembleAuthoringContributions, m as partitionIssuesByControlPolicy, n as PSL_INVALID_DEFAULT_SQL, o as contractNamespaceToSchemaIR, p as partitionCallsByControlPolicy, r as TABLE_NAME_CASE_CHANGED_CODE, s as contractToSchemaIR, t as INIT_ADDITIVE_POLICY, u as createMigrationPlan, v as runnerFailure, y as runnerSuccess } from "./control-l65wQ2NY.mjs";
7
+ import { _ as plannerSuccess, a as buildNativeTypeExpander, b as sqlDefaultLiteralTagEntry, c as controlPolicyForCall, d as detectDestructiveChanges, f as detectTableNameCaseChanges, g as plannerFailure, h as planFieldEventOperations, i as assembleAuthoringContributions, m as partitionIssuesByControlPolicy, n as PSL_INVALID_DEFAULT_SQL, o as contractNamespaceToSchemaIR, p as partitionCallsByControlPolicy, r as TABLE_NAME_CASE_CHANGED_CODE, s as contractToSchemaIR, t as INIT_ADDITIVE_POLICY, u as createMigrationPlan, v as runnerFailure, y as runnerSuccess } from "./control-BGi7ayGb.mjs";
8
8
  import { t as arraysEqual } from "./diff-B16bL_IR.mjs";
9
9
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
10
10
  import { t as SqlMigration } from "./migration-CK4oePIo.mjs";
11
- import { a as mapDefault, c as toEnumName, i as inferRelations, l as toFieldName, n as deriveBackRelationFieldName, o as pluralize, r as deriveRelationFieldName, s as toEnumMemberName, t as buildChildRelationField, u as toModelName } from "./psl-infer-CsCbcmXS.mjs";
11
+ import { a as mapDefault, c as toEnumName, i as inferRelations, l as toFieldName, n as deriveBackRelationFieldName, o as pluralize, r as deriveRelationFieldName, s as toEnumMemberName, t as buildChildRelationField, u as toModelName } from "./psl-infer-6p4x9ebN.mjs";
12
12
  import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-DfvE_FqD.mjs";
13
13
  export { INIT_ADDITIVE_POLICY, SqlMigration as Migration, PSL_INVALID_DEFAULT_SQL, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, TIMESTAMP_NOW_GENERATOR_ID, UNBOUND_DOMAIN_NAMESPACE_ID, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, checkSqlDefaultBody, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, sqlDefaultLiteralTagEntry, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-QiVMjPGA.mjs";
2
- import "./control-adapter-DjoDaUzQ.mjs";
1
+ import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-B2G4GA5s.mjs";
2
+ import "./control-adapter-Bx5ZQKj-.mjs";
3
3
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,5 +1,5 @@
1
1
  import { h as checkSqlDefaultBody } from "./validators-DvtOcB04.mjs";
2
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BFPRCYGW-Cmlh0DI_.mjs";
2
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BFPRCYGW-CvvVz-AC.mjs";
3
3
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DrAcUO68.mjs";
4
- import { A as controlPolicyForCall, B as runnerFailure, C as TableNameCaseGuardTable, D as buildNativeTypeExpander, E as assembleAuthoringContributions, F as partitionCallsByControlPolicy, G as temporalCodecPresetWithPrecision, H as sqlDefaultLiteralTagEntry, I as partitionIssuesByControlPolicy, K as temporalStringAuthoringPresets, L as planFieldEventOperations, M as detectDestructiveChanges, N as detectTableNameCaseChanges, O as contractNamespaceToSchemaIR, P as extractCodecControlHooks, R as plannerFailure, S as TIMESTAMP_NOW_GENERATOR_ID, T as _default, U as temporalAuthoringPresets, V as runnerSuccess, W as temporalCodecPreset, _ as SqlControlFamilyInstance, a as EnumNamespaceSchemaResolver, b as SuppressionRecord, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as PlanFieldEventOperationsOptions, h as PSL_INVALID_DEFAULT_SQL, i as DefaultResolver, j as createMigrationPlan, k as contractToSchemaIR, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, q as timestampNowControlDescriptor, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlControlTargetDescriptor, w as TargetMigrationsCapability, x as TABLE_NAME_CASE_CHANGED_CODE, y as SqlDescribedContractSpace, z as plannerSuccess } from "./control-CuiTzy6O.mjs";
4
+ import { A as controlPolicyForCall, B as runnerFailure, C as TableNameCaseGuardTable, D as buildNativeTypeExpander, E as assembleAuthoringContributions, F as partitionCallsByControlPolicy, G as temporalCodecPresetWithPrecision, H as sqlDefaultLiteralTagEntry, I as partitionIssuesByControlPolicy, K as temporalStringAuthoringPresets, L as planFieldEventOperations, M as detectDestructiveChanges, N as detectTableNameCaseChanges, O as contractNamespaceToSchemaIR, P as extractCodecControlHooks, R as plannerFailure, S as TIMESTAMP_NOW_GENERATOR_ID, T as _default, U as temporalAuthoringPresets, V as runnerSuccess, W as temporalCodecPreset, _ as SqlControlFamilyInstance, a as EnumNamespaceSchemaResolver, b as SuppressionRecord, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as PlanFieldEventOperationsOptions, h as PSL_INVALID_DEFAULT_SQL, i as DefaultResolver, j as createMigrationPlan, k as contractToSchemaIR, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, q as timestampNowControlDescriptor, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlControlTargetDescriptor, w as TargetMigrationsCapability, x as TABLE_NAME_CASE_CHANGED_CODE, y as SqlDescribedContractSpace, z as plannerSuccess } from "./control-C9oCqe39.mjs";
5
5
  export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type DefaultResolver, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, PSL_INVALID_DEFAULT_SQL, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, TIMESTAMP_NOW_GENERATOR_ID, type TableNameCaseGuardTable, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, checkSqlDefaultBody, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, sqlDefaultLiteralTagEntry, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor };
@@ -1,5 +1,5 @@
1
1
  import { n as checkSqlDefaultBody } from "./validators-y6eLjhcb.mjs";
2
2
  import { o as extractCodecControlHooks } from "./schema-verify-CrvQZ5V8-BfrNHJbX.mjs";
3
3
  import { a as temporalStringAuthoringPresets, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, o as timestampNowControlDescriptor, r as temporalCodecPreset, t as TIMESTAMP_NOW_GENERATOR_ID } from "./timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs";
4
- import { _ as plannerSuccess, a as buildNativeTypeExpander, b as sqlDefaultLiteralTagEntry, c as controlPolicyForCall, d as detectDestructiveChanges, f as detectTableNameCaseChanges, g as plannerFailure, h as planFieldEventOperations, i as assembleAuthoringContributions, l as control_default, m as partitionIssuesByControlPolicy, n as PSL_INVALID_DEFAULT_SQL, o as contractNamespaceToSchemaIR, p as partitionCallsByControlPolicy, r as TABLE_NAME_CASE_CHANGED_CODE, s as contractToSchemaIR, t as INIT_ADDITIVE_POLICY, u as createMigrationPlan, v as runnerFailure, y as runnerSuccess } from "./control-l65wQ2NY.mjs";
4
+ import { _ as plannerSuccess, a as buildNativeTypeExpander, b as sqlDefaultLiteralTagEntry, c as controlPolicyForCall, d as detectDestructiveChanges, f as detectTableNameCaseChanges, g as plannerFailure, h as planFieldEventOperations, i as assembleAuthoringContributions, l as control_default, m as partitionIssuesByControlPolicy, n as PSL_INVALID_DEFAULT_SQL, o as contractNamespaceToSchemaIR, p as partitionCallsByControlPolicy, r as TABLE_NAME_CASE_CHANGED_CODE, s as contractToSchemaIR, t as INIT_ADDITIVE_POLICY, u as createMigrationPlan, v as runnerFailure, y as runnerSuccess } from "./control-BGi7ayGb.mjs";
5
5
  export { INIT_ADDITIVE_POLICY, PSL_INVALID_DEFAULT_SQL, TABLE_NAME_CASE_CHANGED_CODE, TIMESTAMP_NOW_GENERATOR_ID, assembleAuthoringContributions, buildNativeTypeExpander, checkSqlDefaultBody, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, sqlDefaultLiteralTagEntry, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor };
@@ -1,3 +1,3 @@
1
- import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-QiVMjPGA.mjs";
2
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-BB4zE5J1.mjs";
1
+ import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-B2G4GA5s.mjs";
2
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-CwozLSiO.mjs";
3
3
  export { type NativeTypeNormalizer, type SqlDiffVerdict, type SqlDiffVerdictInput, type StorageTypeVerdict, type StorageTypeVerdictInput, type VerifySqlSchemaByDiffInput, arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,2 +1,2 @@
1
- import { t as SqlMigration } from "./migration-ClbaU5Om.mjs";
1
+ import { t as SqlMigration } from "./migration-CniGZoFt.mjs";
2
2
  export { SqlMigration as Migration };
@@ -1,5 +1,5 @@
1
1
  import { s as sqlAttributeSpecs } from "./sql-attribute-specs-DAEpjrWl-C0kmaUJt.mjs";
2
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-C1ogrr_x-BbEHaj9p.mjs";
2
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs";
3
3
  //#region ../../../2-sql/9-family/dist/pack.mjs
4
4
  const sqlFamilyPack = {
5
5
  kind: "family",
@@ -1,2 +1,2 @@
1
- import { a as mapDefault, c as toEnumName, i as inferRelations, l as toFieldName, n as deriveBackRelationFieldName, o as pluralize, r as deriveRelationFieldName, s as toEnumMemberName, t as buildChildRelationField, u as toModelName } from "./psl-infer-CsCbcmXS.mjs";
1
+ import { a as mapDefault, c as toEnumName, i as inferRelations, l as toFieldName, n as deriveBackRelationFieldName, o as pluralize, r as deriveRelationFieldName, s as toEnumMemberName, t as buildChildRelationField, u as toModelName } from "./psl-infer-6p4x9ebN.mjs";
2
2
  export { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, mapDefault, pluralize, toEnumMemberName, toEnumName, toFieldName, toModelName };
@@ -1,3 +1,3 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
- import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-C-gasTpn.mjs";
2
+ import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-gCSNgykk.mjs";
3
3
  export { type ResolvedDomainModel, type ResolvedStorageTable, UNBOUND_DOMAIN_NAMESPACE_ID, sqlRuntimeFamilyDescriptor as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };
@@ -1,5 +1,5 @@
1
1
  import { g as truncateToWireNamePrefixBytes, o as defaultIndexName } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
2
- import { n as lowerAuthoredIndex } from "./index-naming-fQMLqyC4-4FzPVtCR.mjs";
2
+ import { r as lowerAuthoredIndex } from "./index-naming-Cj1Anq-T-w1JL7-EM.mjs";
3
3
  //#region ../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs
4
4
  /**
5
5
  * The column-list keys (`"colA,colB"`, order preserved) a table's own
@@ -70,4 +70,4 @@ function materializeForeignKeysAndIndexes(tableName, foreignKeys, declaredIndexe
70
70
  //#endregion
71
71
  export { isBackedByColumnKeys as n, materializeForeignKeysAndIndexes as r, backingIndexColumnKeys as t };
72
72
 
73
- //# sourceMappingURL=foreign-key-materialization-0TrwfShD.mjs.map
73
+ //# sourceMappingURL=foreign-key-materialization-B3HQzQIA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"foreign-key-materialization-0TrwfShD.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { n as lowerAuthoredIndex } from \"./index-naming-fQMLqyC4.mjs\";\nimport { defaultIndexName, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\n//#region src/foreign-key-materialization.ts\n/**\n* The column-list keys (`\"colA,colB\"`, order preserved) a table's own\n* indexes, unique constraints, and primary key already back. A foreign key\n* whose source columns join to one of these keys needs no separately\n* derived backing index.\n*\n* Shared by {@link isBackedByColumnKeys}'s callers: `materializeForeignKeysAndIndexes`\n* (deriving the discrete backing-index entities persisted at `contract emit`)\n* and the postgres PSL inferrer (deciding whether an introspected relation\n* needs an explicit `index: false`).\n*/\nfunction backingIndexColumnKeys(table) {\n\treturn [\n\t\t...table.indexes.flatMap((index) => index.columns !== void 0 ? [index.columns.join(\",\")] : []),\n\t\t...table.uniques.map((unique) => unique.columns.join(\",\")),\n\t\t...table.primaryKey ? [table.primaryKey.columns.join(\",\")] : []\n\t];\n}\n/**\n* Whether `columns`, in order, matches one of `backingKeys` (see\n* {@link backingIndexColumnKeys}). Order-sensitive: `(a, b)` does not\n* satisfy a backing index declared as `(b, a)`.\n*/\nfunction isBackedByColumnKeys(columns, backingKeys) {\n\treturn backingKeys.includes(columns.join(\",\"));\n}\n/**\n* Lowers a table's authored foreign keys into the discrete entities\n* `contract.json` persists: a `constraint: false` FK contributes no\n* `foreignKeys[]` entry, and an `index: true` FK whose columns aren't already\n* backed by a declared index/unique/primary-key contributes a wire-named\n* `indexes[]` entry (byte-budgeted default prefix + content-hash wire name).\n* Declared indexes always survive unchanged; a second FK sharing an already\n* synthesized backing index does not mint a duplicate.\n*/\nfunction materializeForeignKeysAndIndexes(tableName, foreignKeys, declaredIndexes, uniques, primaryKey) {\n\tconst satisfiedIndexColumns = new Set(backingIndexColumnKeys({\n\t\tindexes: declaredIndexes,\n\t\tuniques,\n\t\tprimaryKey\n\t}));\n\tconst synthesizedIndexes = [];\n\tconst materializedForeignKeys = [];\n\tfor (const { constraint, index, ...reference } of foreignKeys) {\n\t\tif (constraint !== false) materializedForeignKeys.push(reference);\n\t\tif (index !== false) {\n\t\t\tconst key = reference.source.columns.join(\",\");\n\t\t\tif (!satisfiedIndexColumns.has(key)) {\n\t\t\t\tsynthesizedIndexes.push(lowerAuthoredIndex(tableName, {\n\t\t\t\t\tcolumns: reference.source.columns,\n\t\t\t\t\twhere: void 0,\n\t\t\t\t\tunique: void 0,\n\t\t\t\t\tmap: void 0,\n\t\t\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, reference.source.columns)),\n\t\t\t\t\ttype: void 0,\n\t\t\t\t\toptions: void 0\n\t\t\t\t}));\n\t\t\t\tsatisfiedIndexColumns.add(key);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tforeignKeys: materializedForeignKeys,\n\t\tindexes: [...declaredIndexes, ...synthesizedIndexes]\n\t};\n}\n//#endregion\nexport { backingIndexColumnKeys, isBackedByColumnKeys, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,OAAO;CACtC,OAAO;EACN,GAAG,MAAM,QAAQ,SAAS,UAAU,MAAM,YAAY,KAAK,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;EAC7F,GAAG,MAAM,QAAQ,KAAK,WAAW,OAAO,QAAQ,KAAK,GAAG,CAAC;EACzD,GAAG,MAAM,aAAa,CAAC,MAAM,WAAW,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC;CAC/D;AACD;;;;;;AAMA,SAAS,qBAAqB,SAAS,aAAa;CACnD,OAAO,YAAY,SAAS,QAAQ,KAAK,GAAG,CAAC;AAC9C;;;;;;;;;;AAUA,SAAS,iCAAiC,WAAW,aAAa,iBAAiB,SAAS,YAAY;CACvG,MAAM,wBAAwB,IAAI,IAAI,uBAAuB;EAC5D,SAAS;EACT;EACA;CACD,CAAC,CAAC;CACF,MAAM,qBAAqB,CAAC;CAC5B,MAAM,0BAA0B,CAAC;CACjC,KAAK,MAAM,EAAE,YAAY,OAAO,GAAG,eAAe,aAAa;EAC9D,IAAI,eAAe,OAAO,wBAAwB,KAAK,SAAS;EAChE,IAAI,UAAU,OAAO;GACpB,MAAM,MAAM,UAAU,OAAO,QAAQ,KAAK,GAAG;GAC7C,IAAI,CAAC,sBAAsB,IAAI,GAAG,GAAG;IACpC,mBAAmB,KAAK,mBAAmB,WAAW;KACrD,SAAS,UAAU,OAAO;KAC1B,OAAO,KAAK;KACZ,QAAQ,KAAK;KACb,KAAK,KAAK;KACV,MAAM,8BAA8B,iBAAiB,WAAW,UAAU,OAAO,OAAO,CAAC;KACzF,MAAM,KAAK;KACX,SAAS,KAAK;IACf,CAAC,CAAC;IACF,sBAAsB,IAAI,GAAG;GAC9B;EACD;CACD;CACA,OAAO;EACN,aAAa;EACb,SAAS,CAAC,GAAG,iBAAiB,GAAG,kBAAkB;CACpD;AACD"}
1
+ {"version":3,"file":"foreign-key-materialization-B3HQzQIA.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { r as lowerAuthoredIndex } from \"./index-naming-Cj1Anq-T.mjs\";\nimport { defaultIndexName, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\n//#region src/foreign-key-materialization.ts\n/**\n* The column-list keys (`\"colA,colB\"`, order preserved) a table's own\n* indexes, unique constraints, and primary key already back. A foreign key\n* whose source columns join to one of these keys needs no separately\n* derived backing index.\n*\n* Shared by {@link isBackedByColumnKeys}'s callers: `materializeForeignKeysAndIndexes`\n* (deriving the discrete backing-index entities persisted at `contract emit`)\n* and the postgres PSL inferrer (deciding whether an introspected relation\n* needs an explicit `index: false`).\n*/\nfunction backingIndexColumnKeys(table) {\n\treturn [\n\t\t...table.indexes.flatMap((index) => index.columns !== void 0 ? [index.columns.join(\",\")] : []),\n\t\t...table.uniques.map((unique) => unique.columns.join(\",\")),\n\t\t...table.primaryKey ? [table.primaryKey.columns.join(\",\")] : []\n\t];\n}\n/**\n* Whether `columns`, in order, matches one of `backingKeys` (see\n* {@link backingIndexColumnKeys}). Order-sensitive: `(a, b)` does not\n* satisfy a backing index declared as `(b, a)`.\n*/\nfunction isBackedByColumnKeys(columns, backingKeys) {\n\treturn backingKeys.includes(columns.join(\",\"));\n}\n/**\n* Lowers a table's authored foreign keys into the discrete entities\n* `contract.json` persists: a `constraint: false` FK contributes no\n* `foreignKeys[]` entry, and an `index: true` FK whose columns aren't already\n* backed by a declared index/unique/primary-key contributes a wire-named\n* `indexes[]` entry (byte-budgeted default prefix + content-hash wire name).\n* Declared indexes always survive unchanged; a second FK sharing an already\n* synthesized backing index does not mint a duplicate.\n*/\nfunction materializeForeignKeysAndIndexes(tableName, foreignKeys, declaredIndexes, uniques, primaryKey) {\n\tconst satisfiedIndexColumns = new Set(backingIndexColumnKeys({\n\t\tindexes: declaredIndexes,\n\t\tuniques,\n\t\tprimaryKey\n\t}));\n\tconst synthesizedIndexes = [];\n\tconst materializedForeignKeys = [];\n\tfor (const { constraint, index, ...reference } of foreignKeys) {\n\t\tif (constraint !== false) materializedForeignKeys.push(reference);\n\t\tif (index !== false) {\n\t\t\tconst key = reference.source.columns.join(\",\");\n\t\t\tif (!satisfiedIndexColumns.has(key)) {\n\t\t\t\tsynthesizedIndexes.push(lowerAuthoredIndex(tableName, {\n\t\t\t\t\tcolumns: reference.source.columns,\n\t\t\t\t\twhere: void 0,\n\t\t\t\t\tunique: void 0,\n\t\t\t\t\tmap: void 0,\n\t\t\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, reference.source.columns)),\n\t\t\t\t\ttype: void 0,\n\t\t\t\t\toptions: void 0\n\t\t\t\t}));\n\t\t\t\tsatisfiedIndexColumns.add(key);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tforeignKeys: materializedForeignKeys,\n\t\tindexes: [...declaredIndexes, ...synthesizedIndexes]\n\t};\n}\n//#endregion\nexport { backingIndexColumnKeys, isBackedByColumnKeys, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,OAAO;CACtC,OAAO;EACN,GAAG,MA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O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-DhYcyD0K-DImmT7YD.mjs";
4
- import { t as Adapter } from "./ast-D7JjbK8E.mjs";
5
- import { n as SqlQueryPlan } from "./plan-oIjoMLQN-VIXmqAKW.mjs";
6
- import { t as SqlExecutionPlan } from "./sql-execution-plan-2C68q5Jo-BCQaqOt4.mjs";
7
- import "./plan-BcpzUEU8.mjs";
8
- import { n as CodecDescriptorRegistry } from "./query-lane-context-cqWxvUWZ-Cl8U5ljU.mjs";
9
- import "./query-lane-context-C708TwHD.mjs";
10
- import { A as SqlMiddleware } from "./prepared-statement-DZtymlzd-D_INawdF.mjs";
3
+ import { O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-BXSw7th1-pL1Iggyd.mjs";
4
+ import { t as Adapter } from "./ast-BHZ0g4iL.mjs";
5
+ import { n as SqlQueryPlan } from "./plan-Bs-Pdirc-BCy94--G.mjs";
6
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-S3HvDKIP-8KF1nBHu.mjs";
7
+ import "./plan-BEJGOQ-l.mjs";
8
+ import { n as CodecDescriptorRegistry } from "./query-lane-context-QIUURgPP-CvQ9jQRm.mjs";
9
+ import "./query-lane-context-yy5kDAlG.mjs";
10
+ import { A as SqlMiddleware } from "./prepared-statement-DZtymlzd-DFIuG_WK.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
12
12
  import { AfterExecuteResult as AfterExecuteResult$1, AfterQueryResult as AfterQueryResult$1, ExecuteInterceptResult as ExecuteInterceptResult$1, QueryInterceptResult as QueryInterceptResult$1, RuntimeLog as Log } from "@prisma/orm-framework/components/runtime";
13
13
  //#region ../../../2-sql/5-runtime/dist/index.d.mts
@@ -81,4 +81,4 @@ interface LintsOptions {
81
81
  declare function lints(options?: LintsOptions): SqlMiddleware;
82
82
  //#endregion
83
83
  export { LintsOptions as a, budgets as c, lints as d, lowerSqlPlan as f, ExecuteInterceptResult$1 as i, createAstCodecRegistry as l, validateContractCodecMappings as m, AfterQueryResult$1 as n, Log as o, validateCodecRegistryCompleteness as p, BudgetsOptions as r, QueryInterceptResult$1 as s, AfterExecuteResult$1 as t, extractCodecIds as u };
84
- //# sourceMappingURL=index-DfRCPDMK.d.mts.map
84
+ //# sourceMappingURL=index-CA_WLNy1.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DfRCPDMK.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
1
+ {"version":3,"file":"index-CA_WLNy1.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
@@ -40,6 +40,15 @@ type AuthoredIndexInput = AuthoredIndexElements & AuthoredIndexMethod & {
40
40
  readonly map: string | undefined;
41
41
  readonly name: string | undefined;
42
42
  };
43
+ /**
44
+ * Narrows the opaque payload a contributed model attribute returns under
45
+ * `index` (see `AuthoringModelAttributeIndexOutput`). The framework hands the
46
+ * value through untyped because an index's shape belongs to the family; this
47
+ * is the SQL family's boundary check. It proves the structure only — the
48
+ * name/map and expression rules stay where `@@index` enforces them, in
49
+ * {@link lowerAuthoredIndex}.
50
+ */
51
+ declare function isAuthoredIndexInput(value: unknown): value is AuthoredIndexInput;
43
52
  /**
44
53
  * Mints the exact-name body-comparison warning for a `map:`-named object
45
54
  * carrying a hand-authorable SQL body — fully formed, so the transport and
@@ -58,5 +67,5 @@ declare function exactNameBodyWarning(subject: 'index' | 'policy' | 'check', exa
58
67
  */
59
68
  declare function lowerAuthoredIndex(tableName: string, authored: AuthoredIndexInput, warnings?: AuthoringWarningSink): IndexInput;
60
69
  //#endregion
61
- export { lowerAuthoredIndex as i, AuthoredIndexMethod as n, exactNameBodyWarning as r, AuthoredIndexInput as t };
62
- //# sourceMappingURL=index-naming-Ct65z5Xk.d.mts.map
70
+ export { lowerAuthoredIndex as a, isAuthoredIndexInput as i, AuthoredIndexMethod as n, exactNameBodyWarning as r, AuthoredIndexInput as t };
71
+ //# sourceMappingURL=index-naming-BNIXvg5R.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-naming-BNIXvg5R.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming.d.mts"],"mappings":";;;;;;;;KAOK;WACM;WACA;;WAEA;WACA;;;;;;;;;KASN;WACM;WACA;;WAEA;WACA,SAAS;;;;;;;;;KASf,qBAAqB,wBAAwB;WACvC;WACA;WACA;WACA;;;;;;;;;;iBAUM,qBAAqB,iBAAiB,SAAS;;;;;;;;;iBAS/C,qBAAqB,uCAAuC,oBAAoB;;;;;;;;iBAQhF,mBAAmB,mBAAmB,UAAU,oBAAoB,WAAW,uBAAuB"}
@@ -1,7 +1,31 @@
1
1
  import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
2
2
  import { a as computeIndexContentHash, n as assertWireNamePrefixLength, o as defaultIndexName } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
3
3
  import { flushAuthoringWarnings } from "@prisma/orm-framework/components/authoring";
4
- //#region ../../../2-sql/1-core/contract/dist/index-naming-fQMLqyC4.mjs
4
+ //#region ../../../2-sql/1-core/contract/dist/index-naming-Cj1Anq-T.mjs
5
+ /**
6
+ * Narrows the opaque payload a contributed model attribute returns under
7
+ * `index` (see `AuthoringModelAttributeIndexOutput`). The framework hands the
8
+ * value through untyped because an index's shape belongs to the family; this
9
+ * is the SQL family's boundary check. It proves the structure only — the
10
+ * name/map and expression rules stay where `@@index` enforces them, in
11
+ * {@link lowerAuthoredIndex}.
12
+ */
13
+ function isAuthoredIndexInput(value) {
14
+ if (typeof value !== "object" || value === null) return false;
15
+ const candidate = { ...value };
16
+ if (typeof candidate["expression"] === "string" === (Array.isArray(candidate["columns"]) && candidate["columns"].every((element) => typeof element === "string"))) return false;
17
+ if (!isOptionalString(candidate["where"])) return false;
18
+ if (!isOptionalString(candidate["map"])) return false;
19
+ if (!isOptionalString(candidate["name"])) return false;
20
+ if (candidate["unique"] !== void 0 && typeof candidate["unique"] !== "boolean") return false;
21
+ if (candidate["type"] === void 0) return candidate["options"] === void 0;
22
+ if (typeof candidate["type"] !== "string") return false;
23
+ const options = candidate["options"];
24
+ return options === void 0 || typeof options === "object" && options !== null && !Array.isArray(options);
25
+ }
26
+ function isOptionalString(value) {
27
+ return value === void 0 || typeof value === "string";
28
+ }
5
29
  const EXACT_NAME_BODY_PREAMBLE = "Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.";
6
30
  /**
7
31
  * Per-subject remediation: an index or check moves to wire naming via
@@ -105,6 +129,6 @@ function lowerAuthoredIndex(tableName, authored, warnings) {
105
129
  };
106
130
  }
107
131
  //#endregion
108
- export { lowerAuthoredIndex as n, exactNameBodyWarning as t };
132
+ export { isAuthoredIndexInput as n, lowerAuthoredIndex as r, exactNameBodyWarning as t };
109
133
 
110
- //# sourceMappingURL=index-naming-fQMLqyC4-4FzPVtCR.mjs.map
134
+ //# sourceMappingURL=index-naming-Cj1Anq-T-w1JL7-EM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-naming-Cj1Anq-T-w1JL7-EM.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming-Cj1Anq-T.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName } from \"@internal/sql-schema-ir/naming\";\n//#region src/index-naming.ts\n/**\n* Narrows the opaque payload a contributed model attribute returns under\n* `index` (see `AuthoringModelAttributeIndexOutput`). The framework hands the\n* value through untyped because an index's shape belongs to the family; this\n* is the SQL family's boundary check. It proves the structure only — the\n* name/map and expression rules stay where `@@index` enforces them, in\n* {@link lowerAuthoredIndex}.\n*/\nfunction isAuthoredIndexInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = { ...value };\n\tif (typeof candidate[\"expression\"] === \"string\" === (Array.isArray(candidate[\"columns\"]) && candidate[\"columns\"].every((element) => typeof element === \"string\"))) return false;\n\tif (!isOptionalString(candidate[\"where\"])) return false;\n\tif (!isOptionalString(candidate[\"map\"])) return false;\n\tif (!isOptionalString(candidate[\"name\"])) return false;\n\tif (candidate[\"unique\"] !== void 0 && typeof candidate[\"unique\"] !== \"boolean\") return false;\n\tif (candidate[\"type\"] === void 0) return candidate[\"options\"] === void 0;\n\tif (typeof candidate[\"type\"] !== \"string\") return false;\n\tconst options = candidate[\"options\"];\n\treturn options === void 0 || typeof options === \"object\" && options !== null && !Array.isArray(options);\n}\nfunction isOptionalString(value) {\n\treturn value === void 0 || typeof value === \"string\";\n}\nconst EXACT_NAME_BODY_PREAMBLE = \"Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.\";\n/**\n* Per-subject remediation: an index or check moves to wire naming via\n* `name:`; a policy has no such parameter — dropping `@@map` makes the\n* block's head the wire prefix.\n*/\nconst EXACT_NAME_BODY_REMEDIATION = {\n\tindex: \"For hand-authored definitions, use name: and let Prisma 8 manage the physical name; to migrate an adopted object to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\",\n\tpolicy: \"For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration.\",\n\tcheck: \"For hand-authored definitions, use name: and let Prisma 8 manage the physical name; to migrate an adopted check to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\"\n};\n/** What the user actually wrote, per subject: index and check `map:`, policy `@@map`. */\nconst EXACT_NAME_FEATURE = {\n\tindex: \"map:\",\n\tpolicy: \"@@map\",\n\tcheck: \"map:\"\n};\nconst EXACT_NAME_BODY_WARNING_CODE = \"PN_EXACT_NAME_BODY_COMPARISON\";\n/**\n* Mints the exact-name body-comparison warning for a `map:`-named object\n* carrying a hand-authorable SQL body — fully formed, so the transport and\n* the flush stay generic. `subject` distinguishes the index, policy, and\n* check callers that mint this same warning; the feature name and the\n* remediation are subject-specific end to end, so a batched summary\n* (grouped on code + summary) is true of every object it covers.\n*/\nfunction exactNameBodyWarning(subject, exactName) {\n\tconst item = `${subject} \"${exactName}\"`;\n\tconst feature = EXACT_NAME_FEATURE[subject];\n\tconst tail = `with a SQL body. ${EXACT_NAME_BODY_PREAMBLE} ${EXACT_NAME_BODY_REMEDIATION[subject]}`;\n\treturn {\n\t\tcode: EXACT_NAME_BODY_WARNING_CODE,\n\t\tmessage: `${item} uses ${feature} ${tail}`,\n\t\titem,\n\t\tsummary: `objects use ${feature} ${tail}`\n\t};\n}\n/**\n* Lowers an authored index into the name-identified entity `contract.json`\n* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire\n* mode appends the content-hash suffix to the authored or default prefix.\n* The cross-field guards are the shared enforcement backstop for both\n* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).\n*/\nfunction lowerAuthoredIndex(tableName, authored, warnings) {\n\tif (authored.columns === void 0 === (authored.expression === void 0)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an index takes either fields (columns) or an expression — exactly one, not both.`);\n\tif (authored.map !== void 0 && authored.name !== void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index \"${authored.map}\" on table \"${tableName}\": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);\n\tif (authored.expression !== void 0 && authored.name === void 0 && authored.map === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an expression index requires an explicit name (name:) or exact physical name (map:) — a default name cannot be derived from an expression.`);\n\tif (authored.options !== void 0 && authored.type === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": options requires an explicit type — an index with options but no type cannot round-trip through contract infer (the emitted type: would change the wire name).`);\n\tconst unique = authored.unique ?? false;\n\tif (authored.map !== void 0) {\n\t\tif (authored.expression !== void 0 || authored.where !== void 0) {\n\t\t\tconst warning = exactNameBodyWarning(\"index\", authored.map);\n\t\t\tif (warnings !== void 0) warnings.push(warning);\n\t\t\telse flushAuthoringWarnings([warning]);\n\t\t}\n\t\tconst carried = {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: authored.map\n\t\t\t},\n\t\t\twhere: authored.where,\n\t\t\tunique,\n\t\t\ttype: authored.type,\n\t\t\toptions: authored.options\n\t\t};\n\t\treturn authored.expression !== void 0 ? {\n\t\t\t...carried,\n\t\t\texpression: authored.expression\n\t\t} : {\n\t\t\t...carried,\n\t\t\tcolumns: authored.columns ?? []\n\t\t};\n\t}\n\tconst prefix = authored.name ?? defaultIndexName(tableName, authored.columns ?? []);\n\tassertWireNamePrefixLength(prefix, \"index prefix\");\n\tconst carried = {\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix,\n\t\t\thash: computeIndexContentHash({\n\t\t\t\t...authored.columns !== void 0 && { columns: authored.columns },\n\t\t\t\t...authored.expression !== void 0 && { expression: authored.expression },\n\t\t\t\t...authored.where !== void 0 && { where: authored.where },\n\t\t\t\tunique,\n\t\t\t\t...authored.type !== void 0 && { type: authored.type },\n\t\t\t\t...authored.options !== void 0 && { options: authored.options }\n\t\t\t})\n\t\t},\n\t\twhere: authored.where,\n\t\tunique,\n\t\ttype: authored.type,\n\t\toptions: authored.options\n\t};\n\treturn authored.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: authored.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: authored.columns ?? []\n\t};\n}\n//#endregion\nexport { isAuthoredIndexInput as n, lowerAuthoredIndex as r, exactNameBodyWarning as t };\n\n//# sourceMappingURL=index-naming-Cj1Anq-T.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,qBAAqB,OAAO;CACpC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY,EAAE,GAAG,MAAM;CAC7B,IAAI,OAAO,UAAU,kBAAkB,cAAc,MAAM,QAAQ,UAAU,UAAU,KAAK,UAAU,UAAU,CAAC,OAAO,YAAY,OAAO,YAAY,QAAQ,IAAI,OAAO;CAC1K,IAAI,CAAC,iBAAiB,UAAU,QAAQ,GAAG,OAAO;CAClD,IAAI,CAAC,iBAAiB,UAAU,MAAM,GAAG,OAAO;CAChD,IAAI,CAAC,iBAAiB,UAAU,OAAO,GAAG,OAAO;CACjD,IAAI,UAAU,cAAc,KAAK,KAAK,OAAO,UAAU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1,5 +1,6 @@
1
+ import { n as isAuthoredIndexInput } from "./index-naming-Cj1Anq-T-w1JL7-EM.mjs";
1
2
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
2
- import { n as buildSqlContractFromDefinition } from "./derived-checks-C4BPtrnO-CmWM7df_.mjs";
3
+ import { n as buildSqlContractFromDefinition } from "./derived-checks-C4BPtrnO-B9MQRh6W.mjs";
3
4
  import { a as interpretFieldAttribute, i as findModelAttributeNode, n as fieldSpecContext, o as interpretModelAttribute, r as findFieldAttributeNode, s as sqlAttributeSpecs, t as PSL_CHECK_ON_STI_VARIANT } from "./sql-attribute-specs-DAEpjrWl-C0kmaUJt.mjs";
4
5
  import { t as defaultTableName } from "./default-table-name-BfFY8qYR-lHNcVmY5.mjs";
5
6
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
@@ -15,7 +16,7 @@ import { describeTaggedLiteralFailure } from "@prisma/orm-framework/components/c
15
16
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
16
17
  import { createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, keywordPslSpan, nodePslSpan } from "@prisma/orm-framework/psl-parser";
17
18
  import { consumeInvalidFkPairing, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
18
- //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-C8N5eRW1.mjs
19
+ //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-Bf7Um__3.mjs
19
20
  function contractError(code, message, options) {
20
21
  return structuredError(code, message, options);
21
22
  }
@@ -2439,7 +2440,7 @@ function buildModelNodeFromPsl(input) {
2439
2440
  }
2440
2441
  const contributedModelAttribute = input.modelAttributesByName.get(modelAttribute.name);
2441
2442
  if (contributedModelAttribute !== void 0) {
2442
- if (declaredContributedModelAttributes.has(modelAttribute.name)) {
2443
+ if (contributedModelAttribute.repeatable !== true && declaredContributedModelAttributes.has(modelAttribute.name)) {
2443
2444
  diagnostics.push(duplicateModelAttributeDiagnostic({
2444
2445
  name: modelAttribute.name,
2445
2446
  modelName: model.name,
@@ -2471,6 +2472,8 @@ function buildModelNodeFromPsl(input) {
2471
2472
  target: input.targetId,
2472
2473
  modelName: model.name,
2473
2474
  storageName: tableName,
2475
+ fieldStorageName: (fieldName) => mapping.fieldColumns.get(fieldName),
2476
+ fieldCodecId: (fieldName) => resolvedFields.find((resolved) => resolved.field.name === fieldName)?.descriptor.codecId,
2474
2477
  namespaceId: modelNamespaceId ?? input.defaultNamespaceId,
2475
2478
  sourceId: source.sources.sourceFileFor(source.node).filename,
2476
2479
  diagnostics: { push: (d) => {
@@ -2478,6 +2481,14 @@ function buildModelNodeFromPsl(input) {
2478
2481
  } }
2479
2482
  });
2480
2483
  if (lowered === void 0) continue;
2484
+ if ("index" in lowered) {
2485
+ if (!isAuthoredIndexInput(lowered.index)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `model attribute "@@${modelAttribute.name}" on model "${model.name}" lowered to a malformed index. A contributed attribute that returns { index } must return an authored-index input: exactly one of a columns list or an expression, plus explicit where/unique/name/map and a type-with-options pair.`, { meta: {
2486
+ attribute: modelAttribute.name,
2487
+ modelName: model.name
2488
+ } });
2489
+ indexNodes.push(lowered.index);
2490
+ continue;
2491
+ }
2481
2492
  const slot = modelAttributeEntities[contributedModelAttribute.attribute] ?? {};
2482
2493
  modelAttributeEntities[contributedModelAttribute.attribute] = slot;
2483
2494
  slot[lowered.key] = lowered.entity;
@@ -3534,4 +3545,4 @@ function interpretPslDocumentToSqlContract(input) {
3534
3545
  //#endregion
3535
3546
  export { normalizeReferentialAction as a, interpretPslDocumentToSqlContract as i, buildEntityTypesByDiscriminator as n, numberLiteralDefault as o, indexFkRelations as r, resolveFieldTypeDescriptor as s, applyBackrelationCandidates as t };
3536
3547
 
3537
- //# sourceMappingURL=interpreter-C8N5eRW1-CwRYmHO7.mjs.map
3548
+ //# sourceMappingURL=interpreter-Bf7Um__3-DC_thY44.mjs.map