@prisma-next/sql-relational-core 0.3.0-dev.32 → 0.3.0-dev.33
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.
- package/dist/{chunk-2UXDQ3AT.js → chunk-HAUHWBE7.js} +1 -1
- package/dist/chunk-HAUHWBE7.js.map +1 -0
- package/dist/{chunk-VPLNZJZR.js → chunk-RVHFGDZ6.js} +2 -2
- package/dist/exports/ast.js +2 -2
- package/dist/exports/types.js +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +59 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/types.ts +167 -13
- package/dist/chunk-2UXDQ3AT.js.map +0 -1
- /package/dist/{chunk-VPLNZJZR.js.map → chunk-RVHFGDZ6.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n ResultType as CoreResultType,\n ExecutionPlan,\n PlanRefs,\n} from '@prisma-next/contract/types';\nimport type { ArgSpec, ReturnSpec } from '@prisma-next/operations';\nimport type { SqlContract, SqlStorage, StorageColumn } from '@prisma-next/sql-contract/types';\nimport type { SqlLoweringSpec } from '@prisma-next/sql-operations';\nimport type {\n BinaryOp,\n ColumnRef,\n Direction,\n Expression,\n ExpressionSource,\n OperationExpr,\n ParamRef,\n QueryAst,\n} from './ast/types';\nimport type { SqlQueryPlan } from './plan';\nimport type { QueryLaneContext } from './query-lane-context';\n\nexport interface ParamPlaceholder {\n readonly kind: 'param-placeholder';\n readonly name: string;\n}\n\n/**\n * ValueSource represents any value that can appear in a comparison or as an argument.\n * This includes:\n * - ParamPlaceholder: A parameter placeholder (e.g., `param('userId')`)\n * - ExpressionSource: Something that can be converted to an Expression (ColumnBuilder, ExpressionBuilder)\n */\nexport type ValueSource = ParamPlaceholder | ExpressionSource;\n\nexport interface OrderBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'order';\n readonly expr: Expression;\n readonly dir: Direction;\n}\n\n/**\n * Creates an OrderBuilder for use in orderBy clauses.\n */\nexport function createOrderBuilder(\n expr: AnyColumnBuilder | OperationExpr,\n dir: Direction,\n): AnyOrderBuilder {\n return { kind: 'order', expr, dir } as AnyOrderBuilder;\n}\n\n/**\n * ColumnBuilder with optional operation methods based on the column's typeId.\n * When Operations is provided and the column's typeId matches, operation methods are included.\n * Implements ExpressionSource to provide type-safe conversion to ColumnRef.\n *\n * For nullable columns (ColumnMeta['nullable'] extends true), includes isNull() and isNotNull() methods.\n */\nexport type ColumnBuilder<\n ColumnName extends string = string,\n ColumnMeta extends StorageColumn = StorageColumn,\n JsType = unknown,\n Operations extends OperationTypes = Record<string, never>,\n> = {\n readonly kind: 'column';\n readonly table: string;\n readonly column: ColumnName;\n readonly columnMeta: ColumnMeta;\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n neq(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n gt(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n lt(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n gte(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n lte(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n asc(): OrderBuilder<ColumnName, ColumnMeta, JsType>;\n desc(): OrderBuilder<ColumnName, ColumnMeta, JsType>;\n /** Converts this column builder to a ColumnRef expression */\n toExpr(): ColumnRef;\n // Helper property for type extraction (not used at runtime)\n readonly __jsType: JsType;\n} & (ColumnMeta['codecId'] extends string\n ? ColumnMeta['codecId'] extends keyof Operations\n ? OperationMethods<\n OperationsForTypeId<ColumnMeta['codecId'] & string, Operations>,\n ColumnName,\n StorageColumn,\n JsType\n >\n : Record<string, never>\n : Record<string, never>) &\n (ColumnMeta['nullable'] extends true\n ? NullableMethods<ColumnName, ColumnMeta, JsType>\n : Record<string, never>);\n\nexport interface BinaryBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'binary';\n readonly op: BinaryOp;\n readonly left: Expression;\n readonly right: ValueSource;\n}\n\n/**\n * Builder for IS NULL / IS NOT NULL checks.\n * Used to build unary null check expressions in WHERE clauses.\n */\nexport interface NullCheckBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'nullCheck';\n readonly expr: Expression;\n readonly isNull: boolean;\n}\n\n/**\n * Union type for unary builders (currently just NullCheckBuilder).\n * Extensible for future unary operators.\n */\nexport type UnaryBuilder = NullCheckBuilder;\n\n// Forward declare AnyBinaryBuilder and AnyOrderBuilder for use in ExpressionBuilder\nexport type AnyBinaryBuilder = BinaryBuilder;\nexport type AnyOrderBuilder = OrderBuilder;\nexport type AnyUnaryBuilder = UnaryBuilder;\n\n/**\n * Methods available only on nullable columns.\n * These are conditionally added to ColumnBuilder when ColumnMeta['nullable'] is true.\n * Note: Index signature is required for compatibility with AnyColumnBuilderBase's index signature.\n */\nexport interface NullableMethods<\n ColumnName extends string = string,\n ColumnMeta extends StorageColumn = StorageColumn,\n JsType = unknown,\n> {\n /** Creates an IS NULL check for this column */\n isNull(): NullCheckBuilder<ColumnName, ColumnMeta, JsType>;\n /** Creates an IS NOT NULL check for this column */\n isNotNull(): NullCheckBuilder<ColumnName, ColumnMeta, JsType>;\n /** Index signature for compatibility with AnyColumnBuilderBase */\n readonly [key: string]: unknown;\n}\n\n/**\n * ExpressionBuilder represents the result of an operation (e.g., col.distance(...)).\n * Unlike ColumnBuilder (which represents a column), ExpressionBuilder represents\n * an operation expression and provides the same DSL methods for chaining.\n *\n * Implements ExpressionSource to provide type-safe conversion to OperationExpr.\n */\nexport interface ExpressionBuilder<JsType = unknown> extends ExpressionSource {\n readonly kind: 'expression';\n readonly expr: OperationExpr;\n readonly columnMeta: StorageColumn;\n\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): AnyBinaryBuilder;\n neq(value: ValueSource): AnyBinaryBuilder;\n gt(value: ValueSource): AnyBinaryBuilder;\n lt(value: ValueSource): AnyBinaryBuilder;\n gte(value: ValueSource): AnyBinaryBuilder;\n lte(value: ValueSource): AnyBinaryBuilder;\n asc(): AnyOrderBuilder;\n desc(): AnyOrderBuilder;\n\n /** Converts this expression builder to the underlying OperationExpr */\n toExpr(): OperationExpr;\n\n // Helper property for type extraction (not used at runtime)\n readonly __jsType: JsType;\n}\n\n// Helper aliases for usage sites where the specific column parameters are irrelevant\n// Accepts any ColumnBuilder regardless of its Operations parameter\n// Note: We use `any` here because TypeScript's variance rules don't allow us to express\n// \"any type that extends OperationTypes\" in a way that works for assignment.\n// Contract-specific OperationTypes (e.g., PgVectorOperationTypes) are not assignable\n// to the base OperationTypes in generic parameter position, even though they extend it structurally.\n// Helper type that accepts any ColumnBuilder regardless of its generic parameters\n// This is needed because conditional types in ColumnBuilder create incompatible intersection types\n// when Operations differs, even though structurally they're compatible\nexport type AnyColumnBuilderBase = {\n readonly kind: 'column';\n readonly table: string;\n readonly column: string;\n readonly columnMeta: StorageColumn;\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): AnyBinaryBuilder;\n neq(value: ValueSource): AnyBinaryBuilder;\n gt(value: ValueSource): AnyBinaryBuilder;\n lt(value: ValueSource): AnyBinaryBuilder;\n gte(value: ValueSource): AnyBinaryBuilder;\n lte(value: ValueSource): AnyBinaryBuilder;\n asc(): AnyOrderBuilder;\n desc(): AnyOrderBuilder;\n toExpr(): ColumnRef;\n readonly __jsType: unknown;\n // Optional nullable methods (present when columnMeta.nullable is true)\n isNull?(): AnyUnaryBuilder;\n isNotNull?(): AnyUnaryBuilder;\n // Allow any operation methods (from conditional type)\n readonly [key: string]: unknown;\n};\n\nexport type AnyColumnBuilder =\n | ColumnBuilder<\n string,\n StorageColumn,\n unknown,\n // biome-ignore lint/suspicious/noExplicitAny: AnyColumnBuilder must accept column builders with any operation types\n any\n >\n | AnyColumnBuilderBase;\n\n/**\n * Union type for any builder that can produce an Expression.\n * Used in DSL method signatures where either a column or operation result can be passed.\n */\nexport type AnyExpressionSource = AnyColumnBuilder | ExpressionBuilder;\n\nexport function isColumnBuilder(value: unknown): value is AnyColumnBuilder {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'kind' in value &&\n (value as { kind: unknown }).kind === 'column'\n );\n}\n\nexport interface JoinOnBuilder {\n eqCol(left: AnyColumnBuilder, right: AnyColumnBuilder): JoinOnPredicate;\n}\n\nexport interface JoinOnPredicate {\n readonly kind: 'join-on';\n readonly left: AnyColumnBuilder;\n readonly right: AnyColumnBuilder;\n}\n\nexport type Expr = ColumnRef | ParamRef;\n\n/**\n * Helper type to extract codec output type from CodecTypes.\n * Returns never if the codecId is not found in CodecTypes.\n */\ntype ExtractCodecOutputType<\n CodecId extends string,\n CodecTypes extends Record<string, { readonly output: unknown }>,\n> = CodecId extends keyof CodecTypes\n ? CodecTypes[CodecId] extends { readonly output: infer Output }\n ? Output\n : never\n : never;\n\n/**\n * Extracts the model name for a given table from the contract mappings.\n */\ntype ExtractTableToModel<\n Contract extends SqlContract<SqlStorage>,\n TableName extends string,\n> = Contract['mappings'] extends {\n readonly tableToModel: infer TableToModel;\n}\n ? TableToModel extends Record<string, string>\n ? TableName extends keyof TableToModel\n ? TableToModel[TableName]\n : never\n : never\n : never;\n\n/**\n * Extracts the field name for a given table column from the contract mappings.\n */\ntype ExtractColumnToField<\n Contract extends SqlContract<SqlStorage>,\n TableName extends string,\n ColumnName extends string,\n> = Contract['mappings'] extends {\n readonly columnToField: infer ColumnToField;\n}\n ? ColumnToField extends Record<string, Record<string, string>>\n ? TableName extends keyof ColumnToField\n ? ColumnName extends keyof ColumnToField[TableName]\n ? ColumnToField[TableName][ColumnName]\n : never\n : never\n : never\n : never;\n\n/**\n * Extracts the field value type from a model's fields.\n */\ntype ExtractFieldValue<\n Contract extends SqlContract<SqlStorage>,\n ModelName extends string,\n FieldName extends string,\n> = Contract['models'] extends infer Models\n ? Models extends Record<string, unknown>\n ? ModelName extends keyof Models\n ? Models[ModelName] extends { readonly fields: infer Fields }\n ? Fields extends Record<string, unknown>\n ? FieldName extends keyof Fields\n ? Fields[FieldName]\n : never\n : never\n : never\n : never\n : never\n : never;\n\n/**\n * Extracts the JavaScript type for a column from model mappings if available.\n * Returns `never` if the column maps to a ModelField object (which indicates\n * a relation that should fall through to codec-based type resolution).\n *\n * The check for ModelField uses `Exclude<keyof FieldValue, 'column'> extends never`\n * to ensure we only skip pure `{ column: string }` marker objects, not richer\n * object types that happen to include a `column` property.\n */\ntype ExtractColumnJsTypeFromModels<\n Contract extends SqlContract<SqlStorage>,\n TableName extends string,\n ColumnName extends string,\n> = ExtractTableToModel<Contract, TableName> extends infer ModelName\n ? ModelName extends string\n ? ExtractColumnToField<Contract, TableName, ColumnName> extends infer FieldName\n ? FieldName extends string\n ? ExtractFieldValue<Contract, ModelName, FieldName> extends infer FieldValue\n ? FieldValue extends { readonly column: string }\n ? Exclude<keyof FieldValue, 'column'> extends never\n ? never\n : FieldValue\n : FieldValue\n : never\n : never\n : never\n : never\n : never;\n\n/**\n * Resolves type params for a column from either:\n * - inline `columnMeta.typeParams`, or\n * - `columnMeta.typeRef` (resolving into `contract.storage.types[typeRef].typeParams`).\n */\ntype ResolveColumnTypeParams<\n Contract extends SqlContract<SqlStorage>,\n ColumnMeta extends StorageColumn,\n> = ColumnMeta extends { typeParams: infer Params }\n ? Params extends object\n ? Params\n : undefined\n : ColumnMeta extends { typeRef: infer TypeRef extends string }\n ? Contract['storage'] extends { types: infer Types }\n ? Types extends Record<string, unknown>\n ? TypeRef extends keyof Types\n ? Types[TypeRef] extends { typeParams: infer Params }\n ? Params extends object\n ? Params\n : undefined\n : undefined\n : undefined\n : undefined\n : undefined\n : undefined;\n\n/**\n * If a codec entry exposes a type-level parameterized output surface, compute the output type\n * for a specific params object. Falls back to `never` if not supported.\n *\n * This enables lane typing to incorporate `columnMeta.typeParams` without branching on codec IDs\n * in core lane code.\n */\ntype ExtractParameterizedCodecOutputType<\n CodecId extends string,\n Params,\n CodecTypes extends Record<string, { readonly output: unknown }>,\n> = CodecId extends keyof CodecTypes\n ? CodecTypes[CodecId] extends { readonly parameterizedOutput: infer Fn }\n ? Fn extends (params: Params) => infer Out\n ? Out\n : never\n : never\n : never;\n\n/**\n * Type-level operation signature.\n * Represents an operation at the type level, similar to OperationSignature at runtime.\n */\nexport type OperationTypeSignature = {\n readonly args: ReadonlyArray<ArgSpec>;\n readonly returns: ReturnSpec;\n readonly lowering: SqlLoweringSpec;\n readonly capabilities?: ReadonlyArray<string>;\n};\n\n/**\n * Type-level operation registry.\n * Maps typeId → operations, where operations is a record of method name → operation signature.\n *\n * Example:\n * ```typescript\n * type MyOperations: OperationTypes = {\n * 'pg/vector@1': {\n * cosineDistance: {\n * args: [{ kind: 'typeId'; type: 'pg/vector@1' }];\n * returns: { kind: 'builtin'; type: 'number' };\n * lowering: { targetFamily: 'sql'; strategy: 'function'; template: '...' };\n * };\n * };\n * };\n * ```\n */\nexport type OperationTypes = Record<string, Record<string, OperationTypeSignature>>;\n\n/**\n * CodecTypes represents a map of typeId to codec definitions.\n * Each codec definition must have an `output` property indicating the JavaScript type.\n *\n * Example:\n * ```typescript\n * type MyCodecTypes: CodecTypes = {\n * 'pg/int4@1': { output: number };\n * 'pg/text@1': { output: string };\n * };\n * ```\n */\nexport type CodecTypes = Record<string, { readonly output: unknown }>;\n\n/**\n * Extracts operations for a given typeId from the operation registry.\n * Returns an empty record if the typeId is not found.\n *\n * @example\n * ```typescript\n * type Ops = OperationsForTypeId<'pg/vector@1', MyOperations>;\n * // Ops = { cosineDistance: { ... }, l2Distance: { ... } }\n * ```\n */\nexport type OperationsForTypeId<\n TypeId extends string,\n Operations extends OperationTypes,\n> = Operations extends Record<string, never>\n ? Record<string, never>\n : TypeId extends keyof Operations\n ? Operations[TypeId]\n : Record<string, never>;\n\n/**\n * Maps operation signatures to method signatures on ColumnBuilder.\n * Each operation becomes a method that returns a ColumnBuilder or BinaryBuilder\n * based on the return type.\n */\ntype OperationMethods<\n Ops extends Record<string, OperationTypeSignature>,\n ColumnName extends string,\n ColumnMeta extends StorageColumn,\n JsType,\n> = {\n [K in keyof Ops]: Ops[K] extends OperationTypeSignature\n ? (\n ...args: OperationArgs<Ops[K]['args']>\n ) => OperationReturn<Ops[K]['returns'], ColumnName, ColumnMeta, JsType>\n : never;\n};\n\n/**\n * Maps operation argument specs to TypeScript argument types.\n * - typeId args: ColumnBuilder (accepts base columns or operation results)\n * - param args: ParamPlaceholder\n * - literal args: unknown (could be more specific in future)\n */\ntype OperationArgs<Args extends ReadonlyArray<ArgSpec>> = Args extends readonly [\n infer First,\n ...infer Rest,\n]\n ? First extends ArgSpec\n ? [ArgToType<First>, ...(Rest extends ReadonlyArray<ArgSpec> ? OperationArgs<Rest> : [])]\n : []\n : [];\n\ntype ArgToType<Arg extends ArgSpec> = Arg extends { kind: 'typeId' }\n ? AnyExpressionSource\n : Arg extends { kind: 'param' }\n ? ParamPlaceholder\n : Arg extends { kind: 'literal' }\n ? unknown\n : never;\n\n/**\n * Maps operation return spec to return type.\n * Operations return ExpressionBuilder, not ColumnBuilder, because the result\n * represents an expression (OperationExpr) rather than a column reference.\n */\ntype OperationReturn<\n Returns extends ReturnSpec,\n _ColumnName extends string,\n _ColumnMeta extends StorageColumn,\n _JsType,\n> = Returns extends { kind: 'builtin'; type: infer T }\n ? T extends 'number'\n ? ExpressionBuilder<number>\n : T extends 'boolean'\n ? ExpressionBuilder<boolean>\n : T extends 'string'\n ? ExpressionBuilder<string>\n : ExpressionBuilder<unknown>\n : Returns extends { kind: 'typeId' }\n ? ExpressionBuilder<unknown>\n : ExpressionBuilder<unknown>;\n\n/**\n * Computes JavaScript type for a column at column creation time.\n *\n * Type inference:\n * - Read columnMeta.codecId as typeId string literal\n * - Look up CodecTypes[typeId].output\n * - Apply nullability: nullable ? Output | null : Output\n */\ntype ColumnMetaTypeId<ColumnMeta> = ColumnMeta extends { codecId: infer CodecId extends string }\n ? CodecId\n : ColumnMeta extends { type: infer TypeId extends string }\n ? TypeId\n : never;\n\nexport type ComputeColumnJsType<\n Contract extends SqlContract<SqlStorage>,\n TableName extends string,\n ColumnName extends string,\n ColumnMeta extends StorageColumn,\n CodecTypes extends Record<string, { readonly output: unknown }>,\n> = ExtractColumnJsTypeFromModels<Contract, TableName, ColumnName> extends infer FromModels\n ? [FromModels] extends [never]\n ? ColumnMeta extends { nullable: infer Nullable }\n ? ColumnMetaTypeId<ColumnMeta> extends infer TypeId\n ? TypeId extends string\n ? ResolveColumnTypeParams<Contract, ColumnMeta> extends infer Params\n ? Params extends object\n ? ExtractParameterizedCodecOutputType<\n TypeId,\n Params,\n CodecTypes\n > extends infer ParamOutput\n ? [ParamOutput] extends [never]\n ? ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput\n ? [CodecOutput] extends [never]\n ? unknown // Codec not found in CodecTypes\n : Nullable extends true\n ? CodecOutput | null\n : CodecOutput\n : unknown\n : Nullable extends true\n ? ParamOutput | null\n : ParamOutput\n : unknown\n : ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput\n ? [CodecOutput] extends [never]\n ? unknown // Codec not found in CodecTypes\n : Nullable extends true\n ? CodecOutput | null\n : CodecOutput\n : unknown\n : unknown\n : unknown\n : unknown\n : unknown\n : FromModels\n : unknown;\n\n/**\n * Infers Row type from a projection object.\n * Maps Record<string, ColumnBuilder> to Record<string, JSType>\n *\n * Extracts the pre-computed JsType from each ColumnBuilder in the projection.\n */\n/**\n * Extracts the inferred JsType carried by a ColumnBuilder.\n */\ntype ExtractJsTypeFromColumnBuilder<CB extends AnyColumnBuilder> =\n CB extends ColumnBuilder<\n infer _ColumnName extends string,\n infer _ColumnMeta extends StorageColumn,\n infer JsType,\n infer _Ops\n >\n ? JsType\n : never;\n\nexport type InferProjectionRow<P extends Record<string, AnyColumnBuilder>> = {\n [K in keyof P]: ExtractJsTypeFromColumnBuilder<P[K]>;\n};\n\n/**\n * Nested projection type - allows recursive nesting of ColumnBuilder, ExpressionBuilder, or nested objects.\n */\nexport type NestedProjection = Record<\n string,\n | AnyExpressionSource\n | Record<\n string,\n | AnyExpressionSource\n | Record<\n string,\n | AnyExpressionSource\n | Record<string, AnyExpressionSource | Record<string, AnyExpressionSource>>\n >\n >\n>;\n\n/**\n * Helper type to extract include type from Includes map.\n * Returns the value type if K is a key of Includes, otherwise returns unknown.\n */\ntype ExtractIncludeType<\n K extends string,\n Includes extends Record<string, unknown>,\n> = K extends keyof Includes ? Includes[K] : unknown;\n\n/**\n * Infers Row type from a nested projection object.\n * Recursively maps Record<string, ColumnBuilder | boolean | NestedProjection> to nested object types.\n *\n * Extracts the pre-computed JsType from each ColumnBuilder at leaves.\n * When a value is `true`, it represents an include reference and infers `Array<ChildShape>`\n * by looking up the include alias in the Includes type map.\n */\nexport type InferNestedProjectionRow<\n P extends Record<string, AnyExpressionSource | boolean | NestedProjection>,\n CodecTypes extends Record<string, { readonly output: unknown }> = Record<string, never>,\n Includes extends Record<string, unknown> = Record<string, never>,\n> = {\n [K in keyof P]: P[K] extends ExpressionBuilder<infer JsType>\n ? JsType\n : P[K] extends AnyColumnBuilder\n ? ExtractJsTypeFromColumnBuilder<P[K]>\n : P[K] extends true\n ? Array<ExtractIncludeType<K & string, Includes>> // Include reference - infers Array<ChildShape> from Includes map\n : P[K] extends NestedProjection\n ? InferNestedProjectionRow<P[K], CodecTypes, Includes>\n : never;\n};\n\n/**\n * Infers Row type from a tuple of ColumnBuilders used in returning() clause.\n * Extracts column name and JsType from each ColumnBuilder and creates a Record.\n */\nexport type InferReturningRow<Columns extends readonly AnyColumnBuilder[]> =\n Columns extends readonly [infer First, ...infer Rest]\n ? First extends ColumnBuilder<\n infer Name,\n infer _Meta,\n infer JsType,\n infer _Ops extends OperationTypes\n >\n ? Name extends string\n ? Rest extends readonly AnyColumnBuilder[]\n ? { [K in Name]: JsType } & InferReturningRow<Rest>\n : { [K in Name]: JsType }\n : never\n : never\n : Record<string, never>;\n\n/**\n * Utility type to check if a contract has the required capabilities for includeMany.\n * Requires both `lateral` and `jsonAgg` to be `true` in the contract's capabilities for the target.\n * Capabilities are nested by target: `{ [target]: { lateral: true, jsonAgg: true } }`\n */\nexport type HasIncludeManyCapabilities<TContract extends SqlContract<SqlStorage>> =\n TContract extends { capabilities: infer C; target: infer T }\n ? T extends string\n ? C extends Record<string, Record<string, boolean>>\n ? C extends { [K in T]: infer TargetCaps }\n ? TargetCaps extends { lateral: true; jsonAgg: true }\n ? true\n : false\n : false\n : false\n : false\n : false;\n\n/**\n * SQL-specific Plan type that refines the ast field to use QueryAst.\n * This is the type used by SQL query builders.\n */\nexport type SqlPlan<Row = unknown> = ExecutionPlan<Row, QueryAst>;\n\n/**\n * Helper types for extracting contract structure.\n */\nexport type TablesOf<TContract> = TContract extends {\n storage: { tables: infer U };\n}\n ? U\n : never;\n\nexport type TableKey<TContract> = Extract<keyof TablesOf<TContract>, string>;\n\n// Common types for contract.d.ts generation (SQL-specific)\n// These types are used by emitted contract.d.ts files to provide type-safe DSL/ORM types\n\n/**\n * Unique symbol for metadata property to avoid collisions with user-defined properties\n */\nexport declare const META: unique symbol;\n\n/**\n * Extracts metadata from a type that has a META property\n */\nexport type Meta<T extends { [META]: unknown }> = T[typeof META];\n\n/**\n * Metadata interface for table definitions\n */\nexport interface TableMetadata<Name extends string> {\n name: Name;\n}\n\n/**\n * Metadata interface for model definitions\n */\nexport interface ModelMetadata<Name extends string> {\n name: Name;\n}\n\n/**\n * Base interface for table definitions with metadata\n * Used in contract.d.ts to define storage-level table types\n */\nexport interface TableDef<Name extends string> {\n readonly [META]: TableMetadata<Name>;\n}\n\n/**\n * Base interface for model definitions with metadata\n * Used in contract.d.ts to define application-level model types\n */\nexport interface ModelDef<Name extends string> {\n readonly [META]: ModelMetadata<Name>;\n}\n\nexport type ColumnsOf<\n TContract,\n K extends TableKey<TContract>,\n> = K extends keyof TablesOf<TContract>\n ? TablesOf<TContract>[K] extends { columns: infer C }\n ? C\n : never\n : never;\n\nexport interface RawTemplateOptions {\n readonly refs?: PlanRefs;\n readonly annotations?: Record<string, unknown>;\n readonly projection?: ReadonlyArray<string>;\n}\n\nexport interface RawFunctionOptions extends RawTemplateOptions {\n readonly params: ReadonlyArray<unknown>;\n}\n\nexport type RawTemplateFactory = (\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n) => ExecutionPlan;\n\nexport interface RawFactory extends RawTemplateFactory {\n (text: string, options: RawFunctionOptions): ExecutionPlan;\n with(options: RawTemplateOptions): RawTemplateFactory;\n}\n\nexport type { RuntimeError } from '@prisma-next/plan';\n\nexport interface BuildParamsMap {\n readonly [name: string]: unknown;\n}\n\nexport interface BuildOptions {\n readonly params?: BuildParamsMap;\n}\n\nexport interface SqlBuilderOptions<\n TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>,\n> {\n readonly context: QueryLaneContext<TContract>;\n}\n\n/**\n * SQL-specific ResultType that works with both Plan and SqlQueryPlan.\n * This extends the core ResultType to also handle SqlQueryPlan.\n * Example: `type Row = ResultType<typeof plan>`\n */\nexport type ResultType<P> = P extends SqlQueryPlan<infer R> ? R : CoreResultType<P>;\n"],"mappings":";AA+CO,SAAS,mBACd,MACA,KACiB;AACjB,SAAO,EAAE,MAAM,SAAS,MAAM,IAAI;AACpC;AAiLO,SAAS,gBAAgB,OAA2C;AACzE,SACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAA4B,SAAS;AAE1C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isColumnBuilder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HAUHWBE7.js";
|
|
4
4
|
|
|
5
5
|
// src/ast/codec-types.ts
|
|
6
6
|
var CodecRegistryImpl = class {
|
|
@@ -325,4 +325,4 @@ export {
|
|
|
325
325
|
isOperationExpr,
|
|
326
326
|
createUpdateAst
|
|
327
327
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
328
|
+
//# sourceMappingURL=chunk-RVHFGDZ6.js.map
|
package/dist/exports/ast.js
CHANGED
package/dist/exports/types.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
createUpdateAst,
|
|
40
40
|
defineCodecs,
|
|
41
41
|
isOperationExpr
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-RVHFGDZ6.js";
|
|
43
43
|
import {
|
|
44
44
|
createOrderBuilder,
|
|
45
45
|
isColumnBuilder
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-HAUHWBE7.js";
|
|
47
47
|
import {
|
|
48
48
|
augmentDescriptorWithColumnMeta
|
|
49
49
|
} from "./chunk-KYSP7L5C.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -152,6 +152,62 @@ type ExtractCodecOutputType<CodecId extends string, CodecTypes extends Record<st
|
|
|
152
152
|
}>> = CodecId extends keyof CodecTypes ? CodecTypes[CodecId] extends {
|
|
153
153
|
readonly output: infer Output;
|
|
154
154
|
} ? Output : never : never;
|
|
155
|
+
/**
|
|
156
|
+
* Extracts the model name for a given table from the contract mappings.
|
|
157
|
+
*/
|
|
158
|
+
type ExtractTableToModel<Contract extends SqlContract<SqlStorage>, TableName extends string> = Contract['mappings'] extends {
|
|
159
|
+
readonly tableToModel: infer TableToModel;
|
|
160
|
+
} ? TableToModel extends Record<string, string> ? TableName extends keyof TableToModel ? TableToModel[TableName] : never : never : never;
|
|
161
|
+
/**
|
|
162
|
+
* Extracts the field name for a given table column from the contract mappings.
|
|
163
|
+
*/
|
|
164
|
+
type ExtractColumnToField<Contract extends SqlContract<SqlStorage>, TableName extends string, ColumnName extends string> = Contract['mappings'] extends {
|
|
165
|
+
readonly columnToField: infer ColumnToField;
|
|
166
|
+
} ? ColumnToField extends Record<string, Record<string, string>> ? TableName extends keyof ColumnToField ? ColumnName extends keyof ColumnToField[TableName] ? ColumnToField[TableName][ColumnName] : never : never : never : never;
|
|
167
|
+
/**
|
|
168
|
+
* Extracts the field value type from a model's fields.
|
|
169
|
+
*/
|
|
170
|
+
type ExtractFieldValue<Contract extends SqlContract<SqlStorage>, ModelName extends string, FieldName extends string> = Contract['models'] extends infer Models ? Models extends Record<string, unknown> ? ModelName extends keyof Models ? Models[ModelName] extends {
|
|
171
|
+
readonly fields: infer Fields;
|
|
172
|
+
} ? Fields extends Record<string, unknown> ? FieldName extends keyof Fields ? Fields[FieldName] : never : never : never : never : never : never;
|
|
173
|
+
/**
|
|
174
|
+
* Extracts the JavaScript type for a column from model mappings if available.
|
|
175
|
+
* Returns `never` if the column maps to a ModelField object (which indicates
|
|
176
|
+
* a relation that should fall through to codec-based type resolution).
|
|
177
|
+
*
|
|
178
|
+
* The check for ModelField uses `Exclude<keyof FieldValue, 'column'> extends never`
|
|
179
|
+
* to ensure we only skip pure `{ column: string }` marker objects, not richer
|
|
180
|
+
* object types that happen to include a `column` property.
|
|
181
|
+
*/
|
|
182
|
+
type ExtractColumnJsTypeFromModels<Contract extends SqlContract<SqlStorage>, TableName extends string, ColumnName extends string> = ExtractTableToModel<Contract, TableName> extends infer ModelName ? ModelName extends string ? ExtractColumnToField<Contract, TableName, ColumnName> extends infer FieldName ? FieldName extends string ? ExtractFieldValue<Contract, ModelName, FieldName> extends infer FieldValue ? FieldValue extends {
|
|
183
|
+
readonly column: string;
|
|
184
|
+
} ? Exclude<keyof FieldValue, 'column'> extends never ? never : FieldValue : FieldValue : never : never : never : never : never;
|
|
185
|
+
/**
|
|
186
|
+
* Resolves type params for a column from either:
|
|
187
|
+
* - inline `columnMeta.typeParams`, or
|
|
188
|
+
* - `columnMeta.typeRef` (resolving into `contract.storage.types[typeRef].typeParams`).
|
|
189
|
+
*/
|
|
190
|
+
type ResolveColumnTypeParams<Contract extends SqlContract<SqlStorage>, ColumnMeta extends StorageColumn> = ColumnMeta extends {
|
|
191
|
+
typeParams: infer Params;
|
|
192
|
+
} ? Params extends object ? Params : undefined : ColumnMeta extends {
|
|
193
|
+
typeRef: infer TypeRef extends string;
|
|
194
|
+
} ? Contract['storage'] extends {
|
|
195
|
+
types: infer Types;
|
|
196
|
+
} ? Types extends Record<string, unknown> ? TypeRef extends keyof Types ? Types[TypeRef] extends {
|
|
197
|
+
typeParams: infer Params;
|
|
198
|
+
} ? Params extends object ? Params : undefined : undefined : undefined : undefined : undefined : undefined;
|
|
199
|
+
/**
|
|
200
|
+
* If a codec entry exposes a type-level parameterized output surface, compute the output type
|
|
201
|
+
* for a specific params object. Falls back to `never` if not supported.
|
|
202
|
+
*
|
|
203
|
+
* This enables lane typing to incorporate `columnMeta.typeParams` without branching on codec IDs
|
|
204
|
+
* in core lane code.
|
|
205
|
+
*/
|
|
206
|
+
type ExtractParameterizedCodecOutputType<CodecId extends string, Params, CodecTypes extends Record<string, {
|
|
207
|
+
readonly output: unknown;
|
|
208
|
+
}>> = CodecId extends keyof CodecTypes ? CodecTypes[CodecId] extends {
|
|
209
|
+
readonly parameterizedOutput: infer Fn;
|
|
210
|
+
} ? Fn extends (params: Params) => infer Out ? Out : never : never : never;
|
|
155
211
|
/**
|
|
156
212
|
* Type-level operation signature.
|
|
157
213
|
* Represents an operation at the type level, similar to OperationSignature at runtime.
|
|
@@ -255,11 +311,11 @@ type ColumnMetaTypeId<ColumnMeta> = ColumnMeta extends {
|
|
|
255
311
|
} ? CodecId : ColumnMeta extends {
|
|
256
312
|
type: infer TypeId extends string;
|
|
257
313
|
} ? TypeId : never;
|
|
258
|
-
export type ComputeColumnJsType<
|
|
314
|
+
export type ComputeColumnJsType<Contract extends SqlContract<SqlStorage>, TableName extends string, ColumnName extends string, ColumnMeta extends StorageColumn, CodecTypes extends Record<string, {
|
|
259
315
|
readonly output: unknown;
|
|
260
|
-
}>> = ColumnMeta extends {
|
|
316
|
+
}>> = ExtractColumnJsTypeFromModels<Contract, TableName, ColumnName> extends infer FromModels ? [FromModels] extends [never] ? ColumnMeta extends {
|
|
261
317
|
nullable: infer Nullable;
|
|
262
|
-
} ? ColumnMetaTypeId<ColumnMeta> extends infer TypeId ? TypeId extends string ? ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput ? [CodecOutput] extends [never] ? unknown : Nullable extends true ? CodecOutput | null : CodecOutput : unknown : unknown : unknown : unknown;
|
|
318
|
+
} ? ColumnMetaTypeId<ColumnMeta> extends infer TypeId ? TypeId extends string ? ResolveColumnTypeParams<Contract, ColumnMeta> extends infer Params ? Params extends object ? ExtractParameterizedCodecOutputType<TypeId, Params, CodecTypes> extends infer ParamOutput ? [ParamOutput] extends [never] ? ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput ? [CodecOutput] extends [never] ? unknown : Nullable extends true ? CodecOutput | null : CodecOutput : unknown : Nullable extends true ? ParamOutput | null : ParamOutput : unknown : ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput ? [CodecOutput] extends [never] ? unknown : Nullable extends true ? CodecOutput | null : CodecOutput : unknown : unknown : unknown : unknown : unknown : FromModels : unknown;
|
|
263
319
|
/**
|
|
264
320
|
* Infers Row type from a projection object.
|
|
265
321
|
* Maps Record<string, ColumnBuilder> to Record<string, JSType>
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,cAAc,EAC5B,aAAa,EACb,QAAQ,EACT,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,E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C,GAAG,WAAW,CAAC,UAAU,CAAC;IAEnE,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-relational-core",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "Schema and column builders, operation attachment, and AST types for Prisma Next",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"ts-toolbelt": "^9.6.0",
|
|
9
|
-
"@prisma-next/operations": "0.3.0-dev.
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/
|
|
12
|
-
"@prisma-next/
|
|
13
|
-
"@prisma-next/contract": "0.3.0-dev.
|
|
9
|
+
"@prisma-next/operations": "0.3.0-dev.33",
|
|
10
|
+
"@prisma-next/plan": "0.3.0-dev.33",
|
|
11
|
+
"@prisma-next/contract": "0.3.0-dev.33",
|
|
12
|
+
"@prisma-next/sql-operations": "0.3.0-dev.33",
|
|
13
|
+
"@prisma-next/sql-contract": "0.3.0-dev.33"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"tsup": "8.5.1",
|
|
17
17
|
"typescript": "5.9.3",
|
|
18
18
|
"vitest": "4.0.16",
|
|
19
|
+
"@prisma-next/sql-contract-ts": "0.3.0-dev.33",
|
|
19
20
|
"@prisma-next/test-utils": "0.0.1",
|
|
20
|
-
"@prisma-next/sql-contract-ts": "0.3.0-dev.32",
|
|
21
21
|
"@prisma-next/tsconfig": "0.0.0"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
package/src/types.ts
CHANGED
|
@@ -261,6 +261,136 @@ type ExtractCodecOutputType<
|
|
|
261
261
|
: never
|
|
262
262
|
: never;
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Extracts the model name for a given table from the contract mappings.
|
|
266
|
+
*/
|
|
267
|
+
type ExtractTableToModel<
|
|
268
|
+
Contract extends SqlContract<SqlStorage>,
|
|
269
|
+
TableName extends string,
|
|
270
|
+
> = Contract['mappings'] extends {
|
|
271
|
+
readonly tableToModel: infer TableToModel;
|
|
272
|
+
}
|
|
273
|
+
? TableToModel extends Record<string, string>
|
|
274
|
+
? TableName extends keyof TableToModel
|
|
275
|
+
? TableToModel[TableName]
|
|
276
|
+
: never
|
|
277
|
+
: never
|
|
278
|
+
: never;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Extracts the field name for a given table column from the contract mappings.
|
|
282
|
+
*/
|
|
283
|
+
type ExtractColumnToField<
|
|
284
|
+
Contract extends SqlContract<SqlStorage>,
|
|
285
|
+
TableName extends string,
|
|
286
|
+
ColumnName extends string,
|
|
287
|
+
> = Contract['mappings'] extends {
|
|
288
|
+
readonly columnToField: infer ColumnToField;
|
|
289
|
+
}
|
|
290
|
+
? ColumnToField extends Record<string, Record<string, string>>
|
|
291
|
+
? TableName extends keyof ColumnToField
|
|
292
|
+
? ColumnName extends keyof ColumnToField[TableName]
|
|
293
|
+
? ColumnToField[TableName][ColumnName]
|
|
294
|
+
: never
|
|
295
|
+
: never
|
|
296
|
+
: never
|
|
297
|
+
: never;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Extracts the field value type from a model's fields.
|
|
301
|
+
*/
|
|
302
|
+
type ExtractFieldValue<
|
|
303
|
+
Contract extends SqlContract<SqlStorage>,
|
|
304
|
+
ModelName extends string,
|
|
305
|
+
FieldName extends string,
|
|
306
|
+
> = Contract['models'] extends infer Models
|
|
307
|
+
? Models extends Record<string, unknown>
|
|
308
|
+
? ModelName extends keyof Models
|
|
309
|
+
? Models[ModelName] extends { readonly fields: infer Fields }
|
|
310
|
+
? Fields extends Record<string, unknown>
|
|
311
|
+
? FieldName extends keyof Fields
|
|
312
|
+
? Fields[FieldName]
|
|
313
|
+
: never
|
|
314
|
+
: never
|
|
315
|
+
: never
|
|
316
|
+
: never
|
|
317
|
+
: never
|
|
318
|
+
: never;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Extracts the JavaScript type for a column from model mappings if available.
|
|
322
|
+
* Returns `never` if the column maps to a ModelField object (which indicates
|
|
323
|
+
* a relation that should fall through to codec-based type resolution).
|
|
324
|
+
*
|
|
325
|
+
* The check for ModelField uses `Exclude<keyof FieldValue, 'column'> extends never`
|
|
326
|
+
* to ensure we only skip pure `{ column: string }` marker objects, not richer
|
|
327
|
+
* object types that happen to include a `column` property.
|
|
328
|
+
*/
|
|
329
|
+
type ExtractColumnJsTypeFromModels<
|
|
330
|
+
Contract extends SqlContract<SqlStorage>,
|
|
331
|
+
TableName extends string,
|
|
332
|
+
ColumnName extends string,
|
|
333
|
+
> = ExtractTableToModel<Contract, TableName> extends infer ModelName
|
|
334
|
+
? ModelName extends string
|
|
335
|
+
? ExtractColumnToField<Contract, TableName, ColumnName> extends infer FieldName
|
|
336
|
+
? FieldName extends string
|
|
337
|
+
? ExtractFieldValue<Contract, ModelName, FieldName> extends infer FieldValue
|
|
338
|
+
? FieldValue extends { readonly column: string }
|
|
339
|
+
? Exclude<keyof FieldValue, 'column'> extends never
|
|
340
|
+
? never
|
|
341
|
+
: FieldValue
|
|
342
|
+
: FieldValue
|
|
343
|
+
: never
|
|
344
|
+
: never
|
|
345
|
+
: never
|
|
346
|
+
: never
|
|
347
|
+
: never;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Resolves type params for a column from either:
|
|
351
|
+
* - inline `columnMeta.typeParams`, or
|
|
352
|
+
* - `columnMeta.typeRef` (resolving into `contract.storage.types[typeRef].typeParams`).
|
|
353
|
+
*/
|
|
354
|
+
type ResolveColumnTypeParams<
|
|
355
|
+
Contract extends SqlContract<SqlStorage>,
|
|
356
|
+
ColumnMeta extends StorageColumn,
|
|
357
|
+
> = ColumnMeta extends { typeParams: infer Params }
|
|
358
|
+
? Params extends object
|
|
359
|
+
? Params
|
|
360
|
+
: undefined
|
|
361
|
+
: ColumnMeta extends { typeRef: infer TypeRef extends string }
|
|
362
|
+
? Contract['storage'] extends { types: infer Types }
|
|
363
|
+
? Types extends Record<string, unknown>
|
|
364
|
+
? TypeRef extends keyof Types
|
|
365
|
+
? Types[TypeRef] extends { typeParams: infer Params }
|
|
366
|
+
? Params extends object
|
|
367
|
+
? Params
|
|
368
|
+
: undefined
|
|
369
|
+
: undefined
|
|
370
|
+
: undefined
|
|
371
|
+
: undefined
|
|
372
|
+
: undefined
|
|
373
|
+
: undefined;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* If a codec entry exposes a type-level parameterized output surface, compute the output type
|
|
377
|
+
* for a specific params object. Falls back to `never` if not supported.
|
|
378
|
+
*
|
|
379
|
+
* This enables lane typing to incorporate `columnMeta.typeParams` without branching on codec IDs
|
|
380
|
+
* in core lane code.
|
|
381
|
+
*/
|
|
382
|
+
type ExtractParameterizedCodecOutputType<
|
|
383
|
+
CodecId extends string,
|
|
384
|
+
Params,
|
|
385
|
+
CodecTypes extends Record<string, { readonly output: unknown }>,
|
|
386
|
+
> = CodecId extends keyof CodecTypes
|
|
387
|
+
? CodecTypes[CodecId] extends { readonly parameterizedOutput: infer Fn }
|
|
388
|
+
? Fn extends (params: Params) => infer Out
|
|
389
|
+
? Out
|
|
390
|
+
: never
|
|
391
|
+
: never
|
|
392
|
+
: never;
|
|
393
|
+
|
|
264
394
|
/**
|
|
265
395
|
* Type-level operation signature.
|
|
266
396
|
* Represents an operation at the type level, similar to OperationSignature at runtime.
|
|
@@ -402,23 +532,47 @@ type ColumnMetaTypeId<ColumnMeta> = ColumnMeta extends { codecId: infer CodecId
|
|
|
402
532
|
: never;
|
|
403
533
|
|
|
404
534
|
export type ComputeColumnJsType<
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
535
|
+
Contract extends SqlContract<SqlStorage>,
|
|
536
|
+
TableName extends string,
|
|
537
|
+
ColumnName extends string,
|
|
408
538
|
ColumnMeta extends StorageColumn,
|
|
409
539
|
CodecTypes extends Record<string, { readonly output: unknown }>,
|
|
410
|
-
> =
|
|
411
|
-
?
|
|
412
|
-
?
|
|
413
|
-
?
|
|
414
|
-
?
|
|
415
|
-
?
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
540
|
+
> = ExtractColumnJsTypeFromModels<Contract, TableName, ColumnName> extends infer FromModels
|
|
541
|
+
? [FromModels] extends [never]
|
|
542
|
+
? ColumnMeta extends { nullable: infer Nullable }
|
|
543
|
+
? ColumnMetaTypeId<ColumnMeta> extends infer TypeId
|
|
544
|
+
? TypeId extends string
|
|
545
|
+
? ResolveColumnTypeParams<Contract, ColumnMeta> extends infer Params
|
|
546
|
+
? Params extends object
|
|
547
|
+
? ExtractParameterizedCodecOutputType<
|
|
548
|
+
TypeId,
|
|
549
|
+
Params,
|
|
550
|
+
CodecTypes
|
|
551
|
+
> extends infer ParamOutput
|
|
552
|
+
? [ParamOutput] extends [never]
|
|
553
|
+
? ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput
|
|
554
|
+
? [CodecOutput] extends [never]
|
|
555
|
+
? unknown // Codec not found in CodecTypes
|
|
556
|
+
: Nullable extends true
|
|
557
|
+
? CodecOutput | null
|
|
558
|
+
: CodecOutput
|
|
559
|
+
: unknown
|
|
560
|
+
: Nullable extends true
|
|
561
|
+
? ParamOutput | null
|
|
562
|
+
: ParamOutput
|
|
563
|
+
: unknown
|
|
564
|
+
: ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput
|
|
565
|
+
? [CodecOutput] extends [never]
|
|
566
|
+
? unknown // Codec not found in CodecTypes
|
|
567
|
+
: Nullable extends true
|
|
568
|
+
? CodecOutput | null
|
|
569
|
+
: CodecOutput
|
|
570
|
+
: unknown
|
|
571
|
+
: unknown
|
|
572
|
+
: unknown
|
|
419
573
|
: unknown
|
|
420
574
|
: unknown
|
|
421
|
-
:
|
|
575
|
+
: FromModels
|
|
422
576
|
: unknown;
|
|
423
577
|
|
|
424
578
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n ResultType as CoreResultType,\n ExecutionPlan,\n PlanRefs,\n} from '@prisma-next/contract/types';\nimport type { ArgSpec, ReturnSpec } from '@prisma-next/operations';\nimport type { SqlContract, SqlStorage, StorageColumn } from '@prisma-next/sql-contract/types';\nimport type { SqlLoweringSpec } from '@prisma-next/sql-operations';\nimport type {\n BinaryOp,\n ColumnRef,\n Direction,\n Expression,\n ExpressionSource,\n OperationExpr,\n ParamRef,\n QueryAst,\n} from './ast/types';\nimport type { SqlQueryPlan } from './plan';\nimport type { QueryLaneContext } from './query-lane-context';\n\nexport interface ParamPlaceholder {\n readonly kind: 'param-placeholder';\n readonly name: string;\n}\n\n/**\n * ValueSource represents any value that can appear in a comparison or as an argument.\n * This includes:\n * - ParamPlaceholder: A parameter placeholder (e.g., `param('userId')`)\n * - ExpressionSource: Something that can be converted to an Expression (ColumnBuilder, ExpressionBuilder)\n */\nexport type ValueSource = ParamPlaceholder | ExpressionSource;\n\nexport interface OrderBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'order';\n readonly expr: Expression;\n readonly dir: Direction;\n}\n\n/**\n * Creates an OrderBuilder for use in orderBy clauses.\n */\nexport function createOrderBuilder(\n expr: AnyColumnBuilder | OperationExpr,\n dir: Direction,\n): AnyOrderBuilder {\n return { kind: 'order', expr, dir } as AnyOrderBuilder;\n}\n\n/**\n * ColumnBuilder with optional operation methods based on the column's typeId.\n * When Operations is provided and the column's typeId matches, operation methods are included.\n * Implements ExpressionSource to provide type-safe conversion to ColumnRef.\n *\n * For nullable columns (ColumnMeta['nullable'] extends true), includes isNull() and isNotNull() methods.\n */\nexport type ColumnBuilder<\n ColumnName extends string = string,\n ColumnMeta extends StorageColumn = StorageColumn,\n JsType = unknown,\n Operations extends OperationTypes = Record<string, never>,\n> = {\n readonly kind: 'column';\n readonly table: string;\n readonly column: ColumnName;\n readonly columnMeta: ColumnMeta;\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n neq(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n gt(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n lt(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n gte(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n lte(value: ValueSource): BinaryBuilder<ColumnName, ColumnMeta, JsType>;\n asc(): OrderBuilder<ColumnName, ColumnMeta, JsType>;\n desc(): OrderBuilder<ColumnName, ColumnMeta, JsType>;\n /** Converts this column builder to a ColumnRef expression */\n toExpr(): ColumnRef;\n // Helper property for type extraction (not used at runtime)\n readonly __jsType: JsType;\n} & (ColumnMeta['codecId'] extends string\n ? ColumnMeta['codecId'] extends keyof Operations\n ? OperationMethods<\n OperationsForTypeId<ColumnMeta['codecId'] & string, Operations>,\n ColumnName,\n StorageColumn,\n JsType\n >\n : Record<string, never>\n : Record<string, never>) &\n (ColumnMeta['nullable'] extends true\n ? NullableMethods<ColumnName, ColumnMeta, JsType>\n : Record<string, never>);\n\nexport interface BinaryBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'binary';\n readonly op: BinaryOp;\n readonly left: Expression;\n readonly right: ValueSource;\n}\n\n/**\n * Builder for IS NULL / IS NOT NULL checks.\n * Used to build unary null check expressions in WHERE clauses.\n */\nexport interface NullCheckBuilder<\n _ColumnName extends string = string,\n _ColumnMeta extends StorageColumn = StorageColumn,\n _JsType = unknown,\n> {\n readonly kind: 'nullCheck';\n readonly expr: Expression;\n readonly isNull: boolean;\n}\n\n/**\n * Union type for unary builders (currently just NullCheckBuilder).\n * Extensible for future unary operators.\n */\nexport type UnaryBuilder = NullCheckBuilder;\n\n// Forward declare AnyBinaryBuilder and AnyOrderBuilder for use in ExpressionBuilder\nexport type AnyBinaryBuilder = BinaryBuilder;\nexport type AnyOrderBuilder = OrderBuilder;\nexport type AnyUnaryBuilder = UnaryBuilder;\n\n/**\n * Methods available only on nullable columns.\n * These are conditionally added to ColumnBuilder when ColumnMeta['nullable'] is true.\n * Note: Index signature is required for compatibility with AnyColumnBuilderBase's index signature.\n */\nexport interface NullableMethods<\n ColumnName extends string = string,\n ColumnMeta extends StorageColumn = StorageColumn,\n JsType = unknown,\n> {\n /** Creates an IS NULL check for this column */\n isNull(): NullCheckBuilder<ColumnName, ColumnMeta, JsType>;\n /** Creates an IS NOT NULL check for this column */\n isNotNull(): NullCheckBuilder<ColumnName, ColumnMeta, JsType>;\n /** Index signature for compatibility with AnyColumnBuilderBase */\n readonly [key: string]: unknown;\n}\n\n/**\n * ExpressionBuilder represents the result of an operation (e.g., col.distance(...)).\n * Unlike ColumnBuilder (which represents a column), ExpressionBuilder represents\n * an operation expression and provides the same DSL methods for chaining.\n *\n * Implements ExpressionSource to provide type-safe conversion to OperationExpr.\n */\nexport interface ExpressionBuilder<JsType = unknown> extends ExpressionSource {\n readonly kind: 'expression';\n readonly expr: OperationExpr;\n readonly columnMeta: StorageColumn;\n\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): AnyBinaryBuilder;\n neq(value: ValueSource): AnyBinaryBuilder;\n gt(value: ValueSource): AnyBinaryBuilder;\n lt(value: ValueSource): AnyBinaryBuilder;\n gte(value: ValueSource): AnyBinaryBuilder;\n lte(value: ValueSource): AnyBinaryBuilder;\n asc(): AnyOrderBuilder;\n desc(): AnyOrderBuilder;\n\n /** Converts this expression builder to the underlying OperationExpr */\n toExpr(): OperationExpr;\n\n // Helper property for type extraction (not used at runtime)\n readonly __jsType: JsType;\n}\n\n// Helper aliases for usage sites where the specific column parameters are irrelevant\n// Accepts any ColumnBuilder regardless of its Operations parameter\n// Note: We use `any` here because TypeScript's variance rules don't allow us to express\n// \"any type that extends OperationTypes\" in a way that works for assignment.\n// Contract-specific OperationTypes (e.g., PgVectorOperationTypes) are not assignable\n// to the base OperationTypes in generic parameter position, even though they extend it structurally.\n// Helper type that accepts any ColumnBuilder regardless of its generic parameters\n// This is needed because conditional types in ColumnBuilder create incompatible intersection types\n// when Operations differs, even though structurally they're compatible\nexport type AnyColumnBuilderBase = {\n readonly kind: 'column';\n readonly table: string;\n readonly column: string;\n readonly columnMeta: StorageColumn;\n // Methods accept ValueSource (ParamPlaceholder or ExpressionSource)\n eq(value: ValueSource): AnyBinaryBuilder;\n neq(value: ValueSource): AnyBinaryBuilder;\n gt(value: ValueSource): AnyBinaryBuilder;\n lt(value: ValueSource): AnyBinaryBuilder;\n gte(value: ValueSource): AnyBinaryBuilder;\n lte(value: ValueSource): AnyBinaryBuilder;\n asc(): AnyOrderBuilder;\n desc(): AnyOrderBuilder;\n toExpr(): ColumnRef;\n readonly __jsType: unknown;\n // Optional nullable methods (present when columnMeta.nullable is true)\n isNull?(): AnyUnaryBuilder;\n isNotNull?(): AnyUnaryBuilder;\n // Allow any operation methods (from conditional type)\n readonly [key: string]: unknown;\n};\n\nexport type AnyColumnBuilder =\n | ColumnBuilder<\n string,\n StorageColumn,\n unknown,\n // biome-ignore lint/suspicious/noExplicitAny: AnyColumnBuilder must accept column builders with any operation types\n any\n >\n | AnyColumnBuilderBase;\n\n/**\n * Union type for any builder that can produce an Expression.\n * Used in DSL method signatures where either a column or operation result can be passed.\n */\nexport type AnyExpressionSource = AnyColumnBuilder | ExpressionBuilder;\n\nexport function isColumnBuilder(value: unknown): value is AnyColumnBuilder {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'kind' in value &&\n (value as { kind: unknown }).kind === 'column'\n );\n}\n\nexport interface JoinOnBuilder {\n eqCol(left: AnyColumnBuilder, right: AnyColumnBuilder): JoinOnPredicate;\n}\n\nexport interface JoinOnPredicate {\n readonly kind: 'join-on';\n readonly left: AnyColumnBuilder;\n readonly right: AnyColumnBuilder;\n}\n\nexport type Expr = ColumnRef | ParamRef;\n\n/**\n * Helper type to extract codec output type from CodecTypes.\n * Returns never if the codecId is not found in CodecTypes.\n */\ntype ExtractCodecOutputType<\n CodecId extends string,\n CodecTypes extends Record<string, { readonly output: unknown }>,\n> = CodecId extends keyof CodecTypes\n ? CodecTypes[CodecId] extends { readonly output: infer Output }\n ? Output\n : never\n : never;\n\n/**\n * Type-level operation signature.\n * Represents an operation at the type level, similar to OperationSignature at runtime.\n */\nexport type OperationTypeSignature = {\n readonly args: ReadonlyArray<ArgSpec>;\n readonly returns: ReturnSpec;\n readonly lowering: SqlLoweringSpec;\n readonly capabilities?: ReadonlyArray<string>;\n};\n\n/**\n * Type-level operation registry.\n * Maps typeId → operations, where operations is a record of method name → operation signature.\n *\n * Example:\n * ```typescript\n * type MyOperations: OperationTypes = {\n * 'pg/vector@1': {\n * cosineDistance: {\n * args: [{ kind: 'typeId'; type: 'pg/vector@1' }];\n * returns: { kind: 'builtin'; type: 'number' };\n * lowering: { targetFamily: 'sql'; strategy: 'function'; template: '...' };\n * };\n * };\n * };\n * ```\n */\nexport type OperationTypes = Record<string, Record<string, OperationTypeSignature>>;\n\n/**\n * CodecTypes represents a map of typeId to codec definitions.\n * Each codec definition must have an `output` property indicating the JavaScript type.\n *\n * Example:\n * ```typescript\n * type MyCodecTypes: CodecTypes = {\n * 'pg/int4@1': { output: number };\n * 'pg/text@1': { output: string };\n * };\n * ```\n */\nexport type CodecTypes = Record<string, { readonly output: unknown }>;\n\n/**\n * Extracts operations for a given typeId from the operation registry.\n * Returns an empty record if the typeId is not found.\n *\n * @example\n * ```typescript\n * type Ops = OperationsForTypeId<'pg/vector@1', MyOperations>;\n * // Ops = { cosineDistance: { ... }, l2Distance: { ... } }\n * ```\n */\nexport type OperationsForTypeId<\n TypeId extends string,\n Operations extends OperationTypes,\n> = Operations extends Record<string, never>\n ? Record<string, never>\n : TypeId extends keyof Operations\n ? Operations[TypeId]\n : Record<string, never>;\n\n/**\n * Maps operation signatures to method signatures on ColumnBuilder.\n * Each operation becomes a method that returns a ColumnBuilder or BinaryBuilder\n * based on the return type.\n */\ntype OperationMethods<\n Ops extends Record<string, OperationTypeSignature>,\n ColumnName extends string,\n ColumnMeta extends StorageColumn,\n JsType,\n> = {\n [K in keyof Ops]: Ops[K] extends OperationTypeSignature\n ? (\n ...args: OperationArgs<Ops[K]['args']>\n ) => OperationReturn<Ops[K]['returns'], ColumnName, ColumnMeta, JsType>\n : never;\n};\n\n/**\n * Maps operation argument specs to TypeScript argument types.\n * - typeId args: ColumnBuilder (accepts base columns or operation results)\n * - param args: ParamPlaceholder\n * - literal args: unknown (could be more specific in future)\n */\ntype OperationArgs<Args extends ReadonlyArray<ArgSpec>> = Args extends readonly [\n infer First,\n ...infer Rest,\n]\n ? First extends ArgSpec\n ? [ArgToType<First>, ...(Rest extends ReadonlyArray<ArgSpec> ? OperationArgs<Rest> : [])]\n : []\n : [];\n\ntype ArgToType<Arg extends ArgSpec> = Arg extends { kind: 'typeId' }\n ? AnyExpressionSource\n : Arg extends { kind: 'param' }\n ? ParamPlaceholder\n : Arg extends { kind: 'literal' }\n ? unknown\n : never;\n\n/**\n * Maps operation return spec to return type.\n * Operations return ExpressionBuilder, not ColumnBuilder, because the result\n * represents an expression (OperationExpr) rather than a column reference.\n */\ntype OperationReturn<\n Returns extends ReturnSpec,\n _ColumnName extends string,\n _ColumnMeta extends StorageColumn,\n _JsType,\n> = Returns extends { kind: 'builtin'; type: infer T }\n ? T extends 'number'\n ? ExpressionBuilder<number>\n : T extends 'boolean'\n ? ExpressionBuilder<boolean>\n : T extends 'string'\n ? ExpressionBuilder<string>\n : ExpressionBuilder<unknown>\n : Returns extends { kind: 'typeId' }\n ? ExpressionBuilder<unknown>\n : ExpressionBuilder<unknown>;\n\n/**\n * Computes JavaScript type for a column at column creation time.\n *\n * Type inference:\n * - Read columnMeta.codecId as typeId string literal\n * - Look up CodecTypes[typeId].output\n * - Apply nullability: nullable ? Output | null : Output\n */\ntype ColumnMetaTypeId<ColumnMeta> = ColumnMeta extends { codecId: infer CodecId extends string }\n ? CodecId\n : ColumnMeta extends { type: infer TypeId extends string }\n ? TypeId\n : never;\n\nexport type ComputeColumnJsType<\n _Contract extends SqlContract<SqlStorage>,\n _TableName extends string,\n _ColumnName extends string,\n ColumnMeta extends StorageColumn,\n CodecTypes extends Record<string, { readonly output: unknown }>,\n> = ColumnMeta extends { nullable: infer Nullable }\n ? ColumnMetaTypeId<ColumnMeta> extends infer TypeId\n ? TypeId extends string\n ? ExtractCodecOutputType<TypeId, CodecTypes> extends infer CodecOutput\n ? [CodecOutput] extends [never]\n ? unknown // Codec not found in CodecTypes\n : Nullable extends true\n ? CodecOutput | null\n : CodecOutput\n : unknown\n : unknown\n : unknown\n : unknown;\n\n/**\n * Infers Row type from a projection object.\n * Maps Record<string, ColumnBuilder> to Record<string, JSType>\n *\n * Extracts the pre-computed JsType from each ColumnBuilder in the projection.\n */\n/**\n * Extracts the inferred JsType carried by a ColumnBuilder.\n */\ntype ExtractJsTypeFromColumnBuilder<CB extends AnyColumnBuilder> =\n CB extends ColumnBuilder<\n infer _ColumnName extends string,\n infer _ColumnMeta extends StorageColumn,\n infer JsType,\n infer _Ops\n >\n ? JsType\n : never;\n\nexport type InferProjectionRow<P extends Record<string, AnyColumnBuilder>> = {\n [K in keyof P]: ExtractJsTypeFromColumnBuilder<P[K]>;\n};\n\n/**\n * Nested projection type - allows recursive nesting of ColumnBuilder, ExpressionBuilder, or nested objects.\n */\nexport type NestedProjection = Record<\n string,\n | AnyExpressionSource\n | Record<\n string,\n | AnyExpressionSource\n | Record<\n string,\n | AnyExpressionSource\n | Record<string, AnyExpressionSource | Record<string, AnyExpressionSource>>\n >\n >\n>;\n\n/**\n * Helper type to extract include type from Includes map.\n * Returns the value type if K is a key of Includes, otherwise returns unknown.\n */\ntype ExtractIncludeType<\n K extends string,\n Includes extends Record<string, unknown>,\n> = K extends keyof Includes ? Includes[K] : unknown;\n\n/**\n * Infers Row type from a nested projection object.\n * Recursively maps Record<string, ColumnBuilder | boolean | NestedProjection> to nested object types.\n *\n * Extracts the pre-computed JsType from each ColumnBuilder at leaves.\n * When a value is `true`, it represents an include reference and infers `Array<ChildShape>`\n * by looking up the include alias in the Includes type map.\n */\nexport type InferNestedProjectionRow<\n P extends Record<string, AnyExpressionSource | boolean | NestedProjection>,\n CodecTypes extends Record<string, { readonly output: unknown }> = Record<string, never>,\n Includes extends Record<string, unknown> = Record<string, never>,\n> = {\n [K in keyof P]: P[K] extends ExpressionBuilder<infer JsType>\n ? JsType\n : P[K] extends AnyColumnBuilder\n ? ExtractJsTypeFromColumnBuilder<P[K]>\n : P[K] extends true\n ? Array<ExtractIncludeType<K & string, Includes>> // Include reference - infers Array<ChildShape> from Includes map\n : P[K] extends NestedProjection\n ? InferNestedProjectionRow<P[K], CodecTypes, Includes>\n : never;\n};\n\n/**\n * Infers Row type from a tuple of ColumnBuilders used in returning() clause.\n * Extracts column name and JsType from each ColumnBuilder and creates a Record.\n */\nexport type InferReturningRow<Columns extends readonly AnyColumnBuilder[]> =\n Columns extends readonly [infer First, ...infer Rest]\n ? First extends ColumnBuilder<\n infer Name,\n infer _Meta,\n infer JsType,\n infer _Ops extends OperationTypes\n >\n ? Name extends string\n ? Rest extends readonly AnyColumnBuilder[]\n ? { [K in Name]: JsType } & InferReturningRow<Rest>\n : { [K in Name]: JsType }\n : never\n : never\n : Record<string, never>;\n\n/**\n * Utility type to check if a contract has the required capabilities for includeMany.\n * Requires both `lateral` and `jsonAgg` to be `true` in the contract's capabilities for the target.\n * Capabilities are nested by target: `{ [target]: { lateral: true, jsonAgg: true } }`\n */\nexport type HasIncludeManyCapabilities<TContract extends SqlContract<SqlStorage>> =\n TContract extends { capabilities: infer C; target: infer T }\n ? T extends string\n ? C extends Record<string, Record<string, boolean>>\n ? C extends { [K in T]: infer TargetCaps }\n ? TargetCaps extends { lateral: true; jsonAgg: true }\n ? true\n : false\n : false\n : false\n : false\n : false;\n\n/**\n * SQL-specific Plan type that refines the ast field to use QueryAst.\n * This is the type used by SQL query builders.\n */\nexport type SqlPlan<Row = unknown> = ExecutionPlan<Row, QueryAst>;\n\n/**\n * Helper types for extracting contract structure.\n */\nexport type TablesOf<TContract> = TContract extends {\n storage: { tables: infer U };\n}\n ? U\n : never;\n\nexport type TableKey<TContract> = Extract<keyof TablesOf<TContract>, string>;\n\n// Common types for contract.d.ts generation (SQL-specific)\n// These types are used by emitted contract.d.ts files to provide type-safe DSL/ORM types\n\n/**\n * Unique symbol for metadata property to avoid collisions with user-defined properties\n */\nexport declare const META: unique symbol;\n\n/**\n * Extracts metadata from a type that has a META property\n */\nexport type Meta<T extends { [META]: unknown }> = T[typeof META];\n\n/**\n * Metadata interface for table definitions\n */\nexport interface TableMetadata<Name extends string> {\n name: Name;\n}\n\n/**\n * Metadata interface for model definitions\n */\nexport interface ModelMetadata<Name extends string> {\n name: Name;\n}\n\n/**\n * Base interface for table definitions with metadata\n * Used in contract.d.ts to define storage-level table types\n */\nexport interface TableDef<Name extends string> {\n readonly [META]: TableMetadata<Name>;\n}\n\n/**\n * Base interface for model definitions with metadata\n * Used in contract.d.ts to define application-level model types\n */\nexport interface ModelDef<Name extends string> {\n readonly [META]: ModelMetadata<Name>;\n}\n\nexport type ColumnsOf<\n TContract,\n K extends TableKey<TContract>,\n> = K extends keyof TablesOf<TContract>\n ? TablesOf<TContract>[K] extends { columns: infer C }\n ? C\n : never\n : never;\n\nexport interface RawTemplateOptions {\n readonly refs?: PlanRefs;\n readonly annotations?: Record<string, unknown>;\n readonly projection?: ReadonlyArray<string>;\n}\n\nexport interface RawFunctionOptions extends RawTemplateOptions {\n readonly params: ReadonlyArray<unknown>;\n}\n\nexport type RawTemplateFactory = (\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n) => ExecutionPlan;\n\nexport interface RawFactory extends RawTemplateFactory {\n (text: string, options: RawFunctionOptions): ExecutionPlan;\n with(options: RawTemplateOptions): RawTemplateFactory;\n}\n\nexport type { RuntimeError } from '@prisma-next/plan';\n\nexport interface BuildParamsMap {\n readonly [name: string]: unknown;\n}\n\nexport interface BuildOptions {\n readonly params?: BuildParamsMap;\n}\n\nexport interface SqlBuilderOptions<\n TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>,\n> {\n readonly context: QueryLaneContext<TContract>;\n}\n\n/**\n * SQL-specific ResultType that works with both Plan and SqlQueryPlan.\n * This extends the core ResultType to also handle SqlQueryPlan.\n * Example: `type Row = ResultType<typeof plan>`\n */\nexport type ResultType<P> = P extends SqlQueryPlan<infer R> ? R : CoreResultType<P>;\n"],"mappings":";AA+CO,SAAS,mBACd,MACA,KACiB;AACjB,SAAO,EAAE,MAAM,SAAS,MAAM,IAAI;AACpC;AAiLO,SAAS,gBAAgB,OAA2C;AACzE,SACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAA4B,SAAS;AAE1C;","names":[]}
|
|
File without changes
|