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

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 (97) hide show
  1. package/dist/{aggregate-descriptor-registry-C7hel5O7.mjs → aggregate-descriptor-registry-YRK_hT8V.mjs} +2 -2
  2. package/dist/{aggregate-descriptor-registry-C7hel5O7.mjs.map → aggregate-descriptor-registry-YRK_hT8V.mjs.map} +1 -1
  3. package/dist/{ast-DuLukI6f.d.mts → ast-BAsreJBG.d.mts} +3 -3
  4. package/dist/{ast-DuLukI6f.d.mts.map → ast-BAsreJBG.d.mts.map} +1 -1
  5. package/dist/{ast-5tg0fGPQ.mjs → ast-CS0lZ0OC.mjs} +2 -2
  6. package/dist/{ast-5tg0fGPQ.mjs.map → ast-CS0lZ0OC.mjs.map} +1 -1
  7. package/dist/builder.d.mts +2 -2
  8. package/dist/builder__runtime.d.mts +8 -10
  9. package/dist/builder__runtime.d.mts.map +1 -1
  10. package/dist/builder__runtime.mjs +15 -20
  11. package/dist/builder__runtime.mjs.map +1 -1
  12. package/dist/builder__types.d.mts +2 -2
  13. package/dist/{control-b-6t8eI_.d.mts → control-CYQ2U777.d.mts} +6 -6
  14. package/dist/{control-b-6t8eI_.d.mts.map → control-CYQ2U777.d.mts.map} +1 -1
  15. package/dist/control-adapter-BPttH3He.d.mts +1 -0
  16. package/dist/{control-adapter-C99J7aEF-GODO43Ai.d.mts → control-adapter-C99J7aEF-CUDc48SO.d.mts} +4 -4
  17. package/dist/{control-adapter-C99J7aEF-GODO43Ai.d.mts.map → control-adapter-C99J7aEF-CUDc48SO.d.mts.map} +1 -1
  18. package/dist/{db-BhQdL6Za-DubRGJvv.d.mts → db-BhQdL6Za-817R9elv.d.mts} +6 -6
  19. package/dist/{db-BhQdL6Za-DubRGJvv.d.mts.map → db-BhQdL6Za-817R9elv.d.mts.map} +1 -1
  20. package/dist/{ddl-types-CXx4vPz6-Dko-GTTj.d.mts → ddl-types-CA-aj1rO-B_BdxyXC.d.mts} +3 -3
  21. package/dist/{ddl-types-CXx4vPz6-Dko-GTTj.d.mts.map → ddl-types-CA-aj1rO-B_BdxyXC.d.mts.map} +1 -1
  22. package/dist/{diff-CN1ou7vM.d.mts → diff-CFhK3Q3k.d.mts} +3 -3
  23. package/dist/{diff-CN1ou7vM.d.mts.map → diff-CFhK3Q3k.d.mts.map} +1 -1
  24. package/dist/{expression-mku9I7Ue.d.mts → expression-BtebKpK2.d.mts} +8 -8
  25. package/dist/expression-BtebKpK2.d.mts.map +1 -0
  26. package/dist/{expression-B2Ox7zKM.mjs → expression-CiiHMYqY.mjs} +11 -15
  27. package/dist/expression-CiiHMYqY.mjs.map +1 -0
  28. package/dist/family.d.mts +7 -7
  29. package/dist/family__control-adapter.d.mts +2 -2
  30. package/dist/family__control.d.mts +2 -2
  31. package/dist/family__diff.d.mts +2 -2
  32. package/dist/family__migration.d.mts +1 -1
  33. package/dist/family__runtime.d.mts +1 -1
  34. package/dist/{index-DzBzeTAy.d.mts → index-Bkg5fqsf.d.mts} +9 -9
  35. package/dist/{index-DzBzeTAy.d.mts.map → index-Bkg5fqsf.d.mts.map} +1 -1
  36. package/dist/{middleware-AhTz1BOW-CtQWS4mb.d.mts → middleware-CAQqWuBd-pOZt5VBK.d.mts} +3 -3
  37. package/dist/{middleware-AhTz1BOW-CtQWS4mb.d.mts.map → middleware-CAQqWuBd-pOZt5VBK.d.mts.map} +1 -1
  38. package/dist/middleware-ERea8Bpj.d.mts +1 -0
  39. package/dist/{migration-Bhce5i_m.d.mts → migration-CkjRhB8h.d.mts} +2 -2
  40. package/dist/{migration-Bhce5i_m.d.mts.map → migration-CkjRhB8h.d.mts.map} +1 -1
  41. package/dist/orm-client.d.mts +62 -24
  42. package/dist/orm-client.d.mts.map +1 -1
  43. package/dist/orm-client.mjs +259 -50
  44. package/dist/orm-client.mjs.map +1 -1
  45. package/dist/plan-DT6ur9_C.d.mts +2 -0
  46. package/dist/{plan-CDxduYaN-B2kMLIQQ.d.mts → plan-oIjoMLQN-Cgljp0gc.d.mts} +10 -6
  47. package/dist/plan-oIjoMLQN-Cgljp0gc.d.mts.map +1 -0
  48. package/dist/{prepared-statement-9QpkE6JG-B9xqBu5T.d.mts → prepared-statement-9QpkE6JG-3LY-d6pU.d.mts} +13 -13
  49. package/dist/{prepared-statement-9QpkE6JG-B9xqBu5T.d.mts.map → prepared-statement-9QpkE6JG-3LY-d6pU.d.mts.map} +1 -1
  50. package/dist/query-lane-context-Dra2wgIo.d.mts +1 -0
  51. package/dist/{query-lane-context-Qa-eddrE-BQV6J9nV.d.mts → query-lane-context-cqWxvUWZ-DU48PEoC.d.mts} +3 -3
  52. package/dist/{query-lane-context-Qa-eddrE-BQV6J9nV.d.mts.map → query-lane-context-cqWxvUWZ-DU48PEoC.d.mts.map} +1 -1
  53. package/dist/relational-core.d.mts +12 -12
  54. package/dist/relational-core.mjs +4 -4
  55. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  56. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  57. package/dist/relational-core__ast.d.mts +3 -3
  58. package/dist/relational-core__ast.mjs +2 -2
  59. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  60. package/dist/relational-core__contract-free.d.mts +2 -2
  61. package/dist/relational-core__contract-free.mjs +1 -1
  62. package/dist/relational-core__contract-free.mjs.map +1 -1
  63. package/dist/relational-core__expression.d.mts +2 -2
  64. package/dist/relational-core__expression.mjs +2 -2
  65. package/dist/relational-core__middleware.d.mts +2 -2
  66. package/dist/relational-core__plan.d.mts +4 -4
  67. package/dist/relational-core__query-lane-context.d.mts +2 -2
  68. package/dist/relational-core__types.d.mts +2 -2
  69. package/dist/{runtime-CzCx0TKe.d.mts → runtime-BhA8jUsk.d.mts} +3 -3
  70. package/dist/{runtime-CzCx0TKe.d.mts.map → runtime-BhA8jUsk.d.mts.map} +1 -1
  71. package/dist/runtime.d.mts +4 -4
  72. package/dist/runtime.mjs +6 -6
  73. package/dist/runtime.mjs.map +1 -1
  74. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  75. package/dist/{sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts → sql-execution-plan-2C68q5Jo-5sJRnbj0.d.mts} +3 -3
  76. package/dist/sql-execution-plan-2C68q5Jo-5sJRnbj0.d.mts.map +1 -0
  77. package/dist/{types-Dt4e_jC--COeP8xzN.mjs → types-CWwta5EN-BS4OsQAL.mjs} +7 -5
  78. package/dist/types-CWwta5EN-BS4OsQAL.mjs.map +1 -0
  79. package/dist/types-DL0mGtxm.d.mts +1 -0
  80. package/dist/{types-v3qxLLxo-Clw_yBAh.d.mts → types-DhYcyD0K-Brj7SwFA.d.mts} +6 -5
  81. package/dist/types-DhYcyD0K-Brj7SwFA.d.mts.map +1 -0
  82. package/dist/{types-IqZMLrFC-BIRftuU7.d.mts → types-IqZMLrFC-BQmtKloA.d.mts} +2 -2
  83. package/dist/{types-IqZMLrFC-BIRftuU7.d.mts.map → types-IqZMLrFC-BQmtKloA.d.mts.map} +1 -1
  84. package/dist/{types-CyxGtOOh-BJnoWm0f.d.mts → types-thCvr3t--BKg5flQM.d.mts} +6 -6
  85. package/dist/{types-CyxGtOOh-BJnoWm0f.d.mts.map → types-thCvr3t--BKg5flQM.d.mts.map} +1 -1
  86. package/package.json +17 -17
  87. package/dist/control-adapter-DzTFiMaG.d.mts +0 -1
  88. package/dist/expression-B2Ox7zKM.mjs.map +0 -1
  89. package/dist/expression-mku9I7Ue.d.mts.map +0 -1
  90. package/dist/middleware-Cev-ZFyS.d.mts +0 -1
  91. package/dist/plan-C7VP7jOh.d.mts +0 -2
  92. package/dist/plan-CDxduYaN-B2kMLIQQ.d.mts.map +0 -1
  93. package/dist/query-lane-context-CGdMIEuv.d.mts +0 -1
  94. package/dist/sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts.map +0 -1
  95. package/dist/types-Dt4e_jC--COeP8xzN.mjs.map +0 -1
  96. package/dist/types-DvsoMNLs.d.mts +0 -1
  97. package/dist/types-v3qxLLxo-Clw_yBAh.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"diff-CN1ou7vM.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
1
+ {"version":3,"file":"diff-CFhK3Q3k.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
@@ -2,9 +2,9 @@ import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import { S as QueryOperationReturn } from "./types-BDUG29Df-LE85dIXP.mjs";
3
3
  import "./types-C36_3E6_.mjs";
4
4
  import { t as SqlLoweringSpec } from "./index-CLAshwKN.mjs";
5
- import { Ct as RawQueryColumn, St as RawQueryAst, T as CodecRef$1, Tt as RawSqlLiteral, _t as ParamRef, s as AnyExpression } from "./types-v3qxLLxo-Clw_yBAh.mjs";
5
+ import { Ct as RawQueryColumn, St as RawQueryAst, T as CodecRef$1, Tt as RawSqlLiteral, _t as ParamRef, s as AnyExpression } from "./types-DhYcyD0K-Brj7SwFA.mjs";
6
6
  import { l as SqlStatementStats } from "./driver-types-BQtRkOJ0-Bv2RPSfr.mjs";
7
- import { t as SqlQueryPlan } from "./plan-CDxduYaN-B2kMLIQQ.mjs";
7
+ import { n as SqlQueryPlan } from "./plan-oIjoMLQN-Cgljp0gc.mjs";
8
8
  import { Contract } from "@prisma/orm-framework/contract/types";
9
9
  import { ParamSpec } from "@prisma/orm-framework/operations";
10
10
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts
@@ -92,7 +92,7 @@ type TraitExpression<Traits extends readonly string[], Nullable extends boolean,
92
92
  /**
93
93
  * Resolve a raw value or an Expression into an AST expression node.
94
94
  *
95
- * When `value` is an Expression (duck-typed by its `buildAst` method), 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.
95
+ * 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.
96
96
  *
97
97
  * 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)`).
98
98
  */
@@ -107,13 +107,13 @@ declare function param<T>(value: T, opts: {
107
107
  * Derive the {@link CodecRef} carried by an expression-like value.
108
108
  *
109
109
  * Resolution order:
110
- * 1. `wrapper.codec` — explicit column-bound {@link CodecRef} stamped at field-proxy time.
111
- * 2. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.
112
- * 3. `{ 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).
110
+ * 1. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.
111
+ * 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).
113
112
  *
114
113
  * Returns `undefined` for raw scalar values (non-expression-like).
115
114
  */
116
115
  declare function codecOf(value: unknown): CodecRef$1 | undefined;
116
+ declare function isExpression(value: unknown): value is Expression<ScopeField>;
117
117
  interface BuildOperationSpec<R extends ScopeField> {
118
118
  readonly method: string;
119
119
  /**
@@ -262,5 +262,5 @@ type RawSqlInterpolation = RawExprInterpolation | RawRowQuery;
262
262
  declare function createRawSql(adapter: RawCodecInferer, planContext: RawPlanContext): RawSqlStatementTag;
263
263
  declare function createRawSql(adapter: RawCodecInferer): RawSqlTag;
264
264
  //#endregion
265
- export { buildOperation as C, toExpr as D, param as E, TraitExpression as S, createRawSql as T, RawSqlStatementBuilder as _, CodecValue as a, ScalarListExpression as b, RawAffectedCountQuery as c, RawRow as d, RawRowQuery as f, RawSqlInterpolation as g, RawSqlBuilder as h, CodecTypesBase as i, RawCodecInferer as l, RawRowSpecEntry as m, BuildOperationSpec as n, Expression as o, RawRowSpec as p, CodecExpression as r, NoReservedRowColumn as s, AffectedCount as t, RawPlanContext as u, RawSqlStatementTag as v, codecOf as w, ScopeField as x, RawSqlTag as y };
266
- //# sourceMappingURL=expression-mku9I7Ue.d.mts.map
265
+ export { buildOperation as C, param as D, isExpression as E, toExpr as O, TraitExpression as S, createRawSql as T, RawSqlStatementBuilder as _, CodecValue as a, ScalarListExpression as b, RawAffectedCountQuery as c, RawRow as d, RawRowQuery as f, RawSqlInterpolation as g, RawSqlBuilder as h, CodecTypesBase as i, RawCodecInferer as l, RawRowSpecEntry as m, BuildOperationSpec as n, Expression as o, RawRowSpec as p, CodecExpression as r, NoReservedRowColumn as s, AffectedCount as t, RawPlanContext as u, RawSqlStatementTag as v, codecOf as w, ScopeField as x, RawSqlTag as y };
266
+ //# sourceMappingURL=expression-BtebKpK2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression-BtebKpK2.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts"],"mappings":";;;;;;;;;;;KAQK;EACH;EACA;;;;;;;;EAQA;;;;EAIA,QAAQ;;KAEL,iBAAiB;WACX;WACA;;;;;KAKN,WAAW,UAAU,cAAc;WAC7B,YAAY;EACrB,YAAY;;KAET,kBAAkB,WAAW;WACvB;IACP,+CAA+C,WAAW,cAAc,GAAG;WACpE,cAAc;KACpB,iCAAiC,KAAK,2BAA2B;KACjE,WAAW,KAAK;;;;;KAKhB,WAAW,wBAAwB,0BAA0B,WAAW;WAClE;OACJ,sBAAsB,KAAK,GAAG,6BAA6B,WAAW;;;;;;;;;;;;;;;KAexE,gBAAgB,wBAAwB,0BAA0B,WAAW;WACvE;MACL;EACJ,SAAS;EACT,UAAU;EACV;KACG,WAAW,SAAS,UAAU;;;;;;;KAO9B,qBAAqB,wBAAwB,4BAA4B;EAC5E,SAAS;EACT,UAAU;EACV;;;;;;;KAOG,gBAAgB,kCAAkC,0BAA0B,WAAW;WACjF;MACL,gBAAgB,kBAAkB,IAAI,SAAS,UAAU;;;;;;;;iBAQ9C,OAAO,gBAAgB,QAAQ,aAAW;;;;iBAI1C,MAAM,GAAG,OAAO,GAAG;EAClC;IACE;;;;;;;;;;iBAUa,QAAQ,iBAAiB;iBACzB,aAAa,iBAAiB,SAAS,WAAW;UACzD,mBAAmB,UAAU;WAC5B;;;;WAIA,gBAAgB,kBAAkB;WAClC,SAAS,IAAI;WACb,UAAU;;;;;iBAKJ,eAAe,UAAU,YAAY,MAAM,mBAAmB,KAAK,WAAW;;;;;;;;;;;;;UAarF;EACR,WAAW,OAAO;;;UAGV;EACR,QAAQ,kBAAkB,MAAM,IAAI;IAClC,SAAS;IACT;;EAEF,QAAQ,kBAAkB,2BAA2B;aAC1C,SAAS;aACT,WAAW;MAClB;IACF,SAAS;IACT,UAAU;;;;;;;;;KAST;WACM;WACA;;;;;;;;;KASN;WACM;;;KAGN,aAAa,SAAS,eAAe,oBAAoB;;;;;;KAMzD,OAAO,aAAa,0BAA0B,WAAW;;;;;UAKpD;WACC,UAAU,SAAS;WACnB;;;;;;;;;;UAUD,YAAY,eAAe,aAAa,SAAS,eAAe,mBAAmB,SAAS,eAAe;;;;;;;;;WAS1G,SAAS;EAClB,YAAY;EACZ,SAAS,aAAa;;cAEV;;;;;;;;;;UAUJ,sBAAsB;YACpB;;;;;;;;UAQF;EACR,SAAS,aAAa;;;;;;;UAOd,+BAA+B;EACvC,WAAW,aAAa,YAAY,MAAM,OAAO,YAAY,OAAO;EACpE,iBAAiB;;;KAGd,aAAa,SAAS,yBAAyB,QAAQ,0BAA0B;;KAEjF,sBAAsB,SAAS,yBAAyB,QAAQ,0BAA0B;;KAE1F,uBAAuB,WAAW,cAAc,WAAW;;KAE3D,sBAAsB,uBAAuB;;;;;;;;iBAQjC,aAAa,SAAS,iBAAiB,aAAa,iBAAiB;iBACrE,aAAa,SAAS,kBAAkB"}
@@ -1,4 +1,4 @@
1
- import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from "./types-Dt4e_jC--COeP8xzN.mjs";
1
+ import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from "./types-CWwta5EN-BS4OsQAL.mjs";
2
2
  import { t as planFromAst } from "./plan-Dh0LbYIv-Crx5-ThG.mjs";
3
3
  import { runtimeError } from "@prisma/orm-framework/components/runtime";
4
4
  import { invariant } from "@prisma/orm-framework/utils/assertions";
@@ -6,12 +6,12 @@ import { invariant } from "@prisma/orm-framework/utils/assertions";
6
6
  /**
7
7
  * Resolve a raw value or an Expression into an AST expression node.
8
8
  *
9
- * When `value` is an Expression (duck-typed by its `buildAst` method), 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.
9
+ * 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.
10
10
  *
11
11
  * 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)`).
12
12
  */
13
13
  function toExpr(value, codec) {
14
- if (isExpressionLike(value)) return value.buildAst();
14
+ if (isExpression(value)) return value.buildAst();
15
15
  if (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.`);
16
16
  return ParamRef.of(value, { codec });
17
17
  }
@@ -25,20 +25,16 @@ function param(value, opts) {
25
25
  * Derive the {@link CodecRef} carried by an expression-like value.
26
26
  *
27
27
  * Resolution order:
28
- * 1. `wrapper.codec` — explicit column-bound {@link CodecRef} stamped at field-proxy time.
29
- * 2. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.
30
- * 3. `{ 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).
28
+ * 1. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.
29
+ * 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).
31
30
  *
32
31
  * Returns `undefined` for raw scalar values (non-expression-like).
33
32
  */
34
33
  function codecOf(value) {
35
- if (!isExpressionLike(value)) return void 0;
36
- const wrapper = value;
37
- if (wrapper.codec) return wrapper.codec;
38
- if (wrapper.returnType?.codec) return wrapper.returnType.codec;
39
- if (wrapper.returnType?.codecId) return { codecId: wrapper.returnType.codecId };
34
+ if (!isExpression(value)) return void 0;
35
+ return value.returnType?.codec ?? (value.returnType?.codecId ? { codecId: value.returnType.codecId } : void 0);
40
36
  }
41
- function isExpressionLike(value) {
37
+ function isExpression(value) {
42
38
  return typeof value === "object" && value !== null && "buildAst" in value && typeof value.buildAst === "function";
43
39
  }
44
40
  /**
@@ -59,7 +55,7 @@ function buildOperation(spec) {
59
55
  };
60
56
  }
61
57
  function resolveInterpolation(adapter, value) {
62
- if (isExpressionLike(value)) return value.buildAst();
58
+ if (isExpression(value)) return value.buildAst();
63
59
  if (value instanceof ParamRef) return value;
64
60
  if (typeof value === "number" || typeof value === "bigint" || typeof value === "string" || typeof value === "boolean" || value instanceof Uint8Array) return ParamRef.of(value, { codec: { codecId: adapter.inferCodec(value) } });
65
61
  throw runtimeError("RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION", "unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec");
@@ -147,6 +143,6 @@ var RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {
147
143
  }
148
144
  };
149
145
  //#endregion
150
- export { toExpr as a, param as i, codecOf as n, createRawSql as r, buildOperation as t };
146
+ export { param as a, isExpression as i, codecOf as n, toExpr as o, createRawSql as r, buildOperation as t };
151
147
 
152
- //# sourceMappingURL=expression-B2Ox7zKM.mjs.map
148
+ //# sourceMappingURL=expression-CiiHMYqY.mjs.map
@@ -0,0 +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 { 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;AAC/D;;;;;;;;;;AAUA,SAAS,QAAQ,OAAO;CACvB,IAAI,CAAC,aAAa,KAAK,GAAG,OAAO,KAAK;CACtC,OAAO,MAAM,YAAY,UAAU,MAAM,YAAY,UAAU,EAAE,SAAS,MAAM,WAAW,QAAQ,IAAI,KAAK;AAC7G;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,cAAc,SAAS,OAAO,MAAM,aAAa;AACxG;;;;AAIA,SAAS,eAAe,MAAM;CAC7B,MAAM,CAAC,MAAM,GAAG,QAAQ,KAAK;CAC7B,MAAM,KAAK,IAAI,cAAc;EAC5B,QAAQ,KAAK;EACb;EACA,MAAM,KAAK,SAAS,IAAI,OAAO,KAAK;EACpC,SAAS,KAAK;EACd,UAAU,KAAK;CAChB,CAAC;CACD,OAAO;EACN,YAAY,KAAK;EACjB,gBAAgB;CACjB;AACD;AACA,SAAS,qBAAqB,SAAS,OAAO;CAC7C,IAAI,aAAa,KAAK,GAAG,OAAO,MAAM,SAAS;CAC/C,IAAI,iBAAiB,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YAAY,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,iBAAiB,YAAY,OAAO,SAAS,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,QAAQ,WAAW,KAAK,EAAE,EAAE,CAAC;CACjO,MAAM,aAAa,6CAA6C,6GAA6G;AAC9K;AACA,SAAS,cAAc,OAAO;CAC7B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,cAAc,SAAS,OAAO,MAAM,aAAa,cAAc,WAAW,SAAS,OAAO,MAAM,UAAU;AACjK;AACA,SAAS,cAAc,SAAS,SAAS,QAAQ;CAChD,MAAM,QAAQ,CAAC,QAAQ,MAAM,EAAE;CAC/B,OAAO,SAAS,OAAO,MAAM;EAC5B,IAAI,cAAc,KAAK,GAAG,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,CAAC,KAAK;OACzD,MAAM,KAAK,qBAAqB,SAAS,KAAK,CAAC;EACpD,MAAM,KAAK,QAAQ,IAAI,MAAM,EAAE;CAChC,CAAC;CACD,OAAO;AACR;;;;;;;;AAQA,SAAS,eAAe,MAAM;CAC7B,OAAO,OAAO,YAAY,OAAO,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,OAAO,UAAU,WAAW;EACxG,SAAS;EACT,UAAU;CACX,IAAI;EACH,SAAS,MAAM;EACf,UAAU,MAAM,YAAY;CAC7B,CAAC,CAAC,CAAC;AACJ;AACA,SAAS,aAAa,SAAS,aAAa;CAC3C,IAAI,gBAAgB,KAAK,GAAG,QAAQ,SAAS,GAAG,WAAW,IAAI,kBAAkB,cAAc,SAAS,SAAS,MAAM,CAAC;CACxH,MAAM,UAAU;CAChB,QAAQ,SAAS,GAAG,WAAW,IAAI,2BAA2B,cAAc,SAAS,SAAS,MAAM,GAAG,OAAO;AAC/G;AACA,IAAI,oBAAoB,MAAM;CAC7B;CACA,YAAY,OAAO;EAClB,KAAK,QAAQ;CACd;CACA,QAAQ,MAAM;EACb,MAAM,UAAU,OAAO,SAAS,WAAW,OAAO,KAAK;EACvD,MAAM,WAAW,OAAO,SAAS,WAAW,QAAQ,KAAK,YAAY;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"}
package/dist/family.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
- import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-GODO43Ai.mjs";
3
- 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-IqZMLrFC-BIRftuU7.mjs";
2
+ import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-CUDc48SO.mjs";
3
+ 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-IqZMLrFC-BQmtKloA.mjs";
4
4
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-BICVtTHY.mjs";
5
- import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-b-6t8eI_.mjs";
6
- import "./control-adapter-DzTFiMaG.mjs";
7
- 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-CN1ou7vM.mjs";
5
+ import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-CYQ2U777.mjs";
6
+ import "./control-adapter-BPttH3He.mjs";
7
+ 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-CFhK3Q3k.mjs";
8
8
  import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-R9GE8gsm.mjs";
9
- import { t as SqlMigration } from "./migration-Bhce5i_m.mjs";
9
+ import { t as SqlMigration } from "./migration-CkjRhB8h.mjs";
10
10
  import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, 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 toEnumName, y as toFieldName } from "./psl-infer-CCAD6FWA.mjs";
11
- import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CzCx0TKe.mjs";
11
+ import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BhA8jUsk.mjs";
12
12
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
13
13
  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, 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, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, parseRawDefault, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, 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-GODO43Ai.mjs";
2
- import "./control-adapter-DzTFiMaG.mjs";
1
+ import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-CUDc48SO.mjs";
2
+ import "./control-adapter-BPttH3He.mjs";
3
3
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,4 +1,4 @@
1
- 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-IqZMLrFC-BIRftuU7.mjs";
1
+ 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-IqZMLrFC-BQmtKloA.mjs";
2
2
  import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-BICVtTHY.mjs";
3
- import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-b-6t8eI_.mjs";
3
+ import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-CYQ2U777.mjs";
4
4
  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, 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, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor };
@@ -1,3 +1,3 @@
1
- import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-GODO43Ai.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-CN1ou7vM.mjs";
1
+ import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-CUDc48SO.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-CFhK3Q3k.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-Bhce5i_m.mjs";
1
+ import { t as SqlMigration } from "./migration-CkjRhB8h.mjs";
2
2
  export { SqlMigration as Migration };
@@ -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-CzCx0TKe.mjs";
2
+ import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BhA8jUsk.mjs";
3
3
  export { type ResolvedDomainModel, type ResolvedStorageTable, UNBOUND_DOMAIN_NAMESPACE_ID, sqlRuntimeFamilyDescriptor as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };
@@ -1,13 +1,13 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import "./types-C36_3E6_.mjs";
3
- import { O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-v3qxLLxo-Clw_yBAh.mjs";
4
- import { t as Adapter } from "./ast-DuLukI6f.mjs";
5
- import { t as SqlQueryPlan } from "./plan-CDxduYaN-B2kMLIQQ.mjs";
6
- import { t as SqlExecutionPlan } from "./sql-execution-plan--jKyLpe5-Bcz9QM2s.mjs";
7
- import "./plan-C7VP7jOh.mjs";
8
- import { n as CodecDescriptorRegistry } from "./query-lane-context-Qa-eddrE-BQV6J9nV.mjs";
9
- import "./query-lane-context-CGdMIEuv.mjs";
10
- import { k as SqlMiddleware } from "./prepared-statement-9QpkE6JG-B9xqBu5T.mjs";
3
+ import { O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-DhYcyD0K-Brj7SwFA.mjs";
4
+ import { t as Adapter } from "./ast-BAsreJBG.mjs";
5
+ import { n as SqlQueryPlan } from "./plan-oIjoMLQN-Cgljp0gc.mjs";
6
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-2C68q5Jo-5sJRnbj0.mjs";
7
+ import "./plan-DT6ur9_C.mjs";
8
+ import { n as CodecDescriptorRegistry } from "./query-lane-context-cqWxvUWZ-DU48PEoC.mjs";
9
+ import "./query-lane-context-Dra2wgIo.mjs";
10
+ import { k as SqlMiddleware } from "./prepared-statement-9QpkE6JG-3LY-d6pU.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-DzBzeTAy.d.mts.map
84
+ //# sourceMappingURL=index-Bkg5fqsf.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DzBzeTAy.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-Bkg5fqsf.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,6 +1,6 @@
1
- import { t as SqlExecutionPlan } from "./sql-execution-plan--jKyLpe5-Bcz9QM2s.mjs";
1
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-2C68q5Jo-5sJRnbj0.mjs";
2
2
  import { ParamRefMutator } from "@prisma/orm-framework/components/runtime";
3
- //#region ../../../2-sql/4-lanes/relational-core/dist/middleware-AhTz1BOW.d.mts
3
+ //#region ../../../2-sql/4-lanes/relational-core/dist/middleware-CAQqWuBd.d.mts
4
4
  //#region src/middleware/param-ref-mutator.d.ts
5
5
  /**
6
6
  * Brand applied to {@link ParamRefHandle} so user-constructed handles
@@ -116,4 +116,4 @@ interface SqlParamRefMutatorInternal<TCodecMap extends Record<string, unknown> =
116
116
  declare function createSqlParamRefMutator<TCodecMap extends Record<string, unknown> = Record<string, unknown>>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap>;
117
117
  //#endregion
118
118
  export { SqlParamRefMutatorInternal as a, SqlParamRefMutator as i, ParamRefEntryUnion as n, createSqlParamRefMutator as o, ParamRefHandle as r, ParamRefEntry as t };
119
- //# sourceMappingURL=middleware-AhTz1BOW-CtQWS4mb.d.mts.map
119
+ //# sourceMappingURL=middleware-CAQqWuBd-pOZt5VBK.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"middleware-AhTz1BOW-CtQWS4mb.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/middleware-AhTz1BOW.d.mts"],"mappings":";;;;;;;;;;;;;;cAac;;;;;;;;;;UAUJ,eAAe;YACb,sBAAsB;;;;;;;UAOxB,cAAc;WACb,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAUf,mBAAmB,kBAAkB,8BAA8B,WAAW,qBAAqB,cAAc,YAAY,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UAyB9I,mBAAmB,kBAAkB,0BAA0B,iCAAiC;;EAExG,WAAW,iBAAiB,mBAAmB;;;;;;;EAO/C,aAAa,uBAAuB,oBAAoB,KAAK,eAAe,WAAW,UAAU,UAAU;EAC3G,aAAa,KAAK,2BAA2B;;EAE7C,cAAc,SAAS;aACZ,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAaH,2BAA2B,kBAAkB,0BAA0B,iCAAiC,mBAAmB;EACnI;;;;;;;;;;;;;;;;;iBAiBe,yBAAyB,kBAAkB,0BAA0B,yBAAyB,MAAM,mBAAmB,2BAA2B"}
1
+ {"version":3,"file":"middleware-CAQqWuBd-pOZt5VBK.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/middleware-CAQqWuBd.d.mts"],"mappings":";;;;;;;;;;;;;;cAac;;;;;;;;;;UAUJ,eAAe;YACb,sBAAsB;;;;;;;UAOxB,cAAc;WACb,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAUf,mBAAmB,kBAAkB,8BAA8B,WAAW,qBAAqB,cAAc,YAAY,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UAyB9I,mBAAmB,kBAAkB,0BAA0B,iCAAiC;;EAExG,WAAW,iBAAiB,mBAAmB;;;;;;;EAO/C,aAAa,uBAAuB,oBAAoB,KAAK,eAAe,WAAW,UAAU,UAAU;EAC3G,aAAa,KAAK,2BAA2B;;EAE7C,cAAc,SAAS;aACZ,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAaH,2BAA2B,kBAAkB,0BAA0B,iCAAiC,mBAAmB;EACnI;;;;;;;;;;;;;;;;;iBAiBe,yBAAyB,kBAAkB,0BAA0B,yBAAyB,MAAM,mBAAmB,2BAA2B"}
@@ -0,0 +1 @@
1
+ import "./middleware-CAQqWuBd-pOZt5VBK.mjs";
@@ -1,6 +1,6 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import "./types-C36_3E6_.mjs";
3
- import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-BIRftuU7.mjs";
3
+ import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-BQmtKloA.mjs";
4
4
  import { Contract } from "@prisma/orm-framework/contract/types";
5
5
  import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  //#region ../../../2-sql/9-family/dist/migration.d.mts
@@ -41,4 +41,4 @@ declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTarg
41
41
  }
42
42
  //#endregion
43
43
  export { SqlMigration as t };
44
- //# sourceMappingURL=migration-Bhce5i_m.d.mts.map
44
+ //# sourceMappingURL=migration-CkjRhB8h.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-Bhce5i_m.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
1
+ {"version":3,"file":"migration-CkjRhB8h.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
@@ -2,15 +2,19 @@ import { t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
2
2
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
3
3
  import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-BDUG29Df-LE85dIXP.mjs";
4
4
  import "./types-C36_3E6_.mjs";
5
- import { It as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, pt as NullCheckExpr, r as AggregateFn, s as AnyExpression } from "./types-v3qxLLxo-Clw_yBAh.mjs";
6
- import "./ast-DuLukI6f.mjs";
7
- import { o as Expression } from "./expression-mku9I7Ue.mjs";
8
- import { r as ExecutionContext } from "./query-lane-context-Qa-eddrE-BQV6J9nV.mjs";
9
- import "./query-lane-context-CGdMIEuv.mjs";
10
- import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-CyxGtOOh-BJnoWm0f.mjs";
11
- import "./types-DvsoMNLs.mjs";
5
+ import { It as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, ot as LimitOffsetValue, pt as NullCheckExpr, r as AggregateFn, s as AnyExpression } from "./types-DhYcyD0K-Brj7SwFA.mjs";
6
+ import "./ast-BAsreJBG.mjs";
7
+ import { n as SqlQueryPlan, t as Preparable } from "./plan-oIjoMLQN-Cgljp0gc.mjs";
8
+ import { S as TraitExpression, i as CodecTypesBase, o as Expression } from "./expression-BtebKpK2.mjs";
9
+ import "./plan-DT6ur9_C.mjs";
10
+ import { r as ExecutionContext } from "./query-lane-context-cqWxvUWZ-DU48PEoC.mjs";
11
+ import "./query-lane-context-Dra2wgIo.mjs";
12
+ import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-thCvr3t--BKg5flQM.mjs";
13
+ import "./types-DL0mGtxm.mjs";
14
+ import { l as ParamsFromDeclaration, m as PreparedStatement, p as PreparedFor, r as Declaration, t as BindSiteParams, w as RuntimeQueryable$1, y as Runtime } from "./prepared-statement-9QpkE6JG-3LY-d6pU.mjs";
15
+ import "./index-Bkg5fqsf.mjs";
12
16
  import { Contract } from "@prisma/orm-framework/contract/types";
13
- import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind } from "@prisma/orm-framework/components/runtime";
17
+ import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind, ResultType, RuntimeExecuteOptions } from "@prisma/orm-framework/components/runtime";
14
18
  import { SimplifyDeep } from "@prisma/orm-framework/utils/simplify-deep";
15
19
  //#region ../../../3-extensions/sql-orm-client/dist/index.d.mts
16
20
  //#region src/types.d.ts
@@ -69,8 +73,8 @@ interface CollectionState {
69
73
  readonly distinct: readonly string[] | undefined;
70
74
  readonly distinctOn: readonly string[] | undefined;
71
75
  readonly selectedFields: readonly string[] | undefined;
72
- readonly limit: number | undefined;
73
- readonly offset: number | undefined;
76
+ readonly limit: LimitOffsetValue | undefined;
77
+ readonly offset: LimitOffsetValue | undefined;
74
78
  readonly variantName: string | undefined;
75
79
  /**
76
80
  * Annotations attached to this query at terminal-call time.
@@ -137,14 +141,27 @@ interface CollectionContext<TContract extends Contract<SqlStorage>> {
137
141
  readonly runtime: RuntimeQueryable;
138
142
  readonly context: ExecutionContext<TContract>;
139
143
  }
140
- type ComparisonMethodFns<T> = {
141
- eq(value: T): AnyExpression;
142
- neq(value: T): AnyExpression;
144
+ type PredicateOperand<T, CodecId extends string> = T | Expression<{
145
+ codecId: CodecId;
146
+ nullable: false;
147
+ many?: never;
148
+ }>;
149
+ type ComparisonMethodFns<T, CodecId extends string = never> = {
150
+ eq(value: T | Expression<{
151
+ codecId: CodecId;
152
+ nullable: boolean;
153
+ many?: never;
154
+ }>): AnyExpression;
155
+ neq(value: T | Expression<{
156
+ codecId: CodecId;
157
+ nullable: boolean;
158
+ many?: never;
159
+ }>): AnyExpression;
143
160
  gt(value: T): AnyExpression;
144
161
  lt(value: T): AnyExpression;
145
162
  gte(value: T): AnyExpression;
146
163
  lte(value: T): AnyExpression;
147
- like(pattern: string): AnyExpression;
164
+ like(pattern: PredicateOperand<string, CodecId>): AnyExpression;
148
165
  in(values: readonly T[]): AnyExpression;
149
166
  notIn(values: readonly T[]): AnyExpression;
150
167
  isNull(): AnyExpression;
@@ -157,7 +174,7 @@ type ComparisonMethodFns<T> = {
157
174
  *
158
175
  * - `traits: []` → always available (isNull, isNotNull)
159
176
  */
160
- type ComparisonMethods<T, Traits> = { [K in keyof ComparisonMethodsMeta as [ComparisonMethodsMeta[K]['traits'][number]] extends [Traits] ? K : never]: ComparisonMethodFns<T>[K]; };
177
+ type ComparisonMethods<T, Traits, CodecId extends string = never> = { [K in keyof ComparisonMethodsMeta as [ComparisonMethodsMeta[K]['traits'][number]] extends [Traits] ? K : never]: ComparisonMethodFns<PredicateOperand<T, CodecId>, CodecId>[K]; };
161
178
  type QueryOperationReturnTraits<Returns, TCodecTypes extends Record<string, unknown>> = Returns extends {
162
179
  readonly codecId: infer Id extends string;
163
180
  } ? Id extends keyof TCodecTypes ? TCodecTypes[Id] extends {
@@ -273,7 +290,7 @@ type RelationFilterAccessor<TContract extends Contract<SqlStorage>, RelatedNsId
273
290
  type ScalarModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in keyof FieldsOf<TContract, ModelName, NsId> & string]: Expression<{
274
291
  codecId: FieldCodecId<TContract, ModelName, K, NsId>;
275
292
  nullable: FieldNullable<TContract, ModelName, K, NsId>;
276
- }> & ComparisonMethods<FieldJsType<TContract, ModelName, K, NsId>, FieldTraits<TContract, ModelName, K, NsId>> & FieldOperations<TContract, NsId, ModelName, K>; };
293
+ }> & ComparisonMethods<FieldJsType<TContract, ModelName, K, NsId>, FieldTraits<TContract, ModelName, K, NsId>, FieldCodecId<TContract, ModelName, K, NsId>> & FieldOperations<TContract, NsId, ModelName, K>; };
277
294
  type RelationModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in RelationNames<TContract, ModelName, NsId>]: RelationFilterAccessor<TContract, RelationTargetNamespace<TContract, ModelName, K, NsId>, RelatedModelName<TContract, ModelName, K, NsId> & string>; };
278
295
  type ModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ScalarModelAccessor<TContract, ModelName, NsId> & RelationModelAccessor<TContract, ModelName, NsId>;
279
296
  /**
@@ -472,7 +489,11 @@ type HavingMethod<TContract extends Contract<SqlStorage>, ModelName extends stri
472
489
  * methods.
473
490
  */
474
491
  type HavingBuilder<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = string extends AggregateOperationNames<TContract> ? AggregateOperationsUnavailable : { readonly [Op in AggregateOperationNames<TContract> & AggregateFn]: HavingMethod<TContract, ModelName, Op, NsId>; };
475
- type ShorthandWhereFilter<TContract extends Contract<SqlStorage>, NsId extends DomainNamespaceId<TContract>, ModelName extends string> = Partial<{ [K in keyof DefaultModelRow<TContract, ModelName, NsId> & string]: DefaultModelRow<TContract, ModelName, NsId>[K] | null | undefined; }>;
492
+ type ShorthandWhereFilter<TContract extends Contract<SqlStorage>, NsId extends DomainNamespaceId<TContract>, ModelName extends string> = Partial<{ [K in keyof DefaultModelRow<TContract, ModelName, NsId> & string]: DefaultModelRow<TContract, ModelName, NsId>[K] | ('equality' extends FieldTraits<TContract, ModelName, K, NsId> ? Expression<{
493
+ codecId: FieldCodecId<TContract, ModelName, K, NsId>;
494
+ nullable: boolean;
495
+ many?: never;
496
+ }> : never) | null | undefined; }>;
476
497
  type NamespaceModelsOf<TContract extends Contract<SqlStorage>, NsId extends string> = NsId extends keyof TContract['domain']['namespaces'] ? TContract['domain']['namespaces'][NsId]['models'] extends (infer M extends Record<string, unknown>) ? M : Record<string, never> : Record<string, never>;
477
498
  type ScannedModelDef<TContract extends Contract<SqlStorage>, ModelName extends string> = { [Ns in keyof TContract['domain']['namespaces']]: ModelName extends keyof TContract['domain']['namespaces'][Ns]['models'] ? TContract['domain']['namespaces'][Ns]['models'][ModelName] : never; }[keyof TContract['domain']['namespaces']];
478
499
  type ModelDef<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = [NsId] extends [never] ? ScannedModelDef<TContract, ModelName> : ModelName extends keyof NamespaceModelsOf<TContract, NsId> ? NamespaceModelsOf<TContract, NsId>[ModelName] : never;
@@ -756,7 +777,8 @@ type IncludeRefinementValue<TContract extends Contract<SqlStorage>, ParentModelN
756
777
  * A refined to-one include is nullable whatever the relation's `nullable` flag
757
778
  * says: the refinement's filter can exclude the related row.
758
779
  */
759
- type RefinedIncludeRelationValue<TContract extends Contract<SqlStorage>, ParentModelName extends string, RelName extends string, IncludedRow, NsId extends string = never> = IsToManyRelation<TContract, ParentModelName, RelName, NsId> extends true ? IncludedRow[] : IncludedRow | null;
780
+ type RefinedIncludeRelationValue<TContract extends Contract<SqlStorage>, ParentModelName extends string, RelName extends string, IncludedRow, NsId extends string = never> = RelationCardinality<TContract, ParentModelName, RelName, NsId> extends '1:1' | 'N:1' ? IncludedRow | null : IncludedRow[];
781
+ type WhereInput<TContract extends Contract<SqlStorage>, NsId extends string, ModelName extends string, VariantName extends string | undefined = undefined> = ((model: VariantAwareModelAccessor<TContract, ModelName, VariantName, NsId>) => WhereArg) | ShorthandWhereFilter<TContract, NsId, ModelName>;
760
782
  //#endregion
761
783
  //#region src/grouped-collection.d.ts
762
784
  interface GroupedCollectionInit {
@@ -813,6 +835,14 @@ declare class GroupedCollection<TContract extends Contract<SqlStorage>, ModelNam
813
835
  aggregate<Spec extends AggregateSpec>(fn: (aggregate: AggregateBuilder<TContract, ModelName, NsId>) => Spec, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Array<GroupedAggregateRow<TContract, ModelName, GroupFields, NsId, Spec>>>;
814
836
  }
815
837
  //#endregion
838
+ //#region src/prepared-collection.d.ts
839
+ interface PreparedCollection<TContract extends Contract<SqlStorage>, ModelName extends string, Row, State extends CollectionTypeState> {
840
+ all(configure?: (meta: MetaBuilder<'read'>) => void): Preparable<Record<string, unknown>, AsyncIterableResult<Row>>;
841
+ first(): Preparable<Record<string, unknown>, Promise<Row | null>>;
842
+ first(filter: undefined, configure: (meta: MetaBuilder<'read'>) => void): Preparable<Record<string, unknown>, Promise<Row | null>>;
843
+ first(filter: WhereInput<TContract, State['nsId'], ModelName, State['variantName']>, configure?: (meta: MetaBuilder<'read'>) => void): Preparable<Record<string, unknown>, Promise<Row | null>>;
844
+ }
845
+ //#endregion
816
846
  //#region src/collection.d.ts
817
847
  type WhereDirectInput = WhereArg;
818
848
  declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName extends string, Row = SimplifyDeep<InferRootRow<TContract, ModelName>>, State extends CollectionTypeState = DefaultCollectionTypeState> implements RowSelection<Row> {
@@ -828,7 +858,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
828
858
  /** @internal */
829
859
  readonly tableName: string;
830
860
  /** @internal */
831
- readonly namespaceId: string;
861
+ readonly namespaceId: State['nsId'];
832
862
  /** @internal */
833
863
  readonly state: CollectionState;
834
864
  /** @internal */
@@ -1036,7 +1066,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1036
1066
  * const firstTen = await db.orm.User.orderBy((u) => u.id.asc()).limit(10).all();
1037
1067
  * ```
1038
1068
  */
1039
- limit(n: number): Collection<TContract, ModelName, Row, State>;
1069
+ limit(n: number | TraitExpression<readonly ['numeric'], false, ExtractCodecTypes<TContract>>): Collection<TContract, ModelName, Row, State>;
1040
1070
  /**
1041
1071
  * Apply `OFFSET n`. Replaces any previous offset set on this collection.
1042
1072
  *
@@ -1048,7 +1078,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1048
1078
  * .all();
1049
1079
  * ```
1050
1080
  */
1051
- offset(n: number): Collection<TContract, ModelName, Row, State>;
1081
+ offset(n: number | TraitExpression<readonly ['numeric'], false, ExtractCodecTypes<TContract>>): Collection<TContract, ModelName, Row, State>;
1052
1082
  /**
1053
1083
  * Read terminal: execute the query and stream every matching row.
1054
1084
  *
@@ -1085,6 +1115,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1085
1115
  * ```
1086
1116
  */
1087
1117
  all(configure?: (meta: MetaBuilder<'read'>) => void): AsyncIterableResult<Row>;
1118
+ get prepared(): PreparedCollection<TContract, ModelName, Row, State>;
1088
1119
  /**
1089
1120
  * Read terminal: return the first matching row, or `null` if none
1090
1121
  * match. Optionally accepts a filter (callback or shorthand object)
@@ -1111,8 +1142,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1111
1142
  */
1112
1143
  first(): Promise<Row | null>;
1113
1144
  first(filter: undefined, configure: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1114
- first(filter: (model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => WhereArg, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1115
- first(filter: ShorthandWhereFilter<TContract, State['nsId'], ModelName>, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1145
+ first(filter: WhereInput<TContract, State['nsId'], ModelName, State['variantName']>, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1116
1146
  /**
1117
1147
  * Read terminal: run an aggregate query (count, sum, avg, min, max)
1118
1148
  * built via the `AggregateBuilder` callback. Returns one object
@@ -1446,5 +1476,13 @@ type NamespacedClientMap<TContract extends Contract<SqlStorage>, Collections ext
1446
1476
  type OrmClient<TContract extends Contract<SqlStorage>, Collections extends Partial<Record<string, AnyCollectionClass>>> = NamespacedClientMap<TContract, Collections>;
1447
1477
  declare function orm<TContract extends Contract<SqlStorage>, Collections extends Partial<Record<string, AnyCollectionClass>> = Record<never, never>>(options: OrmOptions<TContract, Collections>): OrmClient<TContract, Collections>;
1448
1478
  //#endregion
1449
- export { type AggregateBuilder, type AggregateResult, type AggregateSpec, Collection, type CollectionContext, type CollectionModelName, type CollectionState, type CollectionTypeState, type ComparisonMethods, type CreateInput, type DefaultCollectionTypeState, type DefaultModelRow, GroupedCollection, type IncludeExpr, type ModelAccessor, type NumericFieldNames, type OrmOptions, type RelatedModelName, type RelationFilterAccessor, type RelationMutator, type RelationNames, type RelationPredicate, type RelationPredicateInput, type RelationsOf, type RuntimeQueryable, type ShorthandWhereFilter, type UniqueConstraintCriterion, all, and, createModelAccessor, emptyState, not, or, orm };
1479
+ //#region src/prepared-row-query.d.ts
1480
+ interface PreparedRowQuery<Params, Result> {
1481
+ query(target: RuntimeQueryable$1, params: Params, options?: RuntimeExecuteOptions): Result;
1482
+ }
1483
+ type PreparedFrom<Params, Q extends SqlQueryPlan | Preparable<unknown, unknown>> = Q extends Preparable<unknown, infer Result> ? PreparedRowQuery<Params, Result> : PreparedFor<Params, ResultType<Q>>;
1484
+ declare function prepareQuery<D extends Declaration<CT>, Q extends SqlQueryPlan | Preparable<unknown, unknown>, CT extends CodecTypesBase>(runtime: Runtime, declaration: D, callback: (params: BindSiteParams<D>) => Q): Promise<PreparedFrom<ParamsFromDeclaration<D, CT>, Q>>;
1485
+ declare function createPreparedRowQuery<Params, DbRow, Result>(description: Preparable<DbRow, Result>, statement: PreparedStatement<Params, DbRow>): PreparedRowQuery<Params, Result>;
1486
+ //#endregion
1487
+ export { type AggregateBuilder, type AggregateResult, type AggregateSpec, Collection, type CollectionContext, type CollectionModelName, type CollectionState, type CollectionTypeState, type ComparisonMethods, type CreateInput, type DefaultCollectionTypeState, type DefaultModelRow, GroupedCollection, type IncludeExpr, type ModelAccessor, type NumericFieldNames, type OrmOptions, type PreparedCollection, type PreparedFrom, type PreparedRowQuery, type RelatedModelName, type RelationFilterAccessor, type RelationMutator, type RelationNames, type RelationPredicate, type RelationPredicateInput, type RelationsOf, type RuntimeQueryable, type ShorthandWhereFilter, type UniqueConstraintCriterion, all, and, createModelAccessor, createPreparedRowQuery, emptyState, not, or, orm, prepareQuery };
1450
1488
  //# sourceMappingURL=orm-client.d.mts.map