@prisma-next/sql-relational-core 0.13.0-dev.4 → 0.13.0-dev.40

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 (53) hide show
  1. package/dist/{ddl-types-D3vlEjMA.d.mts → ddl-types-BVO002FS.d.mts} +6 -2
  2. package/dist/ddl-types-BVO002FS.d.mts.map +1 -0
  3. package/dist/{ddl-types-X9_XHUl0.mjs → ddl-types-DAox2c8w.mjs} +4 -1
  4. package/dist/ddl-types-DAox2c8w.mjs.map +1 -0
  5. package/dist/{errors-CPLfzKkw.d.mts → errors-BbatEYjA.d.mts} +2 -2
  6. package/dist/{errors-CPLfzKkw.d.mts.map → errors-BbatEYjA.d.mts.map} +1 -1
  7. package/dist/exports/ast.d.mts +11 -3
  8. package/dist/exports/ast.d.mts.map +1 -1
  9. package/dist/exports/ast.mjs +3 -3
  10. package/dist/exports/codec-descriptor-registry.d.mts.map +1 -1
  11. package/dist/exports/codec-descriptor-registry.mjs +2 -13
  12. package/dist/exports/codec-descriptor-registry.mjs.map +1 -1
  13. package/dist/exports/contract-free.d.mts +60 -3
  14. package/dist/exports/contract-free.d.mts.map +1 -1
  15. package/dist/exports/contract-free.mjs +123 -3
  16. package/dist/exports/contract-free.mjs.map +1 -1
  17. package/dist/exports/errors.d.mts +1 -1
  18. package/dist/exports/expression.d.mts +1 -1
  19. package/dist/exports/expression.mjs +1 -1
  20. package/dist/exports/middleware.d.mts +1 -1
  21. package/dist/exports/plan.d.mts +2 -2
  22. package/dist/exports/types.d.mts +3 -3
  23. package/dist/index.d.mts +9 -9
  24. package/dist/index.mjs +3 -3
  25. package/dist/{middleware-BXSFukKU.d.mts → middleware-Dyyo4IP1.d.mts} +2 -2
  26. package/dist/{middleware-BXSFukKU.d.mts.map → middleware-Dyyo4IP1.d.mts.map} +1 -1
  27. package/dist/{plan-DObuWSWi.d.mts → plan-DUjdGLY3.d.mts} +2 -2
  28. package/dist/{plan-DObuWSWi.d.mts.map → plan-DUjdGLY3.d.mts.map} +1 -1
  29. package/dist/{sql-execution-plan-JwVeAzXt.d.mts → sql-execution-plan-DjMEAjKK.d.mts} +2 -2
  30. package/dist/{sql-execution-plan-JwVeAzXt.d.mts.map → sql-execution-plan-DjMEAjKK.d.mts.map} +1 -1
  31. package/dist/types-BQ_zfC-S.d.mts +233 -0
  32. package/dist/types-BQ_zfC-S.d.mts.map +1 -0
  33. package/dist/{types-LGikJRYV.d.mts → types-CUHnDsdV.d.mts} +3 -3
  34. package/dist/{types-LGikJRYV.d.mts.map → types-CUHnDsdV.d.mts.map} +1 -1
  35. package/dist/{types-BbGUx5Bi.d.mts → types-DQrmgP8Y.d.mts} +17 -5
  36. package/dist/{types-BbGUx5Bi.d.mts.map → types-DQrmgP8Y.d.mts.map} +1 -1
  37. package/dist/{types-D72v8s92.mjs → types-lJUc6cY-.mjs} +78 -18
  38. package/dist/types-lJUc6cY-.mjs.map +1 -0
  39. package/package.json +11 -11
  40. package/src/ast/ddl-types.ts +5 -0
  41. package/src/ast/driver-types.ts +8 -0
  42. package/src/ast/types.ts +98 -19
  43. package/src/codec-ref-for-column.ts +2 -35
  44. package/src/contract-free/column.ts +2 -0
  45. package/src/contract-free/dml.ts +5 -0
  46. package/src/contract-free/table.ts +191 -1
  47. package/src/exports/contract-free.ts +5 -0
  48. package/src/types.ts +134 -22
  49. package/dist/ddl-types-D3vlEjMA.d.mts.map +0 -1
  50. package/dist/ddl-types-X9_XHUl0.mjs.map +0 -1
  51. package/dist/types-CQVke4QO.d.mts +0 -181
  52. package/dist/types-CQVke4QO.d.mts.map +0 -1
  53. package/dist/types-D72v8s92.mjs.map +0 -1
@@ -1,4 +1,5 @@
1
- import { d as AnyParamRef } from "./types-BbGUx5Bi.mjs";
1
+ import { o as CodecRef } from "./codec-types-DFLA6Hmj.mjs";
2
+ import { d as AnyParamRef } from "./types-DQrmgP8Y.mjs";
2
3
  import { ColumnDefaultLiteralInputValue } from "@prisma-next/contract/types";
3
4
  import { ReferentialAction } from "@prisma-next/sql-contract/types";
4
5
 
@@ -43,12 +44,15 @@ declare class DdlColumn {
43
44
  readonly notNull?: boolean | undefined;
44
45
  readonly primaryKey?: boolean | undefined;
45
46
  readonly default?: AnyDdlColumnDefault | undefined;
47
+ /** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */
48
+ readonly codecRef?: CodecRef | undefined;
46
49
  constructor(options: {
47
50
  readonly name: string;
48
51
  readonly type: string;
49
52
  readonly notNull?: boolean;
50
53
  readonly primaryKey?: boolean;
51
54
  readonly default?: AnyDdlColumnDefault;
55
+ readonly codecRef?: CodecRef;
52
56
  });
53
57
  }
54
58
  declare abstract class DdlNode {
@@ -123,4 +127,4 @@ declare class UniqueConstraint {
123
127
  type DdlTableConstraint = PrimaryKeyConstraint | ForeignKeyConstraint | UniqueConstraint;
124
128
  //#endregion
125
129
  export { DdlColumnRenderContext as a, ForeignKeyConstraint as c, PrimaryKeyConstraint as d, UniqueConstraint as f, DdlColumnDefaultVisitor as i, FunctionColumnDefault as l, DdlColumn as n, DdlNode as o, isDdlNode as p, DdlColumnDefault as r, DdlTableConstraint as s, AnyDdlColumnDefault as t, LiteralColumnDefault as u };
126
- //# sourceMappingURL=ddl-types-D3vlEjMA.d.mts.map
130
+ //# sourceMappingURL=ddl-types-BVO002FS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddl-types-BVO002FS.d.mts","names":[],"sources":["../src/ast/ddl-types.ts"],"mappings":";;;;;;;;AAeA;;;;AACqB;AAGrB;;UAJiB,sBAAA;EAAA,SACN,UAAU;AAAA;AAAA,UAGJ,uBAAA;EACf,OAAA,CAAQ,IAAA,EAAM,oBAAA,EAAsB,GAAA,EAAK,sBAAA,GAAyB,CAAA;EAClE,QAAA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;cAEG,OAAA;IAAA,SAAoB,OAAA;IAAA,SAAqC,IAAA;EAAA;AAAA;;;AAhGkB;AAKzF;;;;cAyGa,oBAAA;EAAA,SACF,IAAA;EAAA,SACA,OAAA,EAAS,aAAA;EAAA,SACT,QAAA;EAAA,SACA,UAAA,EAAY,aAAA;EAAA,SACZ,QAAA,EAAU,iBAAA;EAAA,SACV,QAAA,EAAU,iBAAA;EAAA,SACV,IAAA;cAEG,OAAA;IAAA,SACD,OAAA;IAAA,SACA,QAAA;IAAA,SACA,UAAA;IAAA,SACA,QAAA,GAAW,iBAAA;IAAA,SACX,QAAA,GAAW,iBAAA;IAAA,SACX,IAAA;EAAA;AAAA;;;;AA9G4E;AAKzF;;;cA4Ha,gBAAA;EAAA,SACF,IAAA;EAAA,SACA,OAAA,EAAS,aAAa;EAAA,SACtB,IAAA;cAEG,OAAA;IAAA,SAAoB,OAAA;IAAA,SAAqC,IAAA;EAAA;AAAA;AAAA,KAO3D,kBAAA,GAAqB,oBAAA,GAAuB,oBAAA,GAAuB,gBAAA"}
@@ -36,12 +36,15 @@ var DdlColumn = class {
36
36
  notNull;
37
37
  primaryKey;
38
38
  default;
39
+ /** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */
40
+ codecRef;
39
41
  constructor(options) {
40
42
  this.name = options.name;
41
43
  this.type = options.type;
42
44
  this.notNull = options.notNull;
43
45
  this.primaryKey = options.primaryKey;
44
46
  this.default = options.default;
47
+ this.codecRef = options.codecRef;
45
48
  Object.freeze(this);
46
49
  }
47
50
  };
@@ -127,4 +130,4 @@ var UniqueConstraint = class {
127
130
  //#endregion
128
131
  export { FunctionColumnDefault as a, UniqueConstraint as c, ForeignKeyConstraint as i, isDdlNode as l, DdlColumnDefault as n, LiteralColumnDefault as o, DdlNode as r, PrimaryKeyConstraint as s, DdlColumn as t };
129
132
 
130
- //# sourceMappingURL=ddl-types-X9_XHUl0.mjs.map
133
+ //# sourceMappingURL=ddl-types-DAox2c8w.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddl-types-DAox2c8w.mjs","names":[],"sources":["../src/ast/ddl-types.ts"],"sourcesContent":["import type { ColumnDefaultLiteralInputValue } from '@prisma-next/contract/types';\nimport { isColumnDefaultLiteralInputValue } from '@prisma-next/contract/types';\nimport type { ReferentialAction } from '@prisma-next/sql-contract/types';\nimport type { CodecRef } from './codec-types';\nimport type { AnyParamRef } from './types';\n\n/**\n * Render-time context the column-default visitor needs to make dialect\n * decisions that depend on the parent column. Today only the parent\n * column's native type (`\"jsonb\"`, `\"text\"`, …) — the Postgres renderer\n * uses it to decide whether to emit a `::jsonb` / `::json` cast on JSON\n * literal defaults so the emitted DDL matches the column type without\n * relying on Postgres's implicit text → jsonb cast at default-evaluation\n * time. Additional fields can join without re-shaping the interface.\n */\nexport interface DdlColumnRenderContext {\n readonly nativeType: string;\n}\n\nexport interface DdlColumnDefaultVisitor<R> {\n literal(node: LiteralColumnDefault, ctx: DdlColumnRenderContext): R;\n function(node: FunctionColumnDefault, ctx: DdlColumnRenderContext): R;\n}\n\nexport abstract class DdlColumnDefault {\n abstract readonly kind: string;\n abstract accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R;\n\n protected freeze(): void {\n Object.freeze(this);\n }\n}\n\nexport class LiteralColumnDefault extends DdlColumnDefault {\n readonly kind = 'literal' as const;\n readonly value: ColumnDefaultLiteralInputValue;\n\n constructor(value: ColumnDefaultLiteralInputValue) {\n super();\n if (!isColumnDefaultLiteralInputValue(value)) {\n throw new Error('Invalid column default literal value');\n }\n this.value = value;\n this.freeze();\n }\n\n override accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R {\n return visitor.literal(this, ctx);\n }\n}\n\nexport class FunctionColumnDefault extends DdlColumnDefault {\n readonly kind = 'function' as const;\n readonly expression: string;\n\n constructor(expression: string) {\n super();\n this.expression = expression;\n this.freeze();\n }\n\n override accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R {\n return visitor.function(this, ctx);\n }\n}\n\nexport type AnyDdlColumnDefault = LiteralColumnDefault | FunctionColumnDefault;\n\nexport class DdlColumn {\n readonly name: string;\n readonly type: string;\n readonly notNull?: boolean | undefined;\n readonly primaryKey?: boolean | undefined;\n readonly default?: AnyDdlColumnDefault | undefined;\n /** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */\n readonly codecRef?: CodecRef | undefined;\n\n constructor(options: {\n readonly name: string;\n readonly type: string;\n readonly notNull?: boolean;\n readonly primaryKey?: boolean;\n readonly default?: AnyDdlColumnDefault;\n readonly codecRef?: CodecRef;\n }) {\n this.name = options.name;\n this.type = options.type;\n this.notNull = options.notNull;\n this.primaryKey = options.primaryKey;\n this.default = options.default;\n this.codecRef = options.codecRef;\n Object.freeze(this);\n }\n}\n\nexport abstract class DdlNode {\n abstract readonly kind: string;\n\n /**\n * Structural brand: every DDL node answers `true`. Lets {@link isDdlNode}\n * recognise any `DdlNode` subclass — including target-contributed kinds —\n * without a central kind registry that subclasses would have to register\n * into.\n */\n isDdlNode(): true {\n return true;\n }\n\n protected freeze(): void {\n Object.freeze(this);\n }\n\n collectParamRefs(): AnyParamRef[] {\n return [];\n }\n}\n\nexport function isDdlNode(value: unknown): value is DdlNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'isDdlNode' in value &&\n typeof value.isDdlNode === 'function'\n );\n}\n\n// ---------------------------------------------------------------------------\n// Table-level constraint nodes\n// ---------------------------------------------------------------------------\n\n/**\n * A composite (or single-column) PRIMARY KEY constraint on a `CreateTable`\n * node. When `name` is set, the adapter renders `CONSTRAINT <name> PRIMARY KEY\n * (…)`; otherwise it renders an anonymous `PRIMARY KEY (…)`.\n *\n * Frozen on construction — immutable after creation.\n */\nexport class PrimaryKeyConstraint {\n readonly kind = 'primary-key' as const;\n readonly columns: ReadonlyArray<string>;\n readonly name: string | undefined;\n\n constructor(options: { readonly columns: readonly string[]; readonly name?: string }) {\n this.columns = Object.freeze([...options.columns]);\n this.name = options.name;\n Object.freeze(this);\n }\n}\n\n/**\n * A FOREIGN KEY constraint on a `CreateTable` node. `onDelete` and `onUpdate`\n * use the same `ReferentialAction` vocabulary already used by the migration\n * planner and the contract IR — no parallel string enum.\n *\n * Frozen on construction — immutable after creation.\n */\nexport class ForeignKeyConstraint {\n readonly kind = 'foreign-key' as const;\n readonly columns: ReadonlyArray<string>;\n readonly refTable: string;\n readonly refColumns: ReadonlyArray<string>;\n readonly onDelete: ReferentialAction | undefined;\n readonly onUpdate: ReferentialAction | undefined;\n readonly name: string | undefined;\n\n constructor(options: {\n readonly columns: readonly string[];\n readonly refTable: string;\n readonly refColumns: readonly string[];\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n readonly name?: string;\n }) {\n this.columns = Object.freeze([...options.columns]);\n this.refTable = options.refTable;\n this.refColumns = Object.freeze([...options.refColumns]);\n this.onDelete = options.onDelete;\n this.onUpdate = options.onUpdate;\n this.name = options.name;\n Object.freeze(this);\n }\n}\n\n/**\n * A table-level UNIQUE constraint on a `CreateTable` node. When `name` is\n * set, the adapter renders `CONSTRAINT <name> UNIQUE (…)`; otherwise it\n * renders an anonymous `UNIQUE (…)`.\n *\n * Frozen on construction — immutable after creation.\n */\nexport class UniqueConstraint {\n readonly kind = 'unique' as const;\n readonly columns: ReadonlyArray<string>;\n readonly name: string | undefined;\n\n constructor(options: { readonly columns: readonly string[]; readonly name?: string }) {\n this.columns = Object.freeze([...options.columns]);\n this.name = options.name;\n Object.freeze(this);\n }\n}\n\nex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OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACpB;AACF;;;;;;;;AASA,IAAa,uBAAb,MAAkC;CAChC,OAAgB;CAChB;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAOT;EACD,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,WAAW,QAAQ;EACxB,KAAK,aAAa,OAAO,OAAO,CAAC,GAAG,QAAQ,UAAU,CAAC;EACvD,KAAK,WAAW,QAAQ;EACxB,KAAK,WAAW,QAAQ;EACxB,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACpB;AACF;;;;;;;;AASA,IAAa,mBAAb,MAA8B;CAC5B,OAAgB;CAChB;CACA;CAEA,YAAY,SAA0E;EACpF,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACpB;AACF"}
@@ -1,8 +1,8 @@
1
- import { v as RuntimeError } from "./types-CQVke4QO.mjs";
1
+ import { y as RuntimeError } from "./types-BQ_zfC-S.mjs";
2
2
 
3
3
  //#region src/errors.d.ts
4
4
  declare function planInvalid(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
5
5
  declare function planUnsupported(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
6
6
  //#endregion
7
7
  export { planUnsupported as n, planInvalid as t };
8
- //# sourceMappingURL=errors-CPLfzKkw.d.mts.map
8
+ //# sourceMappingURL=errors-BbatEYjA.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-CPLfzKkw.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;iBAEgB,WAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAY;AAAA,iBAkBC,eAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAY"}
1
+ {"version":3,"file":"errors-BbatEYjA.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;iBAEgB,WAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAY;AAAA,iBAkBC,eAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAY"}
@@ -1,11 +1,19 @@
1
1
  import { a as CodecMeta, c as ContractCodecRegistry, d as DescriptorCodecTraits, f as ExtractCodecTypes, h as SqlColumnRef, i as CodecDescriptor, l as DescriptorCodecId, m as SqlCodecInstanceContext, n as Codec, o as CodecRef, p as SqlCodecCallContext, r as CodecCallContext, s as CodecTrait, t as AnyCodecDescriptor, u as DescriptorCodecInput } from "../codec-types-DFLA6Hmj.mjs";
2
- import { $ as RawSqlExpr, A as InsertAst, B as LiteralExpr, C as EqColJoinOn, D as ExpressionRewriter, E as ExpressionFolder, F as JsonArrayAggExpr, G as OperationExpr, H as LoweredStatement, I as JsonObjectEntry, J as ParamRef, K as OrExpr, L as JsonObjectExpr, M as InsertValue, N as JoinAst, O as ExpressionSource, P as JoinOnExpr, Q as RawExpr, R as LimitOffsetValue, S as DoUpdateSetConflictAction, T as ExprVisitor, U as NotExpr, V as LoweredParam, W as NullCheckExpr, X as ProjectionExpr, Y as PreparedParamRef, Z as ProjectionItem, _ as DefaultValueExpr, a as AndExpr, at as TableSource, b as Direction, c as AnyInsertOnConflictAction, ct as WhereArg, d as AnyParamRef, dt as isQueryAst, et as RawSqlLiteral, f as AnyQueryAst, ft as isWhereExpr, g as ColumnRef, h as BinaryOp, i as AggregateOpFn, it as TableRef, j as InsertOnConflict, k as IdentifierRef, l as AnyInsertValue, lt as WindowFn, m as BinaryExpr, mt as whereExprKinds, n as AggregateExpr, nt as SelectAstOptions, o as AnyExpression, ot as ToWhereExpr, p as AstRewriter, pt as queryAstKinds, q as OrderByItem, r as AggregateFn, rt as SubqueryExpr, s as AnyFromSource, st as UpdateAst, t as AggregateCountFn, tt as SelectAst, u as AnyOperationArg, ut as WindowFuncExpr, v as DeleteAst, w as ExistsExpr, x as DoNothingConflictAction, y as DerivedTableSource, z as ListExpression } from "../types-BbGUx5Bi.mjs";
3
- import { a as DdlColumnRenderContext, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as DdlColumnDefaultVisitor, l as FunctionColumnDefault, n as DdlColumn, o as DdlNode, p as isDdlNode, r as DdlColumnDefault, s as DdlTableConstraint, t as AnyDdlColumnDefault, u as LiteralColumnDefault } from "../ddl-types-D3vlEjMA.mjs";
2
+ import { $ as RawExpr, A as IdentifierRef, B as ListExpression, C as EqColJoinOn, D as ExpressionRewriter, E as ExpressionFolder, F as JoinOnExpr, G as NullCheckExpr, H as LoweredParam, I as JsonArrayAggExpr, J as OrderByItem, K as OperationExpr, L as JsonObjectEntry, M as InsertOnConflict, N as InsertValue, O as ExpressionSource, P as JoinAst, Q as ProjectionItem, R as JsonObjectExpr, S as DoUpdateSetConflictAction, T as ExprVisitor, U as LoweredStatement, V as LiteralExpr, W as NotExpr, X as PreparedParamRef, Y as ParamRef, Z as ProjectionExpr, _ as DefaultValueExpr, a as AndExpr, at as TableRef, b as Direction, c as AnyInsertOnConflictAction, ct as UpdateAst, d as AnyParamRef, dt as WindowFuncExpr, et as RawSqlExpr, f as AnyQueryAst, ft as isQueryAst, g as ColumnRef, h as BinaryOp, ht as whereExprKinds, i as AggregateOpFn, it as SubqueryExpr, j as InsertAst, k as FunctionSource, l as AnyInsertValue, lt as WhereArg, m as BinaryExpr, mt as queryAstKinds, n as AggregateExpr, nt as SelectAst, o as AnyExpression, ot as TableSource, p as AstRewriter, pt as isWhereExpr, q as OrExpr, r as AggregateFn, rt as SelectAstOptions, s as AnyFromSource, st as ToWhereExpr, t as AggregateCountFn, tt as RawSqlLiteral, u as AnyOperationArg, ut as WindowFn, v as DeleteAst, w as ExistsExpr, x as DoNothingConflictAction, y as DerivedTableSource, z as LimitOffsetValue } from "../types-DQrmgP8Y.mjs";
3
+ import { a as DdlColumnRenderContext, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as DdlColumnDefaultVisitor, l as FunctionColumnDefault, n as DdlColumn, o as DdlNode, p as isDdlNode, r as DdlColumnDefault, s as DdlTableConstraint, t as AnyDdlColumnDefault, u as LiteralColumnDefault } from "../ddl-types-BVO002FS.mjs";
4
4
  import { ContractMarkerRecord, JsonValue } from "@prisma-next/contract/types";
5
5
  import { CodecCallContext as CodecCallContext$1, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma-next/framework-components/codec";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
7
7
 
8
8
  //#region src/ast/driver-types.d.ts
9
+ /**
10
+ * A fully lowered SQL statement ready for a driver to execute: SQL text plus
11
+ * driver-ready (codec-encoded) parameter values. The output of the control
12
+ * adapter's `lowerToExecuteRequest`, handed to a driver via `SqlQueryable.query`
13
+ * or `execute`. Inline-substituted positions (e.g. DDL `DEFAULT`
14
+ * clauses) carry no param; `params` holds the wire values for the `$N`/`?`
15
+ * positions, in order.
16
+ */
9
17
  interface SqlExecuteRequest {
10
18
  readonly sql: string;
11
19
  readonly params?: readonly unknown[];
@@ -262,5 +270,5 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
262
270
  */
263
271
  declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
264
272
  //#endregion
265
- export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyParamRef, AnyQueryAst, AstRewriter, BinaryExpr, BinaryOp, Codec, type CodecCallContext, type CodecDescriptor, CodecMeta, type CodecRef, type CodecTrait, ColumnRef, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ExprVisitor, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionColumnDefault, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, MarkerReadResult, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedExecuteRequest, PreparedParamRef, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawExpr, RawSqlExpr, RawSqlLiteral, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SelectAstOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableRef, TableSource, ToWhereExpr, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, collectOrderedParamRefs, compact, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };
273
+ export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyParamRef, AnyQueryAst, AstRewriter, BinaryExpr, BinaryOp, Codec, type CodecCallContext, type CodecDescriptor, CodecMeta, type CodecRef, type CodecTrait, ColumnRef, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ExprVisitor, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, MarkerReadResult, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedExecuteRequest, PreparedParamRef, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawExpr, RawSqlExpr, RawSqlLiteral, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SelectAstOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableRef, TableSource, ToWhereExpr, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, collectOrderedParamRefs, compact, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };
266
274
  //# sourceMappingURL=ast.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ast.d.mts","names":[],"sources":["../../src/ast/driver-types.ts","../../src/ast/adapter-types.ts","../../src/ast/sql-codec-helpers.ts","../../src/ast/sql-codecs.ts","../../src/ast/util.ts"],"mappings":";;;;;;;;UAAiB,iBAAA;EAAA,SACN,GAAA;EAAA,SACA,MAAM;AAAA;AAAA,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AAAA;AAAA,cAKhE,sBAAA,EAAsB,sBAA+B;AAAA,cAErD,kBAAA,GAAsB,MAAA,GAAQ,eAAA,uDAAoB,UAAA,CAAA,iBAAA,EAAA,eAAA;;;iBClS/C,OAAA,WAAkB,MAAA,mBAAyB,CAAA,EAAG,CAAA,GAAI,CAAA;;;;;;;AJFlE;;;;iBIsBgB,uBAAA,CAAwB,GAAA,EAAK,WAAA,GAAc,aAAA,CAAc,WAAA"}
1
+ {"version":3,"file":"ast.d.mts","names":[],"sources":["../../src/ast/driver-types.ts","../../src/ast/adapter-types.ts","../../src/ast/sql-codec-helpers.ts","../../src/ast/sql-codecs.ts","../../src/ast/util.ts"],"mappings":";;;;;;;;;;;;;;;;UAQiB,iBAAA;EAAA,SACN,GAAA;EAAA,SACA,MAAM;AAAA;AAAA,UAGA,sBAAA;EAAA,SACN,GAAA;EAAA,SACA,MAAA;EAAA,SACA,MAAA;IACP,GAAA;IACA,GAAA,CAAI,KAAA;EAAA;AAAA;AAAA,UAIS,cAAA,OAAqB,MAAA;EAAA,SAC3B,IAAA,EAAM,aAAA,CAAc,GAAA;EAAA,SACpB,QAAA;EAAA,UACC,GAAA;AAAA;AAAA,UAGK,gBAAA,OAAuB,MAAA;EAAA,SAC7B,IAAA,EAAM,aAAA,CAAc,GAAA;AAAA;AAAA,KAGnB,cAAA;AAAA,UAEK,SAAA,0BAAmC,YAAA;EAAA,SACzC,KAAA,GAAQ,cAAA;EACjB,OAAA,CAAQ,OAAA,EAAS,QAAA,GAAW,OAAA;EAC5B,iBAAA,IAAqB,OAAA,CAAQ,aAAA;EAC7B,KAAA,IAAS,OAAA;AAAA;AAAA,UAGM,aAAA,SAAsB,YAAA;EACrC,gBAAA,IAAoB,OAAA,CAAQ,cAAA;EAnBC;;;;AAER;AAGvB;EAqBE,OAAA,IAAW,OAAA;EArBoB;;;;;;;;;;;;AACC;AAGlC;;;;AAA0B;AAE1B;;;;;EAuCE,OAAA,CAAQ,MAAA,aAAmB,OAAA;AAA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A,EAAM,IAAA,EAAM,kBAAA,GAAmB,OAAA,CAAQ,IAAA;EAGrD,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,kBAAA,GAAmB,OAAA,CAAQ,IAAA;EAG1D,UAAA,CAAW,KAAA,EAAO,IAAA,GAAO,SAAA;EAGzB,UAAA,CAAW,IAAA,EAAM,SAAA,GAAY,IAAA;AAAA;AAAA,cAKlB,sBAAA,SAA+B,mBAAA,CAAoB,eAAA;EAAA,SAC5C,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAAc,gBAAA,CAAiB,eAAA;EACxC,gBAAA,CAAiB,MAAA,EAAQ,eAAA;EAGzB,OAAA,CAAQ,OAAA,EAAS,eAAA,IAAmB,GAAA,EAAK,oBAAA,KAAyB,iBAAA;AAAA;AAAA,cAKhE,sBAAA,EAAsB,sBAA+B;AAAA,cAErD,kBAAA,GAAsB,MAAA,GAAQ,eAAA,uDAAoB,UAAA,CAAA,iBAAA,EAAA,eAAA;;;iBClS/C,OAAA,WAAkB,MAAA,mBAAyB,CAAA,EAAG,CAAA,GAAI,CAAA;;;;;;;AJMlE;;;;iBIcgB,uBAAA,CAAwB,GAAA,EAAK,WAAA,GAAc,aAAA,CAAc,WAAA"}
@@ -1,5 +1,5 @@
1
- import { a as FunctionColumnDefault, c as UniqueConstraint, i as ForeignKeyConstraint, l as isDdlNode, n as DdlColumnDefault, o as LiteralColumnDefault, r as DdlNode, s as PrimaryKeyConstraint, t as DdlColumn } from "../ddl-types-X9_XHUl0.mjs";
2
- import { A as SelectAst, C as OrExpr, D as ProjectionItem, E as PreparedParamRef, F as isQueryAst, I as isWhereExpr, L as queryAstKinds, M as TableSource, N as UpdateAst, O as RawExpr, P as WindowFuncExpr, R as whereExprKinds, S as OperationExpr, T as ParamRef, _ as JsonObjectExpr, a as DefaultValueExpr, b as NotExpr, c as DoNothingConflictAction, d as ExistsExpr, f as IdentifierRef, g as JsonArrayAggExpr, h as JoinAst, i as ColumnRef, j as SubqueryExpr, k as RawSqlExpr, l as DoUpdateSetConflictAction, m as InsertOnConflict, n as AndExpr, o as DeleteAst, p as InsertAst, r as BinaryExpr, s as DerivedTableSource, t as AggregateExpr, u as EqColJoinOn, v as ListExpression, w as OrderByItem, x as NullCheckExpr, y as LiteralExpr } from "../types-D72v8s92.mjs";
1
+ import { a as FunctionColumnDefault, c as UniqueConstraint, i as ForeignKeyConstraint, l as isDdlNode, n as DdlColumnDefault, o as LiteralColumnDefault, r as DdlNode, s as PrimaryKeyConstraint, t as DdlColumn } from "../ddl-types-DAox2c8w.mjs";
2
+ import { A as RawSqlExpr, C as OperationExpr, D as PreparedParamRef, E as ParamRef, F as WindowFuncExpr, I as isQueryAst, L as isWhereExpr, M as SubqueryExpr, N as TableSource, O as ProjectionItem, P as UpdateAst, R as queryAstKinds, S as NullCheckExpr, T as OrderByItem, _ as JsonArrayAggExpr, a as DefaultValueExpr, b as LiteralExpr, c as DoNothingConflictAction, d as ExistsExpr, f as FunctionSource, g as JoinAst, h as InsertOnConflict, i as ColumnRef, j as SelectAst, k as RawExpr, l as DoUpdateSetConflictAction, m as InsertAst, n as AndExpr, o as DeleteAst, p as IdentifierRef, r as BinaryExpr, s as DerivedTableSource, t as AggregateExpr, u as EqColJoinOn, v as JsonObjectExpr, w as OrExpr, x as NotExpr, y as ListExpression, z as whereExprKinds } from "../types-lJUc6cY-.mjs";
3
3
  import { n as compact, t as collectOrderedParamRefs } from "../util-DQQgv2j1.mjs";
4
4
  import { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from "@prisma-next/framework-components/codec";
5
5
  import { type } from "arktype";
@@ -231,6 +231,6 @@ var SqlTimestampDescriptor = class extends CodecDescriptorImpl {
231
231
  const sqlTimestampDescriptor = new SqlTimestampDescriptor();
232
232
  const sqlTimestampColumn = (params = {}) => column(sqlTimestampDescriptor.factory(params), sqlTimestampDescriptor.codecId, params, "timestamp");
233
233
  //#endregion
234
- export { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionColumnDefault, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, collectOrderedParamRefs, compact, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };
234
+ export { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, collectOrderedParamRefs, compact, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };
235
235
 
236
236
  //# sourceMappingURL=ast.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-descriptor-registry.d.mts","names":[],"sources":["../../src/codec-descriptor-registry.ts","../../src/codec-ref-for-column.ts"],"mappings":";;;;;;;;;AAgBA;;;;;;;iBAAgB,4BAAA,CACd,cAAA,EAAgB,aAAA,CAAc,kBAAA,GAC9B,OAAA,GAAU,UAAA,GACT,uBAAA;;;;;;;AAHH;;;;;;;;;;;iBCQgB,wBAAA,CACd,OAAA,EAAS,UAAA,EACT,WAAA,UACA,SAAA,UACA,UAAA,WACC,QAAQ"}
1
+ {"version":3,"file":"codec-descriptor-registry.d.mts","names":[],"sources":["../../src/codec-descriptor-registry.ts","../../src/codec-ref-for-column.ts"],"mappings":";;;;;;;;;AAgBA;;;;;;;iBAAgB,4BAAA,CACd,cAAA,EAAgB,aAAA,CAAc,kBAAA,GAC9B,OAAA,GAAU,UAAA,GACT,uBAAA;;;;;;;AAHH;;;;;;;;;;;iBCIgB,wBAAA,CACd,OAAA,EAAS,UAAA,EACT,WAAA,UACA,SAAA,UACA,UAAA,WACC,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import { resolveStorageTable } from "@prisma-next/sql-contract/resolve-storage-table";
2
- import { isPostgresEnumStorageEntry, isStorageTypeInstance } from "@prisma-next/sql-contract/types";
2
+ import { isStorageTypeInstance } from "@prisma-next/sql-contract/types";
3
3
  //#region src/codec-ref-for-column.ts
4
4
  /**
5
5
  * Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@prisma-next/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.
@@ -22,19 +22,8 @@ function codecRefForStorageColumn(storage, namespaceId, tableName, columnName) {
22
22
  const columnDef = resolved.table.columns[columnName];
23
23
  if (!columnDef) return void 0;
24
24
  if (columnDef.typeRef !== void 0) {
25
- let instance = storage.types?.[columnDef.typeRef];
26
- if (!instance) for (const ns of Object.values(storage.namespaces)) {
27
- const nsEntry = ns.entries.type?.[columnDef.typeRef];
28
- if (nsEntry !== void 0) {
29
- instance = nsEntry;
30
- break;
31
- }
32
- }
25
+ const instance = storage.types?.[columnDef.typeRef];
33
26
  if (!instance) return void 0;
34
- if (isPostgresEnumStorageEntry(instance)) return {
35
- codecId: instance.codecId,
36
- typeParams: { values: instance.values }
37
- };
38
27
  if (isStorageTypeInstance(instance)) {
39
28
  const instanceParams = instance.typeParams;
40
29
  return instanceParams !== void 0 && Object.keys(instanceParams).length > 0 ? {
@@ -1 +1 @@
1
- {"version":3,"file":"codec-descriptor-registry.mjs","names":[],"sources":["../../src/codec-ref-for-column.ts","../../src/codec-descriptor-registry.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type { CodecRef } from '@prisma-next/framework-components/codec';\nimport { resolveStorageTable } from '@prisma-next/sql-contract/resolve-storage-table';\nimport {\n isPostgresEnumStorageEntry,\n isStorageTypeInstance,\n type SqlStorage,\n} from '@prisma-next/sql-contract/types';\n\n/**\n * Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@prisma-next/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.\n *\n * Resolution rules over namespace `entries.table[table].columns[column]`:\n *\n * - `typeRef` column → `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef share one ref → one memoised codec).\n * - inline `typeParams` column → `{codecId, typeParams}` from the column itself.\n * - non-parameterized column → `{codecId}` with `typeParams` undefined.\n *\n * Returns `undefined` when the table or column is unknown, or when a `typeRef` column references a `storage.types` entry that does not exist.\n *\n * `namespaceId` leads the coordinate args and is always supplied: every\n * model/table sits in an explicit namespace, so the table is resolved strictly\n * within that namespace (see {@link resolveStorageTable}).\n */\nexport function codecRefForStorageColumn(\n storage: SqlStorage,\n namespaceId: string,\n tableName: string,\n columnName: string,\n): CodecRef | undefined {\n const resolved = resolveStorageTable(storage, tableName, namespaceId);\n if (resolved === undefined) return undefined;\n const tableDef = resolved.table;\n const columnDef = tableDef.columns[columnName];\n if (!columnDef) return undefined;\n if (columnDef.typeRef !== undefined) {\n let instance: unknown = storage.types?.[columnDef.typeRef];\n if (!instance) {\n for (const ns of Object.values(storage.namespaces)) {\n const typeSlot = (ns.entries as { type?: Record<string, unknown> }).type;\n const nsEntry = typeSlot?.[columnDef.typeRef];\n if (nsEntry !== undefined) {\n instance = nsEntry;\n break;\n }\n }\n }\n if (!instance) return undefined;\n if (isPostgresEnumStorageEntry(instance)) {\n // Canonical path: the entry is a live `PostgresEnumType` IR\n // instance reached through the per-target serializer's\n // hydration. Raw JSON envelopes carrying `kind: 'postgres-enum'`\n // never reach this site — `SqlStorage.normaliseTypeEntry`\n // rejects them upstream (F09). Read `codecId` and `values` off\n // the structural shape (enumerable own properties on the live\n // instance) so the dispatch stays layered against the family\n // alphabet rather than a target-specific class import.\n return {\n codecId: instance.codecId,\n typeParams: { values: instance.values } as unknown as JsonValue,\n };\n }\n if (isStorageTypeInstance(instance)) {\n // Empty-state canonicalization: a `StorageTypeInstance` with absent\n // (or empty) `typeParams` produces a `CodecRef` with no `typeParams`\n // field. Equivalent to the non-parameterized-column branch below.\n // Carrying `{}` here would break content-keyed memoisation and trip\n // the runtime validator against non-parameterized codec descriptors.\n const instanceParams = instance.typeParams;\n const hasParamKeys = instanceParams !== undefined && Object.keys(instanceParams).length > 0;\n return hasParamKeys\n ? { codecId: instance.codecId, typeParams: instanceParams as JsonValue }\n : { codecId: instance.codecId };\n }\n return undefined;\n }\n if (columnDef.typeParams !== undefined && Object.keys(columnDef.typeParams).length > 0) {\n return { codecId: columnDef.codecId, typeParams: columnDef.typeParams as JsonValue };\n }\n return { codecId: columnDef.codecId };\n}\n","import type { CodecDescriptor, CodecRef } from '@prisma-next/framework-components/codec';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport type { AnyCodecDescriptor } from './ast/codec-types';\nimport { codecRefForStorageColumn } from './codec-ref-for-column';\nimport type { CodecDescriptorRegistry } from './query-lane-context';\n\n/**\n * Build a {@link CodecDescriptorRegistry} from a flat descriptor list.\n *\n * Used by:\n * - Each codec-shipping package's `core/registry.ts` to expose a package-scoped registry as the public consumer surface (replacing raw descriptor-array exports). See ADR 208.\n * - The runtime's `buildExecutionContext` to construct the contract-bound combined registry from every contributor's `codecs:` slot.\n *\n * The descriptor map is heterogeneous in `P` — each codec id has its own params shape. The public {@link CodecDescriptorRegistry} interface widens to `CodecDescriptor<unknown>` and consumers narrow per codec id at the call site (the descriptor's `paramsSchema` validates JSON-sourced params before the factory ever sees them, so the runtime narrow is safe). The cast at registration goes through `unknown` because\n * `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly).\n */\nexport function buildCodecDescriptorRegistry(\n allDescriptors: ReadonlyArray<AnyCodecDescriptor>,\n storage?: SqlStorage,\n): CodecDescriptorRegistry {\n type AnyDescriptor = CodecDescriptor<unknown>;\n const byId = new Map<string, AnyDescriptor>();\n const byTargetType = new Map<string, Array<AnyDescriptor>>();\n\n for (const descriptor of allDescriptors) {\n if (byId.has(descriptor.codecId)) {\n throw new Error(\n `Duplicate codec descriptor id: '${descriptor.codecId}' — registered twice during registry construction. ` +\n 'Each codecId must be contributed by exactly one component (target / adapter / extension pack).',\n );\n }\n const widened = descriptor as unknown as AnyDescriptor;\n byId.set(descriptor.codecId, widened);\n for (const targetType of descriptor.targetTypes) {\n const list = byTargetType.get(targetType);\n if (list) {\n list.push(widened);\n } else {\n byTargetType.set(targetType, [widened]);\n }\n }\n }\n\n return {\n descriptorFor(codecId: string): AnyDescriptor | undefined {\n return byId.get(codecId);\n },\n codecRefForColumn(namespaceId: string, table: string, column: string): CodecRef | undefined {\n if (!storage) return undefined;\n return codecRefForStorageColumn(storage, namespaceId, table, column);\n },\n *values(): IterableIterator<AnyDescriptor> {\n yield* byId.values();\n },\n byTargetType(targetType: string): readonly AnyDescriptor[] {\n return byTargetType.get(targetType) ?? Object.freeze([]);\n },\n };\n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AW,QAAQ,kJAExD;EAEF,MAAM,UAAU;EAChB,KAAK,IAAI,WAAW,SAAS,OAAO;EACpC,KAAK,MAAM,cAAc,WAAW,aAAa;GAC/C,MAAM,OAAO,aAAa,IAAI,UAAU;GACxC,IAAI,MACF,KAAK,KAAK,OAAO;QAEjB,aAAa,IAAI,YAAY,CAAC,OAAO,CAAC;EAE1C;CACF;CAEA,OAAO;EACL,cAAc,SAA4C;GACxD,OAAO,KAAK,IAAI,OAAO;EACzB;EACA,kBAAkB,aAAqB,OAAe,QAAsC;GAC1F,IAAI,CAAC,SAAS,OAAO,KAAA;GACrB,OAAO,yBAAyB,SAAS,aAAa,OAAO,MAAM;EACrE;EACA,CAAC,SAA0C;GACzC,OAAO,KAAK,OAAO;EACrB;EACA,aAAa,YAA8C;GACzD,OAAO,aAAa,IAAI,UAAU,KAAK,OAAO,OAAO,CAAC,CAAC;EACzD;CACF;AACF"}
1
+ {"version":3,"file":"codec-descriptor-registry.mjs","names":[],"sources":["../../src/codec-ref-for-column.ts","../../src/codec-descriptor-registry.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type { CodecRef } from '@prisma-next/framework-components/codec';\nimport { resolveStorageTable } from '@prisma-next/sql-contract/resolve-storage-table';\nimport { isStorageTypeInstance, type SqlStorage } from '@prisma-next/sql-contract/types';\n\n/**\n * Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@prisma-next/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.\n *\n * Resolution rules over namespace `entries.table[table].columns[column]`:\n *\n * - `typeRef` column → `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef share one ref → one memoised codec).\n * - inline `typeParams` column → `{codecId, typeParams}` from the column itself.\n * - non-parameterized column → `{codecId}` with `typeParams` undefined.\n *\n * Returns `undefined` when the table or column is unknown, or when a `typeRef` column references a `storage.types` entry that does not exist.\n *\n * `namespaceId` leads the coordinate args and is always supplied: every\n * model/table sits in an explicit namespace, so the table is resolved strictly\n * within that namespace (see {@link resolveStorageTable}).\n */\nexport function codecRefForStorageColumn(\n storage: SqlStorage,\n namespaceId: string,\n tableName: string,\n columnName: string,\n): CodecRef | undefined {\n const resolved = resolveStorageTable(storage, tableName, namespaceId);\n if (resolved === undefined) return undefined;\n const tableDef = resolved.table;\n const columnDef = tableDef.columns[columnName];\n if (!columnDef) return undefined;\n if (columnDef.typeRef !== undefined) {\n const instance = storage.types?.[columnDef.typeRef];\n if (!instance) return undefined;\n if (isStorageTypeInstance(instance)) {\n const instanceParams = instance.typeParams;\n const hasParamKeys = instanceParams !== undefined && Object.keys(instanceParams).length > 0;\n return hasParamKeys\n ? { codecId: instance.codecId, typeParams: instanceParams as JsonValue }\n : { codecId: instance.codecId };\n }\n return undefined;\n }\n if (columnDef.typeParams !== undefined && Object.keys(columnDef.typeParams).length > 0) {\n return { codecId: columnDef.codecId, typeParams: columnDef.typeParams as JsonValue };\n }\n return { codecId: columnDef.codecId };\n}\n","import type { CodecDescriptor, CodecRef } from '@prisma-next/framework-components/codec';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport type { AnyCodecDescriptor } from './ast/codec-types';\nimport { codecRefForStorageColumn } from './codec-ref-for-column';\nimport type { CodecDescriptorRegistry } from './query-lane-context';\n\n/**\n * Build a {@link CodecDescriptorRegistry} from a flat descriptor list.\n *\n * Used by:\n * - Each codec-shipping package's `core/registry.ts` to expose a package-scoped registry as the public consumer surface (replacing raw descriptor-array exports). See ADR 208.\n * - The runtime's `buildExecutionContext` to construct the contract-bound combined registry from every contributor's `codecs:` slot.\n *\n * The descriptor map is heterogeneous in `P` — each codec id has its own params shape. The public {@link CodecDescriptorRegistry} interface widens to `CodecDescriptor<unknown>` and consumers narrow per codec id at the call site (the descriptor's `paramsSchema` validates JSON-sourced params before the factory ever sees them, so the runtime narrow is safe). The cast at registration goes through `unknown` because\n * `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly).\n */\nexport function buildCodecDescriptorRegistry(\n allDescriptors: ReadonlyArray<AnyCodecDescriptor>,\n storage?: SqlStorage,\n): CodecDescriptorRegistry {\n type AnyDescriptor = CodecDescriptor<unknown>;\n const byId = new Map<string, AnyDescriptor>();\n const byTargetType = new Map<string, Array<AnyDescriptor>>();\n\n for (const descriptor of allDescriptors) {\n if (byId.has(descriptor.codecId)) {\n throw new Error(\n `Duplicate codec descriptor id: '${descriptor.codecId}' — registered twice during registry construction. ` +\n 'Each codecId must be contributed by exactly one component (target / adapter / extension pack).',\n );\n }\n const widened = descriptor as unknown as AnyDescriptor;\n byId.set(descriptor.codecId, widened);\n for (const targetType of descriptor.targetTypes) {\n const list = byTargetType.get(targetType);\n if (list) {\n list.push(widened);\n } else {\n byTargetType.set(targetType, [widened]);\n }\n }\n }\n\n return {\n descriptorFor(codecId: string): AnyDescriptor | undefined {\n return byId.get(codecId);\n },\n codecRefForColumn(namespaceId: string, table: string, column: string): CodecRef | undefined {\n if (!storage) return undefined;\n return codecRefForStorageColumn(storage, namespaceId, table, column);\n },\n *values(): IterableIterator<AnyDescriptor> {\n yield* byId.values();\n },\n byTargetType(targetType: string): readonly AnyDescriptor[] {\n return byTargetType.get(targetType) ?? Object.freeze([]);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,SAAgB,yBACd,SACA,aACA,WACA,YACsB;CACtB,MAAM,WAAW,oBAAoB,SAAS,WAAW,WAAW;CACpE,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;CAEnC,MAAM,YADW,SAAS,MACC,QAAQ;CACnC,IAAI,CAAC,WAAW,OAAO,KAAA;CACvB,IAAI,UAAU,YAAY,KAAA,GAAW;EACnC,MAAM,WAAW,QAAQ,QAAQ,UAAU;EAC3C,IAAI,CAAC,UAAU,OAAO,KAAA;EACtB,IAAI,sBA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Ref, o as AnyExpression, q as OrderByItem, st as UpdateAst, tt as SelectAst } from "../types-BbGUx5Bi.mjs";
2
- import { c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, l as FunctionColumnDefault, n as DdlColumn, t as AnyDdlColumnDefault, u as LiteralColumnDefault } from "../ddl-types-D3vlEjMA.mjs";
1
+ import { o as CodecRef } from "../codec-types-DFLA6Hmj.mjs";
2
+ import { J as OrderByItem, P as JoinAst, Q as ProjectionItem, ct as UpdateAst, g as ColumnRef, j as InsertAst, nt as SelectAst, o as AnyExpression, ot as TableSource, s as AnyFromSource } from "../types-DQrmgP8Y.mjs";
3
+ import { c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, l as FunctionColumnDefault, n as DdlColumn, t as AnyDdlColumnDefault, u as LiteralColumnDefault } from "../ddl-types-BVO002FS.mjs";
3
4
  import { ColumnDefaultLiteralInputValue } from "@prisma-next/contract/types";
4
5
  import { ReferentialAction } from "@prisma-next/sql-contract/types";
6
+ import { ParamSpec } from "@prisma-next/operations";
5
7
 
6
8
  //#region src/contract-free/column.d.ts
7
9
  interface DdlColumnOptions {
8
10
  readonly notNull?: boolean;
9
11
  readonly primaryKey?: boolean;
10
12
  readonly default?: AnyDdlColumnDefault;
13
+ readonly codecRef?: CodecRef;
11
14
  }
12
15
  declare function lit(value: ColumnDefaultLiteralInputValue): LiteralColumnDefault;
13
16
  declare function fn(expression: string): FunctionColumnDefault;
@@ -41,7 +44,61 @@ declare class CfExpr {
41
44
  and(other: CfExpr): CfExpr;
42
45
  or(other: CfExpr): CfExpr;
43
46
  not(): CfExpr;
47
+ isNull(): CfExpr;
48
+ isNotNull(): CfExpr;
49
+ eqLit(value: number | string | boolean): CfExpr;
50
+ gtLit(value: number | string | boolean): CfExpr;
51
+ eqParam(value: unknown, codecId: string): CfExpr;
52
+ eqExpr(other: CfExpr): CfExpr;
53
+ }
54
+ interface CfFnOptions {
55
+ readonly method: string;
56
+ readonly template: string;
57
+ readonly self: CfExpr;
58
+ readonly args?: ReadonlyArray<CfExpr>;
59
+ readonly returns: ParamSpec;
60
+ }
61
+ declare const cfExpr: {
62
+ countStar(): CfExpr;
63
+ lit(value: number | string | boolean): CfExpr;
64
+ identifierRef(name: string): CfExpr;
65
+ param(value: unknown, codecId: string): CfExpr;
66
+ /**
67
+ * Catalog function call lowered via a `'function'`-strategy template
68
+ * (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so
69
+ * target packages only supply vocabulary: template, codec'd operands,
70
+ * and return spec.
71
+ */
72
+ fn(options: CfFnOptions): CfExpr;
73
+ columnRef(qualifier: string, name: string): CfExpr;
74
+ allOf(exprs: ReadonlyArray<CfExpr>): CfExpr;
75
+ /**
76
+ * Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a
77
+ * `RawExpr`. For zero-operand catalog functions where a `'function'`
78
+ * lowering template has nothing to substitute.
79
+ */
80
+ raw(sql: string, returns: ParamSpec): CfExpr;
81
+ exists(query: CfExprSelectQuery): CfExpr;
82
+ notExists(query: CfExprSelectQuery): CfExpr;
83
+ };
84
+ /** Aliased table source for catalog queries (no namespace coordinate). */
85
+ declare function cfTable(name: string, alias?: string): TableSource;
86
+ declare class CfExprSelectQuery {
87
+ private readonly src;
88
+ private readonly projectionItems;
89
+ private readonly whereExpr;
90
+ private readonly joinItems;
91
+ private readonly limitValue;
92
+ constructor(src: AnyFromSource | undefined, projectionItems: ReadonlyArray<ProjectionItem>, whereExpr: CfExpr | undefined, joinItems?: ReadonlyArray<JoinAst>, limitValue?: number | undefined);
93
+ from(source: AnyFromSource): CfExprSelectQuery;
94
+ join(source: AnyFromSource, on: CfExpr): CfExprSelectQuery;
95
+ leftJoin(source: AnyFromSource, on: CfExpr): CfExprSelectQuery;
96
+ project(alias: string, expr: CfExpr): CfExprSelectQuery;
97
+ where(expr: CfExpr): CfExprSelectQuery;
98
+ limit(value: number): CfExprSelectQuery;
99
+ build(): SelectAst;
44
100
  }
101
+ declare function exprSelect(): CfExprSelectQuery;
45
102
  /**
46
103
  * Per-column authoring handle exposed as a keyed property on a {@link TableHandle}.
47
104
  * Carries codec metadata baked at declaration time so no codec ID, table name, or
@@ -157,5 +214,5 @@ declare class CfSelectQuery {
157
214
  */
158
215
  declare function table<Schema extends ColumnSchema>(source: TableSource, schema: Schema): TableHandle<Schema>;
159
216
  //#endregion
160
- export { CfConflictClause, CfExpr, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, type ColumnDescriptor, type ColumnProxy, type ColumnSchema, type DdlColumnOptions, type ExcludedProxy, type TableHandle, type TableInsertRow, type TableSetValues, col, fn, foreignKey, lit, primaryKey, table, unique };
217
+ export { CfConflictClause, CfExpr, CfExprSelectQuery, type CfFnOptions, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, type ColumnDescriptor, type ColumnProxy, type ColumnSchema, type DdlColumnOptions, type ExcludedProxy, type TableHandle, type TableInsertRow, type TableSetValues, cfExpr, cfTable, col, exprSelect, fn, foreignKey, lit, primaryKey, table, unique };
161
218
  //# sourceMappingURL=contract-free.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract-free.d.mts","names":[],"sources":["../../src/contract-free/column.ts","../../src/contract-free/table.ts"],"mappings":";;;;;;UAYiB,gBAAA;EAAA,SACN,OAAA;EAAA,SACA,UAAA;EAAA,SACA,OAAA,GAAU,mBAAmB;AAAA;AAAA,iBAGxB,GAAA,CAAI,KAAA,EAAO,8BAAA,GAAiC,oBAAoB;AAAA,iBAIhE,EAAA,CAAG,UAAA,WAAqB,qBAAqB;AAAA,iBAI7C,GAAA,CAAI,IAAA,UAAc,IAAA,UAAc,OAAA,GAAU,gBAAA,GAAmB,SAAS;AAAA,iBAItE,UAAA,CACd,OAAA,qBACA,OAAA;EAAA,SAAqB,IAAA;AAAA,IACpB,oBAAoB;AAAA,iBAIP,UAAA,CACd,OAAA,qBACA,QAAA,UACA,UAAA,qBACA,OAAA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AAA;EAUjE,KAAA,IAAS,SAAA;AAAA;AAAA,cAQE,aAAA;EAAA,iBAEQ,GAAA;EAAA,iBACA,eAAA;EAAA,iBACA,SAAA;EAAA,iBACA,YAAA;cAHA,GAAA,EAAK,WAAA,EACL,eAAA,EAAiB,aAAA,CAAc,cAAA,GAC/B,SAAA,GAAW,MAAA,cACX,YAAA,GAAc,aAAA,CAAc,WAAA;EAG/C,KAAA,CAAM,IAAA,EAAM,MAAA,GAAS,aAAA;EAIrB,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa,GAAA,oBAA8B,aAAA;EAQ3D,KAAA,IAAS,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;iBA0BK,KAAA,gBAAqB,YAAA,EACnC,MAAA,EAAQ,WAAA,EACR,MAAA,EAAQ,MAAA,GACP,WAAA,CAAY,MAAA"}
@@ -1,5 +1,5 @@
1
- import { a as FunctionColumnDefault, c as UniqueConstraint, i as ForeignKeyConstraint, o as LiteralColumnDefault, s as PrimaryKeyConstraint, t as DdlColumn } from "../ddl-types-X9_XHUl0.mjs";
2
- import { A as SelectAst, C as OrExpr, D as ProjectionItem, N as UpdateAst, T as ParamRef, i as ColumnRef, m as InsertOnConflict, n as AndExpr, p as InsertAst, r as BinaryExpr, w as OrderByItem, x as NullCheckExpr } from "../types-D72v8s92.mjs";
1
+ import { a as FunctionColumnDefault, c as UniqueConstraint, i as ForeignKeyConstraint, o as LiteralColumnDefault, s as PrimaryKeyConstraint, t as DdlColumn } from "../ddl-types-DAox2c8w.mjs";
2
+ import { C as OperationExpr, E as ParamRef, N as TableSource, O as ProjectionItem, P as UpdateAst, S as NullCheckExpr, T as OrderByItem, b as LiteralExpr, d as ExistsExpr, g as JoinAst, h as InsertOnConflict, i as ColumnRef, j as SelectAst, k as RawExpr, m as InsertAst, n as AndExpr, p as IdentifierRef, r as BinaryExpr, t as AggregateExpr, w as OrExpr } from "../types-lJUc6cY-.mjs";
3
3
  import { blindCast } from "@prisma-next/utils/casts";
4
4
  //#region src/contract-free/column.ts
5
5
  function lit(value) {
@@ -56,7 +56,127 @@ var CfExpr = class CfExpr {
56
56
  not() {
57
57
  return new CfExpr(this.ast.not());
58
58
  }
59
+ isNull() {
60
+ return new CfExpr(NullCheckExpr.isNull(this.ast));
61
+ }
62
+ isNotNull() {
63
+ return new CfExpr(NullCheckExpr.isNotNull(this.ast));
64
+ }
65
+ eqLit(value) {
66
+ return new CfExpr(BinaryExpr.eq(this.ast, LiteralExpr.of(value)));
67
+ }
68
+ gtLit(value) {
69
+ return new CfExpr(BinaryExpr.gt(this.ast, LiteralExpr.of(value)));
70
+ }
71
+ eqParam(value, codecId) {
72
+ return new CfExpr(BinaryExpr.eq(this.ast, ParamRef.of(value, { codec: { codecId } })));
73
+ }
74
+ eqExpr(other) {
75
+ return new CfExpr(BinaryExpr.eq(this.ast, other.ast));
76
+ }
77
+ };
78
+ const cfExpr = {
79
+ countStar() {
80
+ return new CfExpr(AggregateExpr.count());
81
+ },
82
+ lit(value) {
83
+ return new CfExpr(LiteralExpr.of(value));
84
+ },
85
+ identifierRef(name) {
86
+ return new CfExpr(IdentifierRef.of(name));
87
+ },
88
+ param(value, codecId) {
89
+ return new CfExpr(ParamRef.of(value, { codec: { codecId } }));
90
+ },
91
+ /**
92
+ * Catalog function call lowered via a `'function'`-strategy template
93
+ * (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so
94
+ * target packages only supply vocabulary: template, codec'd operands,
95
+ * and return spec.
96
+ */
97
+ fn(options) {
98
+ return new CfExpr(new OperationExpr({
99
+ method: options.method,
100
+ self: options.self.ast,
101
+ args: options.args?.map((arg) => arg.ast),
102
+ returns: options.returns,
103
+ lowering: {
104
+ targetFamily: "sql",
105
+ strategy: "function",
106
+ template: options.template
107
+ }
108
+ }));
109
+ },
110
+ columnRef(qualifier, name) {
111
+ return new CfExpr(ColumnRef.of(qualifier, name));
112
+ },
113
+ allOf(exprs) {
114
+ return new CfExpr(AndExpr.of(exprs.map((expr) => expr.ast)));
115
+ },
116
+ /**
117
+ * Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a
118
+ * `RawExpr`. For zero-operand catalog functions where a `'function'`
119
+ * lowering template has nothing to substitute.
120
+ */
121
+ raw(sql, returns) {
122
+ return new CfExpr(new RawExpr({
123
+ parts: [sql],
124
+ returns
125
+ }));
126
+ },
127
+ exists(query) {
128
+ return new CfExpr(ExistsExpr.exists(query.build()));
129
+ },
130
+ notExists(query) {
131
+ return new CfExpr(ExistsExpr.notExists(query.build()));
132
+ }
59
133
  };
134
+ /** Aliased table source for catalog queries (no namespace coordinate). */
135
+ function cfTable(name, alias) {
136
+ return TableSource.named(name, alias);
137
+ }
138
+ var CfExprSelectQuery = class CfExprSelectQuery {
139
+ src;
140
+ projectionItems;
141
+ whereExpr;
142
+ joinItems;
143
+ limitValue;
144
+ constructor(src, projectionItems, whereExpr, joinItems = [], limitValue = void 0) {
145
+ this.src = src;
146
+ this.projectionItems = projectionItems;
147
+ this.whereExpr = whereExpr;
148
+ this.joinItems = joinItems;
149
+ this.limitValue = limitValue;
150
+ }
151
+ from(source) {
152
+ return new CfExprSelectQuery(source, this.projectionItems, this.whereExpr, this.joinItems, this.limitValue);
153
+ }
154
+ join(source, on) {
155
+ return new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.inner(source, on.ast)], this.limitValue);
156
+ }
157
+ leftJoin(source, on) {
158
+ return new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.left(source, on.ast)], this.limitValue);
159
+ }
160
+ project(alias, expr) {
161
+ return new CfExprSelectQuery(this.src, [...this.projectionItems, ProjectionItem.of(alias, expr.ast)], this.whereExpr, this.joinItems, this.limitValue);
162
+ }
163
+ where(expr) {
164
+ return new CfExprSelectQuery(this.src, this.projectionItems, expr, this.joinItems, this.limitValue);
165
+ }
166
+ limit(value) {
167
+ return new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, this.joinItems, value);
168
+ }
169
+ build() {
170
+ if (this.joinItems.length > 0 && this.src === void 0) throw new Error("CfExprSelectQuery: cannot add a JOIN without a FROM clause");
171
+ const base = this.src !== void 0 ? SelectAst.from(this.src).withProjection(this.projectionItems) : SelectAst.noFrom().withProjection(this.projectionItems);
172
+ const withJoins = this.joinItems.length > 0 ? base.withJoins(this.joinItems) : base;
173
+ const withWhere = this.whereExpr !== void 0 ? withJoins.withWhere(this.whereExpr.ast) : withJoins;
174
+ return this.limitValue !== void 0 ? withWhere.withLimit(this.limitValue) : withWhere;
175
+ }
176
+ };
177
+ function exprSelect() {
178
+ return new CfExprSelectQuery(void 0, [], void 0);
179
+ }
60
180
  var CfInsertQuery = class CfInsertQuery {
61
181
  src;
62
182
  schema;
@@ -263,6 +383,6 @@ function buildSetMap(schema, values) {
263
383
  return set;
264
384
  }
265
385
  //#endregion
266
- export { CfConflictClause, CfExpr, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, col, fn, foreignKey, lit, primaryKey, table, unique };
386
+ export { CfConflictClause, CfExpr, CfExprSelectQuery, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, cfExpr, cfTable, col, exprSelect, fn, foreignKey, lit, primaryKey, table, unique };
267
387
 
268
388
  //# sourceMappingURL=contract-free.mjs.map