@prisma-next/sql-relational-core 0.7.0 → 0.8.0-dev.2

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.
@@ -1,8 +1,8 @@
1
- import { y as RuntimeError } from "./types-BQK1PdQu.mjs";
1
+ import { y as RuntimeError } from "./types--JXkJfaX.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-D2KewtVl.d.mts.map
8
+ //# sourceMappingURL=errors-DRpXpd-I.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-D2KewtVl.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;iBAEgB,WAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAA;AAAA,iBAkBa,eAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAA"}
1
+ {"version":3,"file":"errors-DRpXpd-I.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;iBAEgB,WAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAA;AAAA,iBAkBa,eAAA,CACd,OAAA,UACA,OAAA,GAAU,MAAA,mBACV,KAAA,sBACA,IAAA,uBACC,YAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as AnyCodecDescriptor } from "../codec-types-Cezo7k-i.mjs";
2
- import { n as CodecDescriptorRegistry } from "../query-lane-context-DHsPbikl.mjs";
2
+ import { n as CodecDescriptorRegistry } from "../query-lane-context-Dw1Tz0kv.mjs";
3
3
  import { CodecRef } from "@prisma-next/framework-components/codec";
4
4
  import { SqlStorage } from "@prisma-next/sql-contract/types";
5
5
 
@@ -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;;;;;;;iBCDgB,wBAAA,CACd,OAAA,EAAS,UAAA,EACT,SAAA,UACA,UAAA,WACC,QAAA"}
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;;;;;;;iBCGgB,wBAAA,CACd,OAAA,EAAS,UAAA,EACT,SAAA,UACA,UAAA,WACC,QAAA"}
@@ -1,3 +1,4 @@
1
+ import { isPostgresEnumStorageEntry, isStorageTypeInstance } from "@prisma-next/sql-contract/types";
1
2
  //#region src/codec-ref-for-column.ts
2
3
  /**
3
4
  * 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`.
@@ -18,10 +19,15 @@ function codecRefForStorageColumn(storage, tableName, columnName) {
18
19
  if (columnDef.typeRef !== void 0) {
19
20
  const instance = storage.types?.[columnDef.typeRef];
20
21
  if (!instance) return void 0;
21
- return {
22
+ if (isPostgresEnumStorageEntry(instance)) return {
23
+ codecId: instance.codecId,
24
+ typeParams: { values: instance.values }
25
+ };
26
+ if (isStorageTypeInstance(instance)) return {
22
27
  codecId: instance.codecId,
23
28
  typeParams: instance.typeParams
24
29
  };
30
+ return;
25
31
  }
26
32
  if (columnDef.typeParams !== void 0) return {
27
33
  codecId: columnDef.codecId,
@@ -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 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 `storage.tables[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 */\nexport function codecRefForStorageColumn(\n storage: SqlStorage,\n tableName: string,\n columnName: string,\n): CodecRef | undefined {\n const tableDef = storage.tables[tableName];\n if (!tableDef) return undefined;\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 return { codecId: instance.codecId, typeParams: instance.typeParams as JsonValue };\n }\n if (columnDef.typeParams !== undefined) {\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(table: string, column: string): CodecRef | undefined {\n if (!storage) return undefined;\n return codecRefForStorageColumn(storage, table, column);\n },\n *values(): IterableIterator<AnyDescriptor> {\n yield* byId.values();\n },\n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EtB,aAAa,YAA8C;GACzD,OAAO,aAAa,IAAI,WAAW,IAAI,OAAO,OAAO,EAAE,CAAC;;EAE3D"}
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 {\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 `storage.tables[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 */\nexport function codecRefForStorageColumn(\n storage: SqlStorage,\n tableName: string,\n columnName: string,\n): CodecRef | undefined {\n const tableDef = storage.tables[tableName];\n if (!tableDef) return undefined;\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 (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 return { codecId: instance.codecId, typeParams: instance.typeParams as JsonValue };\n }\n return undefined;\n }\n if (columnDef.typeParams !== undefined) {\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(table: string, column: string): CodecRef | undefined {\n if (!storage) return undefined;\n return codecRefForStorageColumn(storage, 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":";;;;;;;;;;;;;AAmBA,SAAgB,yBACd,SACA,WACA,YACsB;CACtB,MAAM,WAAW,QAAQ,OAAO;CAChC,IAAI,CAAC,UAAU,OAAO,KAAA;CACtB,MAAM,YAAY,SAAS,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,2BAA2B,SAAS,EAStC,OAAO;GACL,SAAS,SAAS;GAClB,YAAY,EAAE,QAAQ,SAAS,QAAQ;GACxC;EAEH,IAAI,sBAAsB,SAAS,EACjC,OAAO;GAAE,SAAS,SAAS;GAAS,YAAY,SAAS;GAAyB;EAEpF;;CAEF,IAAI,UAAU,eAAe,KAAA,GAC3B,OAAO;EAAE,SAAS,UAAU;EAAS,YAAY,UAAU;EAAyB;CAEtF,OAAO,EAAE,SAAS,UAAU,SAAS;;;;;;;;;;;;;;ACrCvC,SAAgB,6BACd,gBACA,SACyB;CAEzB,MAAM,uBAAO,IAAI,KAA4B;CAC7C,MAAM,+BAAe,IAAI,KAAmC;CAE5D,KAAK,MAAM,cAAc,gBAAgB;EACvC,IAAI,KAAK,IAAI,WAAW,QAAQ,EAC9B,MAAM,IAAI,MACR,mCAAmC,WAAW,QAAQ,mJAEvD;EAEH,MAAM,UAAU;EAChB,KAAK,IAAI,WAAW,SAAS,QAAQ;EACrC,KAAK,MAAM,cAAc,WAAW,aAAa;GAC/C,MAAM,OAAO,aAAa,IAAI,WAAW;GACzC,IAAI,MACF,KAAK,KAAK,QAAQ;QAElB,aAAa,IAAI,YAAY,CAAC,QAAQ,CAAC;;;CAK7C,OAAO;EACL,cAAc,SAA4C;GACxD,OAAO,KAAK,IAAI,QAAQ;;EAE1B,kBAAkB,OAAe,QAAsC;GACrE,IAAI,CAAC,SAAS,OAAO,KAAA;GACrB,OAAO,yBAAyB,SAAS,OAAO,OAAO;;EAEzD,CAAC,SAA0C;GACzC,OAAO,KAAK,QAAQ;;EAEtB,aAAa,YAA8C;GACzD,OAAO,aAAa,IAAI,WAAW,IAAI,OAAO,OAAO,EAAE,CAAC;;EAE3D"}
@@ -1,2 +1,2 @@
1
- import { n as planUnsupported, t as planInvalid } from "../errors-D2KewtVl.mjs";
1
+ import { n as planUnsupported, t as planInvalid } from "../errors-DRpXpd-I.mjs";
2
2
  export { planInvalid, planUnsupported };
@@ -1,8 +1,8 @@
1
1
  import { o as CodecRef } from "../codec-types-Cezo7k-i.mjs";
2
2
  import { o as AnyExpression } from "../types-juiKe2qf.mjs";
3
+ import { QueryOperationReturn } from "@prisma-next/sql-contract/types";
3
4
  import { ParamSpec } from "@prisma-next/operations";
4
5
  import { SqlLoweringSpec } from "@prisma-next/sql-operations";
5
- import { QueryOperationReturn } from "@prisma-next/sql-contract/types";
6
6
 
7
7
  //#region src/expression.d.ts
8
8
  type ScopeField = {
@@ -1,3 +1,3 @@
1
1
  import { t as SqlExecutionPlan } from "../sql-execution-plan-DM2Hcvvn.mjs";
2
- import { n as planFromAst, t as SqlQueryPlan } from "../plan-DmBWXsDN.mjs";
2
+ import { n as planFromAst, t as SqlQueryPlan } from "../plan-Pqs6SXGH.mjs";
3
3
  export { type SqlExecutionPlan, SqlQueryPlan, planFromAst };
@@ -1,2 +1,2 @@
1
- import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "../query-lane-context-DHsPbikl.mjs";
1
+ import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "../query-lane-context-Dw1Tz0kv.mjs";
2
2
  export { AppliedMutationDefault, CodecDescriptorRegistry, ExecutionContext, MutationDefaultsOp, MutationDefaultsOptions, TypeHelperRegistry };
@@ -1,3 +1,3 @@
1
- import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "../types-BQK1PdQu.mjs";
2
- import { n as SqlOrmPlan, t as RuntimeScope } from "../types-BWJCGyVL.mjs";
1
+ import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "../types--JXkJfaX.mjs";
2
+ import { n as SqlOrmPlan, t as RuntimeScope } from "../types-CdzH8pOW.mjs";
3
3
  export { BuildOptions, BuildParamsMap, CodecTypes, ColumnsOf, ComputeColumnJsType, Expr, HasIncludeManyCapabilities, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, RuntimeError, RuntimeScope, SqlBuilderOptions, SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
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-Cezo7k-i.mjs";
2
2
  import { $ as TableSource, A as InsertOnConflict, B as NotExpr, C as ExistsExpr, D as ExpressionSource, E as ExpressionRewriter, F as JsonObjectEntry, G as ParamRef, H as OperationExpr, I as JsonObjectExpr, J as RawSqlExpr, K as ProjectionExpr, L as ListExpression, M as JoinAst, N as JoinOnExpr, O as IdentifierRef, P as JsonArrayAggExpr, Q as TableRef, R as LiteralExpr, S as EqColJoinOn, T as ExpressionFolder, U as OrExpr, V as NullCheckExpr, W as OrderByItem, X as SelectAstOptions, Y as SelectAst, Z as SubqueryExpr, _ as DeleteAst, a as AndExpr, at as queryAstKinds, b as DoNothingConflictAction, c as AnyInsertOnConflictAction, d as AnyQueryAst, et as ToWhereExpr, f as AstRewriter, g as DefaultValueExpr, h as ColumnRef, i as AggregateOpFn, it as isWhereExpr, j as InsertValue, k as InsertAst, l as AnyInsertValue, m as BinaryOp, n as AggregateExpr, nt as WhereArg, o as AnyExpression, ot as whereExprKinds, p as BinaryExpr, q as ProjectionItem, r as AggregateFn, rt as isQueryAst, s as AnyFromSource, t as AggregateCountFn, tt as UpdateAst, u as AnyOperationArg, v as DerivedTableSource, w as ExprVisitor, x as DoUpdateSetConflictAction, y as Direction, z as LoweredStatement } from "./types-juiKe2qf.mjs";
3
3
  import { Adapter, AdapterProfile, AdapterTarget, Lowerer, LowererContext, MarkerReadResult, MarkerStatement, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SqlCharCodec, SqlCharDescriptor, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, collectOrderedParamRefs, compact, 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 } from "./exports/ast.mjs";
4
- import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-DHsPbikl.mjs";
4
+ import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-Dw1Tz0kv.mjs";
5
5
  import { t as SqlExecutionPlan } from "./sql-execution-plan-DM2Hcvvn.mjs";
6
- import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "./types-BQK1PdQu.mjs";
7
- import { n as planUnsupported, t as planInvalid } from "./errors-D2KewtVl.mjs";
6
+ import { C as TableKey, S as TableDef, T as TablesOf, _ as RawTemplateFactory, a as ComputeColumnJsType, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnsOf, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as Expr, p as OperationTypes, r as CodecTypes, s as HasIncludeManyCapabilities, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableMetadata, x as SqlPlan, y as RuntimeError } from "./types--JXkJfaX.mjs";
7
+ import { n as planUnsupported, t as planInvalid } from "./errors-DRpXpd-I.mjs";
8
8
  import { BuildOperationSpec, CodecExpression, Expression, ScopeField, TraitExpression, buildOperation, codecOf, toExpr } from "./exports/expression.mjs";
9
9
  import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-CfWhG9hx.mjs";
10
- import { n as planFromAst, t as SqlQueryPlan } from "./plan-DmBWXsDN.mjs";
11
- import { n as SqlOrmPlan, t as RuntimeScope } from "./types-BWJCGyVL.mjs";
10
+ import { n as planFromAst, t as SqlQueryPlan } from "./plan-Pqs6SXGH.mjs";
11
+ import { n as SqlOrmPlan, t as RuntimeScope } from "./types-CdzH8pOW.mjs";
12
12
  export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, Codec, CodecCallContext, CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecMeta, CodecRef, CodecTrait, CodecTypes, ColumnRef, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, HasIncludeManyCapabilities, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, ListExpression, LiteralExpr, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, MarkerStatement, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, ParamRefEntry, ParamRefEntryUnion, ParamRefHandle, ProjectionExpr, ProjectionItem, RawFactory, RawFunctionOptions, RawSqlExpr, RawTemplateFactory, RawTemplateOptions, RuntimeError, RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScopeField, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlOrmPlan, SqlParamRefMutator, SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UpdateAst, WhereArg, buildOperation, codecOf, collectOrderedParamRefs, compact, createSqlParamRefMutator, isQueryAst, isWhereExpr, planFromAst, planInvalid, planUnsupported, 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, toExpr, whereExprKinds };
@@ -1,7 +1,7 @@
1
1
  import { d as AnyQueryAst } from "./types-juiKe2qf.mjs";
2
2
  import { QueryPlan } from "@prisma-next/framework-components/runtime";
3
- import { Contract } from "@prisma-next/contract/types";
4
3
  import { SqlStorage } from "@prisma-next/sql-contract/types";
4
+ import { Contract } from "@prisma-next/contract/types";
5
5
 
6
6
  //#region src/plan.d.ts
7
7
  /**
@@ -41,4 +41,4 @@ interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
41
41
  declare function planFromAst<Row = unknown>(ast: AnyQueryAst, contract: Contract<SqlStorage>, laneId?: string): SqlQueryPlan<Row>;
42
42
  //#endregion
43
43
  export { planFromAst as n, SqlQueryPlan as t };
44
- //# sourceMappingURL=plan-DmBWXsDN.d.mts.map
44
+ //# sourceMappingURL=plan-Pqs6SXGH.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan-DmBWXsDN.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;AAkBA;;;;;;;;;;;UAAiB,YAAA,wBAAoC,SAAA,CAAU,GAAA;EAAA,SACpD,GAAA,EAAK,WAAA;EAAA,SACL,MAAA;AAAA;;AAoBX;;;;;;;;;;;;;;;;iBAAgB,WAAA,eAAA,CACd,GAAA,EAAK,WAAA,EACL,QAAA,EAAU,QAAA,CAAS,UAAA,GACnB,MAAA,YACC,YAAA,CAAa,GAAA"}
1
+ {"version":3,"file":"plan-Pqs6SXGH.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;AAkBA;;;;;;;;;;;UAAiB,YAAA,wBAAoC,SAAA,CAAU,GAAA;EAAA,SACpD,GAAA,EAAK,WAAA;EAAA,SACL,MAAA;AAAA;;AAoBX;;;;;;;;;;;;;;;;iBAAgB,WAAA,eAAA,CACd,GAAA,EAAK,WAAA,EACL,QAAA,EAAU,QAAA,CAAS,UAAA,GACnB,MAAA,YACC,YAAA,CAAa,GAAA"}
@@ -1,8 +1,8 @@
1
1
  import { c as ContractCodecRegistry } from "./codec-types-Cezo7k-i.mjs";
2
2
  import { CodecDescriptor, CodecRef } from "@prisma-next/framework-components/codec";
3
+ import { SqlStorage } from "@prisma-next/sql-contract/types";
3
4
  import { Contract } from "@prisma-next/contract/types";
4
5
  import { SqlOperationRegistry } from "@prisma-next/sql-operations";
5
- import { SqlStorage } from "@prisma-next/sql-contract/types";
6
6
 
7
7
  //#region src/query-lane-context.d.ts
8
8
  /**
@@ -80,4 +80,4 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
80
80
  }
81
81
  //#endregion
82
82
  export { MutationDefaultsOptions as a, MutationDefaultsOp as i, CodecDescriptorRegistry as n, TypeHelperRegistry as o, ExecutionContext as r, AppliedMutationDefault as t };
83
- //# sourceMappingURL=query-lane-context-DHsPbikl.d.mts.map
83
+ //# sourceMappingURL=query-lane-context-Dw1Tz0kv.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-lane-context-DHsPbikl.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;AASA;UAAiB,uBAAA;;;;EAIf,aAAA,CAAc,OAAA,WAAkB,eAAA;EAgBtB;;;;;;;;;;;EAJV,iBAAA,CAAkB,KAAA,UAAe,MAAA,WAAiB,QAAA;EAIxC;;;EAAV,MAAA,IAAU,gBAAA,CAAiB,eAAA;EAIgB;;;EAA3C,YAAA,CAAa,UAAA,oBAA8B,eAAA;AAAA;;;;KAMjC,kBAAA,GAAqB,MAAA;AAAA,KAErB,kBAAA;AAAA,KAEA,sBAAA;EAAA,SACD,MAAA;EAAA,SACA,KAAA;AAAA;AAAA,KAGC,uBAAA;EAAA,SACD,EAAA,EAAI,kBAAA;EAAA,SACJ,KAAA;EAAA,SACA,MAAA,EAAQ,MAAA;EAHP;;;;EAAA,SAQD,iBAAA,GAAoB,GAAA;AAAA;;;;;;UAQd,gBAAA,mBAAmC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SACzE,QAAA,EAAU,SAAA;EATV;;;EAAA,SAaA,cAAA,EAAgB,qBAAA;EALV;;;EAAA,SASN,gBAAA,EAAkB,uBAAA;EAAA,SAClB,eAAA,EAAiB,oBAAA;EAVwD;;;EAAA,SAczE,KAAA,EAAO,kBAAA;EALW;;;EAS3B,qBAAA,CAAsB,OAAA,EAAS,uBAAA,GAA0B,aAAA,CAAc,sBAAA;AAAA"}
1
+ {"version":3,"file":"query-lane-context-Dw1Tz0kv.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;AASA;UAAiB,uBAAA;;;;EAIf,aAAA,CAAc,OAAA,WAAkB,eAAA;EAgBtB;;;;;;;;;;;EAJV,iBAAA,CAAkB,KAAA,UAAe,MAAA,WAAiB,QAAA;EAIxC;;;EAAV,MAAA,IAAU,gBAAA,CAAiB,eAAA;EAIgB;;;EAA3C,YAAA,CAAa,UAAA,oBAA8B,eAAA;AAAA;;;;KAMjC,kBAAA,GAAqB,MAAA;AAAA,KAErB,kBAAA;AAAA,KAEA,sBAAA;EAAA,SACD,MAAA;EAAA,SACA,KAAA;AAAA;AAAA,KAGC,uBAAA;EAAA,SACD,EAAA,EAAI,kBAAA;EAAA,SACJ,KAAA;EAAA,SACA,MAAA,EAAQ,MAAA;EAHP;;;;EAAA,SAQD,iBAAA,GAAoB,GAAA;AAAA;;;;;;UAQd,gBAAA,mBAAmC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SACzE,QAAA,EAAU,SAAA;EATV;;;EAAA,SAaA,cAAA,EAAgB,qBAAA;EALV;;;EAAA,SASN,gBAAA,EAAkB,uBAAA;EAAA,SAClB,eAAA,EAAiB,oBAAA;EAVwD;;;EAAA,SAczE,KAAA,EAAO,kBAAA;EALW;;;EAS3B,qBAAA,CAAsB,OAAA,EAAS,uBAAA,GAA0B,aAAA,CAAc,sBAAA;AAAA"}
@@ -1,10 +1,10 @@
1
1
  import { G as ParamRef, h as ColumnRef } from "./types-juiKe2qf.mjs";
2
- import { r as ExecutionContext } from "./query-lane-context-DHsPbikl.mjs";
2
+ import { r as ExecutionContext } from "./query-lane-context-Dw1Tz0kv.mjs";
3
3
  import { t as SqlExecutionPlan } from "./sql-execution-plan-DM2Hcvvn.mjs";
4
+ import { ExtractFieldOutputTypes, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
4
5
  import { Contract } from "@prisma-next/contract/types";
5
6
  import { ParamSpec } from "@prisma-next/operations";
6
7
  import { SqlLoweringSpec } from "@prisma-next/sql-operations";
7
- import { ExtractFieldOutputTypes, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
8
8
 
9
9
  //#region src/types.d.ts
10
10
  type Expr = ColumnRef | ParamRef;
@@ -190,4 +190,4 @@ interface SqlBuilderOptions<TContract extends Contract<SqlStorage> = Contract<Sq
190
190
  }
191
191
  //#endregion
192
192
  export { TableKey as C, TableDef as S, TablesOf as T, RawTemplateFactory as _, ComputeColumnJsType as a, SqlBuilderOptions as b, META as c, ModelMetadata as d, OperationTypeSignature as f, RawFunctionOptions as g, RawFactory as h, ColumnsOf as i, Meta as l, OperationsForTypeId as m, BuildParamsMap as n, Expr as o, OperationTypes as p, CodecTypes as r, HasIncludeManyCapabilities as s, BuildOptions as t, ModelDef as u, RawTemplateOptions as v, TableMetadata as w, SqlPlan as x, RuntimeError as y };
193
- //# sourceMappingURL=types-BQK1PdQu.d.mts.map
193
+ //# sourceMappingURL=types--JXkJfaX.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-BQK1PdQu.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;KAYY,IAAA,GAAO,SAAA,GAAY,QAAA;;AAA/B;;;KAMK,mBAAA,mBACe,QAAA,CAAS,UAAA,+BAEzB,SAAA,wCAAiD,MAAA,kCAEnC,MAAA,YAAkB,MAAA,CAAO,CAAA;EAAA,SAC1B,OAAA;IAAA,SAAoB,KAAA,EAAO,SAAA;EAAA;AAAA,IAElC,CAAA,iBAEE,MAAA;;;;;KAOP,oBAAA,mBACe,QAAA,CAAS,UAAA,0DAI3B,mBAAA,CAAoB,SAAA,EAAW,SAAA,2CAC3B,SAAA,wCAAiD,MAAA,oBAC/C,SAAA,SAAkB,MAAA,qCAChB,MAAA,CAAO,IAAA;EAAA,SACI,OAAA;IAAA,SAAoB,MAAA,uBAA6B,MAAA;EAAA;AAAA,kBAG5C,MAAA,YAAkB,MAAA,CAAO,CAAA;EAAA,SAAsB,MAAA,EAAQ,UAAA;AAAA,IAC/D,CAAA,iBAEE,MAAA;AAAA,KAMf,mBAAA,oBACgB,aAAA,qBACA,MAAA;EAAA,SAA0B,MAAA;AAAA,MAC3C,UAAA;EAAqB,OAAA;AAAA,IACrB,OAAA,eAAsB,UAAA,GACpB,UAAA,CAAW,OAAA;EAAA,SAA4B,M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AAA,UACL,IAAA,GAAO,aAAA,CAAc,IAAA;AAAA;AAAA,KAGrB,SAAA,sBAEA,QAAA,CAAS,SAAA,KACjB,CAAA,eAAgB,QAAA,CAAS,SAAA,IACzB,QAAA,CAAS,SAAA,EAAW,CAAA;EAAa,OAAA;AAAA,IAC/B,CAAA;AAAA,UAIW,kBAAA;EAAA,SACN,WAAA,GAAc,MAAA;AAAA;AAAA,UAGR,kBAAA,SAA2B,kBAAA;EAAA,SACjC,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGP,kBAAA,IACV,OAAA,EAAS,oBAAA,KACN,MAAA,yBACA,gBAAA;AAAA,UAEY,UAAA,SAAmB,kBAAA;EAAA,CACjC,IAAA,UAAc,OAAA,EAAS,kBAAA,GAAqB,gBAAA;EAC7C,IAAA,CAAK,OAAA,EAAS,kBAAA,GAAqB,kBAAA;AAAA;AAAA,UAGpB,YAAA,SAAqB,KAAA;EAAA,SAC3B,IAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA,GAAU,MAAA;EAAA,SACV,KAAA;EAAA,SACA,IAAA;AAAA;AAAA,UAGM,cAAA;EAAA,UACL,IAAA;AAAA;AAAA,UAGK,YAAA;EAAA,SACN,MAAA,GAAS,cAAA;AAAA;AAAA,UAGH,iBAAA,mBAAoC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA;EAAA,SAC1E,OAAA,EAAS,gBAAA,CAAiB,SAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as SqlExecutionPlan } from "./sql-execution-plan-DM2Hcvvn.mjs";
2
- import { t as SqlQueryPlan } from "./plan-DmBWXsDN.mjs";
2
+ import { t as SqlQueryPlan } from "./plan-Pqs6SXGH.mjs";
3
3
  import { RuntimeExecutor } from "@prisma-next/framework-components/runtime";
4
4
 
5
5
  //#region src/runtime-scope.d.ts
@@ -20,4 +20,4 @@ type SqlOrmPlan = SqlExecutionPlan | SqlQueryPlan;
20
20
  type RuntimeScope = Pick<RuntimeExecutor<SqlOrmPlan>, 'execute'>;
21
21
  //#endregion
22
22
  export { SqlOrmPlan as n, RuntimeScope as t };
23
- //# sourceMappingURL=types-BWJCGyVL.d.mts.map
23
+ //# sourceMappingURL=types-CdzH8pOW.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-BWJCGyVL.d.mts","names":[],"sources":["../src/runtime-scope.ts"],"mappings":";;;;;;;;AASA;;KAAY,UAAA,GAAa,gBAAA,GAAmB,YAAA;;;AAU5C;;;;;;KAAY,YAAA,GAAe,IAAA,CAAK,eAAA,CAAgB,UAAA"}
1
+ {"version":3,"file":"types-CdzH8pOW.d.mts","names":[],"sources":["../src/runtime-scope.ts"],"mappings":";;;;;;;;AASA;;KAAY,UAAA,GAAa,gBAAA,GAAmB,YAAA;;;AAU5C;;;;;;KAAY,YAAA,GAAe,IAAA,CAAK,eAAA,CAAgB,UAAA"}
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "@prisma-next/sql-relational-core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-dev.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "AST types, query lane context, and type utilities for Prisma Next SQL lanes",
8
8
  "dependencies": {
9
+ "@prisma-next/contract": "0.8.0-dev.2",
10
+ "@prisma-next/framework-components": "0.8.0-dev.2",
11
+ "@prisma-next/operations": "0.8.0-dev.2",
12
+ "@prisma-next/sql-contract": "0.8.0-dev.2",
13
+ "@prisma-next/sql-operations": "0.8.0-dev.2",
14
+ "@prisma-next/utils": "0.8.0-dev.2",
9
15
  "@standard-schema/spec": "^1.1.0",
10
16
  "arktype": "^2.1.29",
11
- "ts-toolbelt": "^9.6.0",
12
- "@prisma-next/contract": "0.7.0",
13
- "@prisma-next/framework-components": "0.7.0",
14
- "@prisma-next/operations": "0.7.0",
15
- "@prisma-next/sql-contract": "0.7.0",
16
- "@prisma-next/sql-operations": "0.7.0",
17
- "@prisma-next/utils": "0.7.0"
17
+ "ts-toolbelt": "^9.6.0"
18
18
  },
19
19
  "devDependencies": {
20
+ "@prisma-next/sql-contract-ts": "0.8.0-dev.2",
21
+ "@prisma-next/test-utils": "0.8.0-dev.2",
22
+ "@prisma-next/tsconfig": "0.8.0-dev.2",
23
+ "@prisma-next/tsdown": "0.8.0-dev.2",
20
24
  "tsdown": "0.22.0",
21
25
  "typescript": "5.9.3",
22
- "vitest": "4.1.5",
23
- "@prisma-next/sql-contract-ts": "0.7.0",
24
- "@prisma-next/test-utils": "0.7.0",
25
- "@prisma-next/tsconfig": "0.7.0",
26
- "@prisma-next/tsdown": "0.7.0"
26
+ "vitest": "4.1.5"
27
27
  },
28
28
  "files": [
29
29
  "dist",
@@ -1,6 +1,10 @@
1
1
  import type { JsonValue } from '@prisma-next/contract/types';
2
2
  import type { CodecRef } from '@prisma-next/framework-components/codec';
3
- import type { SqlStorage } from '@prisma-next/sql-contract/types';
3
+ import {
4
+ isPostgresEnumStorageEntry,
5
+ isStorageTypeInstance,
6
+ type SqlStorage,
7
+ } from '@prisma-next/sql-contract/types';
4
8
 
5
9
  /**
6
10
  * 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`.
@@ -25,7 +29,24 @@ export function codecRefForStorageColumn(
25
29
  if (columnDef.typeRef !== undefined) {
26
30
  const instance = storage.types?.[columnDef.typeRef];
27
31
  if (!instance) return undefined;
28
- return { codecId: instance.codecId, typeParams: instance.typeParams as JsonValue };
32
+ if (isPostgresEnumStorageEntry(instance)) {
33
+ // Canonical path: the entry is a live `PostgresEnumType` IR
34
+ // instance reached through the per-target serializer's
35
+ // hydration. Raw JSON envelopes carrying `kind: 'postgres-enum'`
36
+ // never reach this site — `SqlStorage.normaliseTypeEntry`
37
+ // rejects them upstream (F09). Read `codecId` and `values` off
38
+ // the structural shape (enumerable own properties on the live
39
+ // instance) so the dispatch stays layered against the family
40
+ // alphabet rather than a target-specific class import.
41
+ return {
42
+ codecId: instance.codecId,
43
+ typeParams: { values: instance.values } as unknown as JsonValue,
44
+ };
45
+ }
46
+ if (isStorageTypeInstance(instance)) {
47
+ return { codecId: instance.codecId, typeParams: instance.typeParams as JsonValue };
48
+ }
49
+ return undefined;
29
50
  }
30
51
  if (columnDef.typeParams !== undefined) {
31
52
  return { codecId: columnDef.codecId, typeParams: columnDef.typeParams as JsonValue };