@prisma-next/sql-relational-core 0.16.0-dev.3 → 0.16.0-dev.31
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/{codec-types-C8vFGWij.d.mts → codec-types-Bayoa4PI.d.mts} +3 -2
- package/dist/codec-types-Bayoa4PI.d.mts.map +1 -0
- package/dist/{ddl-types-DzaZCtFT.d.mts → ddl-types-B3SfjPGI.d.mts} +3 -3
- package/dist/ddl-types-B3SfjPGI.d.mts.map +1 -0
- package/dist/{ddl-types-DFKQr_qQ.mjs → ddl-types-BUoa33yk.mjs} +3 -2
- package/dist/ddl-types-BUoa33yk.mjs.map +1 -0
- package/dist/exports/ast.d.mts +4 -4
- package/dist/exports/ast.d.mts.map +1 -1
- package/dist/exports/ast.mjs +82 -8
- package/dist/exports/ast.mjs.map +1 -1
- package/dist/exports/codec-descriptor-registry.d.mts +2 -2
- package/dist/exports/codec-descriptor-registry.d.mts.map +1 -1
- package/dist/exports/codec-descriptor-registry.mjs +2 -1
- package/dist/exports/codec-descriptor-registry.mjs.map +1 -1
- package/dist/exports/contract-free.d.mts +3 -3
- package/dist/exports/contract-free.d.mts.map +1 -1
- package/dist/exports/contract-free.mjs +4 -3
- package/dist/exports/contract-free.mjs.map +1 -1
- package/dist/exports/expression.d.mts +2 -2
- package/dist/exports/expression.mjs +1 -1
- package/dist/exports/middleware.d.mts +1 -1
- package/dist/exports/plan.d.mts +2 -2
- package/dist/exports/query-lane-context.d.mts +1 -1
- package/dist/exports/types.d.mts +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +4 -4
- package/dist/{middleware-CFDg6XOc.d.mts → middleware-_9-4TYKC.d.mts} +2 -2
- package/dist/{middleware-CFDg6XOc.d.mts.map → middleware-_9-4TYKC.d.mts.map} +1 -1
- package/dist/{plan-CBT55zev.d.mts → plan-Dq94efZJ.d.mts} +2 -2
- package/dist/{plan-CBT55zev.d.mts.map → plan-Dq94efZJ.d.mts.map} +1 -1
- package/dist/{query-lane-context-BNbbusGn.d.mts → query-lane-context-DTCOHMXn.d.mts} +2 -2
- package/dist/{query-lane-context-BNbbusGn.d.mts.map → query-lane-context-DTCOHMXn.d.mts.map} +1 -1
- package/dist/{sql-execution-plan-CPw3uKrJ.d.mts → sql-execution-plan-B-C-6cZN.d.mts} +2 -2
- package/dist/{sql-execution-plan-CPw3uKrJ.d.mts.map → sql-execution-plan-B-C-6cZN.d.mts.map} +1 -1
- package/dist/{types-DtzFztRV.mjs → types-CINOak-F.mjs} +164 -27
- package/dist/types-CINOak-F.mjs.map +1 -0
- package/dist/{types-BR266jxM.d.mts → types-CRV7uuOC.d.mts} +5 -5
- package/dist/{types-BR266jxM.d.mts.map → types-CRV7uuOC.d.mts.map} +1 -1
- package/dist/{types-Dr3jep6j.d.mts → types-CWlaErjN.d.mts} +97 -13
- package/dist/types-CWlaErjN.d.mts.map +1 -0
- package/package.json +11 -11
- package/src/ast/codec-types.ts +37 -0
- package/src/ast/ddl-types.ts +2 -1
- package/src/ast/json-value-projection.ts +100 -0
- package/src/ast/sql-codec-helpers.ts +20 -5
- package/src/ast/types.ts +235 -52
- package/src/codec-descriptor-registry.ts +4 -1
- package/src/contract-free/table.ts +5 -1
- package/src/exports/ast.ts +1 -0
- package/dist/codec-types-C8vFGWij.d.mts.map +0 -1
- package/dist/ddl-types-DFKQr_qQ.mjs.map +0 -1
- package/dist/ddl-types-DzaZCtFT.d.mts.map +0 -1
- package/dist/types-Dr3jep6j.d.mts.map +0 -1
- package/dist/types-DtzFztRV.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-free.mjs","names":[],"sources":["../../src/contract-free/column.ts","../../src/contract-free/table.ts"],"sourcesContent":["import type { ColumnDefaultLiteralInputValue } from '@prisma-next/contract/types';\nimport type { ReferentialAction } from '@prisma-next/sql-contract/types';\nimport type { CodecRef } from '../ast/codec-types';\nimport type { AnyDdlColumnDefault } from '../ast/ddl-types';\nimport {\n CheckExpressionConstraint,\n DdlColumn,\n ForeignKeyConstraint,\n FunctionColumnDefault,\n LiteralColumnDefault,\n PrimaryKeyConstraint,\n UniqueConstraint,\n} from '../ast/ddl-types';\n\nexport interface DdlColumnOptions {\n readonly notNull?: boolean;\n readonly primaryKey?: boolean;\n readonly default?: AnyDdlColumnDefault;\n readonly codecRef?: CodecRef;\n}\n\nexport function lit(value: ColumnDefaultLiteralInputValue): LiteralColumnDefault {\n return new LiteralColumnDefault(value);\n}\n\nexport function fn(expression: string): FunctionColumnDefault {\n return new FunctionColumnDefault(expression);\n}\n\nexport function col(name: string, type: string, options?: DdlColumnOptions): DdlColumn {\n return new DdlColumn({ name, type, ...options });\n}\n\nexport function primaryKey(\n columns: readonly string[],\n options?: { readonly name?: string },\n): PrimaryKeyConstraint {\n return new PrimaryKeyConstraint({ columns, ...options });\n}\n\nexport function foreignKey(\n columns: readonly string[],\n refTable: string,\n refColumns: readonly string[],\n options?: {\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n },\n): ForeignKeyConstraint {\n return new ForeignKeyConstraint({ columns, refTable, refColumns, ...options });\n}\n\nexport function unique(\n columns: readonly string[],\n options?: { readonly name?: string },\n): UniqueConstraint {\n return new UniqueConstraint({ columns, ...options });\n}\n\nexport function checkExpression(name: string, expression: string): CheckExpressionConstraint {\n return new CheckExpressionConstraint({ name, expression });\n}\n","import type { ParamSpec } from '@prisma-next/operations';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport {\n AggregateExpr,\n AndExpr,\n type AnyExpression,\n type AnyFromSource,\n BinaryExpr,\n ColumnRef,\n ExistsExpr,\n IdentifierRef,\n InsertAst,\n InsertOnConflict,\n type InsertValue,\n JoinAst,\n LiteralExpr,\n NullCheckExpr,\n OperationExpr,\n OrderByItem,\n OrExpr,\n ParamRef,\n ProjectionItem,\n RawExpr,\n SelectAst,\n TableSource,\n UpdateAst,\n} from '../ast/types';\n\nexport interface ColumnDescriptor {\n readonly codecId: string;\n readonly nullable: boolean;\n}\n\nexport type ColumnSchema = Record<string, ColumnDescriptor>;\n\n/**\n * A composable WHERE / ON expression. Wraps an `AnyExpression` and exposes\n * fluent boolean combinators, mirroring the spirit of `sql-builder`'s\n * `Expression` interface without the contract-bound type machinery.\n */\nexport class CfExpr {\n constructor(readonly ast: AnyExpression) {}\n\n and(other: CfExpr): CfExpr {\n return new CfExpr(AndExpr.of([this.ast, other.ast]));\n }\n\n or(other: CfExpr): CfExpr {\n return new CfExpr(OrExpr.of([this.ast, other.ast]));\n }\n\n not(): CfExpr {\n return new CfExpr(this.ast.not());\n }\n\n isNull(): CfExpr {\n return new CfExpr(NullCheckExpr.isNull(this.ast));\n }\n\n isNotNull(): CfExpr {\n return new CfExpr(NullCheckExpr.isNotNull(this.ast));\n }\n\n eqLit(value: number | string | boolean): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, LiteralExpr.of(value)));\n }\n\n gtLit(value: number | string | boolean): CfExpr {\n return new CfExpr(BinaryExpr.gt(this.ast, LiteralExpr.of(value)));\n }\n\n eqParam(value: unknown, codecId: string): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, ParamRef.of(value, { codec: { codecId } })));\n }\n\n eqExpr(other: CfExpr): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, other.ast));\n }\n}\n\nexport interface CfFnOptions {\n readonly method: string;\n readonly template: string;\n readonly self: CfExpr;\n readonly args?: ReadonlyArray<CfExpr>;\n readonly returns: ParamSpec;\n}\n\nexport const cfExpr = {\n countStar(): CfExpr {\n return new CfExpr(AggregateExpr.count());\n },\n lit(value: number | string | boolean): CfExpr {\n return new CfExpr(LiteralExpr.of(value));\n },\n identifierRef(name: string): CfExpr {\n return new CfExpr(IdentifierRef.of(name));\n },\n param(value: unknown, codecId: string): CfExpr {\n return new CfExpr(ParamRef.of(value, { codec: { codecId } }));\n },\n /**\n * Catalog function call lowered via a `'function'`-strategy template\n * (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so\n * target packages only supply vocabulary: template, codec'd operands,\n * and return spec.\n */\n fn(options: CfFnOptions): CfExpr {\n return new CfExpr(\n new OperationExpr({\n method: options.method,\n self: options.self.ast,\n args: options.args?.map((arg) => arg.ast),\n returns: options.returns,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: options.template,\n },\n }),\n );\n },\n columnRef(qualifier: string, name: string): CfExpr {\n return new CfExpr(ColumnRef.of(qualifier, name));\n },\n allOf(exprs: ReadonlyArray<CfExpr>): CfExpr {\n return new CfExpr(AndExpr.of(exprs.map((expr) => expr.ast)));\n },\n /**\n * Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a\n * `RawExpr`. For zero-operand catalog functions where a `'function'`\n * lowering template has nothing to substitute.\n */\n raw(sql: string, returns: ParamSpec): CfExpr {\n return new CfExpr(new RawExpr({ parts: [sql], returns }));\n },\n exists(query: CfExprSelectQuery): CfExpr {\n return new CfExpr(ExistsExpr.exists(query.build()));\n },\n notExists(query: CfExprSelectQuery): CfExpr {\n return new CfExpr(ExistsExpr.notExists(query.build()));\n },\n};\n\n/** Aliased table source for catalog queries (no namespace coordinate). */\nexport function cfTable(name: string, alias?: string): TableSource {\n return TableSource.named(name, alias);\n}\n\nexport class CfExprSelectQuery {\n constructor(\n private readonly src: AnyFromSource | undefined,\n private readonly projectionItems: ReadonlyArray<ProjectionItem>,\n private readonly whereExpr: CfExpr | undefined,\n private readonly joinItems: ReadonlyArray<JoinAst> = [],\n private readonly limitValue: number | undefined = undefined,\n ) {}\n\n from(source: AnyFromSource): CfExprSelectQuery {\n return new CfExprSelectQuery(\n source,\n this.projectionItems,\n this.whereExpr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n join(source: AnyFromSource, on: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n [...this.joinItems, JoinAst.inner(source, on.ast)],\n this.limitValue,\n );\n }\n\n leftJoin(source: AnyFromSource, on: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n [...this.joinItems, JoinAst.left(source, on.ast)],\n this.limitValue,\n );\n }\n\n project(alias: string, expr: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n [...this.projectionItems, ProjectionItem.of(alias, expr.ast)],\n this.whereExpr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n where(expr: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n expr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n limit(value: number): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n this.joinItems,\n value,\n );\n }\n\n build(): SelectAst {\n if (this.joinItems.length > 0 && this.src === undefined) {\n throw new Error('CfExprSelectQuery: cannot add a JOIN without a FROM clause');\n }\n const base =\n this.src !== undefined\n ? SelectAst.from(this.src).withProjection(this.projectionItems)\n : SelectAst.noFrom().withProjection(this.projectionItems);\n const withJoins = this.joinItems.length > 0 ? base.withJoins(this.joinItems) : base;\n const withWhere =\n this.whereExpr !== undefined ? withJoins.withWhere(this.whereExpr.ast) : withJoins;\n return this.limitValue !== undefined ? withWhere.withLimit(this.limitValue) : withWhere;\n }\n}\n\nexport function exprSelect(): CfExprSelectQuery {\n return new CfExprSelectQuery(undefined, [], undefined);\n}\n\n/**\n * Per-column authoring handle exposed as a keyed property on a {@link TableHandle}.\n * Carries codec metadata baked at declaration time so no codec ID, table name, or\n * column name needs to be repeated at the call site.\n */\nexport interface ColumnProxy {\n readonly codecId: string;\n readonly nullable: boolean;\n readonly columnName: string;\n readonly tableName: string;\n eq(value: unknown): CfExpr;\n neq(value: unknown): CfExpr;\n isNull(): CfExpr;\n isNotNull(): CfExpr;\n toRef(): ColumnRef;\n toProjectionItem(alias?: string): ProjectionItem;\n}\n\n/**\n * Object passed to the {@link CfConflictClause.doUpdate} callback. Each key\n * resolves to a `ColumnRef` for the corresponding `excluded.<column>`, so the\n * upsert conflict-update branch can copy proposed values without re-binding\n * parameters.\n */\nexport type ExcludedProxy<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]: ColumnRef;\n};\n\nexport type TableInsertRow<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]: unknown;\n};\n\nexport type TableSetValues<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]?: unknown;\n};\n\n/**\n * Fluent authoring handle for a fixed control-plane table. Column proxies are\n * exposed as keyed properties so `handle.columnName.eq(value)` composes without\n * threading codec IDs, table names, or column refs at the call site.\n */\nexport type TableHandle<Schema extends ColumnSchema> = {\n readonly source: TableSource;\n insert(row: TableInsertRow<Schema>): CfInsertQuery<Schema>;\n upsert(row: TableInsertRow<Schema>): CfUpsertBuilder<Schema>;\n update(): CfUpdateQuery<Schema>;\n select(...columns: ReadonlyArray<ColumnProxy>): CfSelectQuery;\n} & {\n readonly [K in keyof Schema]: ColumnProxy;\n};\n\nexport class CfInsertQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly returningItems: ReadonlyArray<ProjectionItem> | undefined = undefined,\n ) {}\n\n returning(...columns: ReadonlyArray<ColumnProxy>): CfInsertQuery<Schema> {\n return new CfInsertQuery(\n this.src,\n this.schema,\n this.rowValues,\n columns.map((col) => col.toProjectionItem()),\n );\n }\n\n build(): InsertAst {\n const row = buildInsertRow(this.schema, this.rowValues);\n const ast = InsertAst.into(this.src).withRows([row]);\n return this.returningItems ? ast.withReturning(this.returningItems) : ast;\n }\n}\n\nexport class CfUpsertBuilder<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n ) {}\n\n onConflict(...columns: ReadonlyArray<ColumnProxy>): CfConflictClause<Schema> {\n return new CfConflictClause(this.src, this.schema, this.rowValues, [...columns]);\n }\n}\n\nexport class CfConflictClause<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly conflictCols: ReadonlyArray<ColumnProxy>,\n ) {}\n\n doUpdate(\n setOrCallback:\n | TableSetValues<Schema>\n | ((excluded: ExcludedProxy<Schema>) => TableSetValues<Schema>),\n ): CfUpsertQuery<Schema> {\n const set =\n typeof setOrCallback === 'function'\n ? setOrCallback(buildExcludedProxy(this.schema))\n : setOrCallback;\n return new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, set);\n }\n\n doNothing(): CfUpsertQuery<Schema> {\n return new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, undefined);\n }\n}\n\nexport class CfUpsertQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly conflictCols: ReadonlyArray<ColumnProxy>,\n private readonly updateSet: TableSetValues<Schema> | undefined,\n ) {}\n\n build(): InsertAst {\n const row = buildInsertRow(this.schema, this.rowValues);\n const conflictRefs = this.conflictCols.map((col) => col.toRef());\n const onConflict =\n this.updateSet === undefined\n ? InsertOnConflict.on(conflictRefs).doNothing()\n : InsertOnConflict.on(conflictRefs).doUpdateSet(buildSetMap(this.schema, this.updateSet));\n return InsertAst.into(this.src).withRows([row]).withOnConflict(onConflict);\n }\n}\n\nexport class CfUpdateQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly setValues: TableSetValues<Schema> | undefined = undefined,\n private readonly whereExpr: CfExpr | undefined = undefined,\n private readonly returningItems: ReadonlyArray<ProjectionItem> | undefined = undefined,\n ) {}\n\n set(values: TableSetValues<Schema>): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(this.src, this.schema, values, this.whereExpr, this.returningItems);\n }\n\n where(expr: CfExpr): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(this.src, this.schema, this.setValues, expr, this.returningItems);\n }\n\n returning(...columns: ReadonlyArray<ColumnProxy>): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(\n this.src,\n this.schema,\n this.setValues,\n this.whereExpr,\n columns.map((col) => col.toProjectionItem()),\n );\n }\n\n build(): UpdateAst {\n const set = buildSetMap(this.schema, this.setValues);\n const base = UpdateAst.table(this.src).withSet(set);\n const withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n return this.returningItems ? withWhere.withReturning(this.returningItems) : withWhere;\n }\n}\n\nexport class CfSelectQuery {\n constructor(\n private readonly src: TableSource,\n private readonly projectionItems: ReadonlyArray<ProjectionItem>,\n private readonly whereExpr: CfExpr | undefined = undefined,\n private readonly orderByItems: ReadonlyArray<OrderByItem> = [],\n ) {}\n\n where(expr: CfExpr): CfSelectQuery {\n return new CfSelectQuery(this.src, this.projectionItems, expr, this.orderByItems);\n }\n\n orderBy(column: ColumnProxy, dir: 'asc' | 'desc' = 'asc'): CfSelectQuery {\n const item = dir === 'asc' ? OrderByItem.asc(column.toRef()) : OrderByItem.desc(column.toRef());\n return new CfSelectQuery(this.src, this.projectionItems, this.whereExpr, [\n ...this.orderByItems,\n item,\n ]);\n }\n\n build(): SelectAst {\n const base = SelectAst.from(this.src).withProjection(this.projectionItems);\n const withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n return this.orderByItems.length > 0 ? withWhere.withOrderBy(this.orderByItems) : withWhere;\n }\n}\n\n/**\n * Declare a control-plane table once, binding column codecs at declaration time.\n * Returns a `TableHandle` whose column properties compose expressions directly\n * without per-call-site codec or column-name threading.\n *\n * ```ts\n * const marker = pgTable({ name: 'marker', schema: 'prisma_contract' }, {\n * space: text(),\n * core_hash: text(),\n * updated_at: timestamptz(),\n * });\n *\n * const query = marker.update()\n * .set({ core_hash: newHash, updated_at: NOW })\n * .where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom)))\n * .returning(marker.space)\n * .build();\n * ```\n */\nexport function table<Schema extends ColumnSchema>(\n source: TableSource,\n schema: Schema,\n): TableHandle<Schema> {\n const proxies: Record<string, ColumnProxy> = {};\n for (const [col, desc] of Object.entries(schema)) {\n proxies[col] = makeColumnProxy(source.alias ?? source.name, col, desc);\n }\n\n const handle = {\n ...proxies,\n source,\n insert: (row: TableInsertRow<Schema>) => new CfInsertQuery(source, schema, row),\n upsert: (row: TableInsertRow<Schema>) => new CfUpsertBuilder(source, schema, row),\n update: () => new CfUpdateQuery(source, schema),\n select: (...cols: ReadonlyArray<ColumnProxy>) =>\n new CfSelectQuery(\n source,\n cols.map((col) => col.toProjectionItem()),\n ),\n };\n\n return blindCast<\n TableHandle<Schema>,\n 'Column proxies are dynamically built from Schema keys — TypeScript cannot verify the per-key ColumnProxy constraint at the spread call site. Construction is correct by construction: every key maps to makeColumnProxy(source.name, key, schema[key]).'\n >(handle);\n}\n\nfunction makeColumnProxy(\n tableName: string,\n columnName: string,\n desc: ColumnDescriptor,\n): ColumnProxy {\n const ref = ColumnRef.of(tableName, columnName);\n return {\n codecId: desc.codecId,\n nullable: desc.nullable,\n columnName,\n tableName,\n eq: (value) =>\n value === null\n ? new CfExpr(NullCheckExpr.isNull(ref))\n : new CfExpr(BinaryExpr.eq(ref, toSetExpression(value, desc))),\n neq: (value) =>\n value === null\n ? new CfExpr(NullCheckExpr.isNotNull(ref))\n : new CfExpr(BinaryExpr.neq(ref, toSetExpression(value, desc))),\n isNull: () => new CfExpr(NullCheckExpr.isNull(ref)),\n isNotNull: () => new CfExpr(NullCheckExpr.isNotNull(ref)),\n toRef: () => ref,\n toProjectionItem: (alias = columnName) =>\n ProjectionItem.of(alias, ref, { codecId: desc.codecId }),\n };\n}\n\nfunction buildExcludedProxy<Schema extends ColumnSchema>(schema: Schema): ExcludedProxy<Schema> {\n return blindCast<\n ExcludedProxy<Schema>,\n 'Object.fromEntries cannot preserve per-key ColumnRef types — correct by construction: every key maps to ColumnRef.of(\"excluded\", key).'\n >(Object.fromEntries(Object.keys(schema).map((col) => [col, ColumnRef.of('excluded', col)])));\n}\n\nfunction isExpressionSource(value: unknown): value is { toExpr(): AnyExpression } {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'toExpr' in value &&\n typeof value.toExpr === 'function'\n );\n}\n\nfunction toInsertValue(value: unknown, desc: ColumnDescriptor): InsertValue {\n if (isExpressionSource(value)) {\n const expr = value.toExpr();\n if (\n expr.kind === 'column-ref' ||\n expr.kind === 'param-ref' ||\n expr.kind === 'prepared-param-ref' ||\n expr.kind === 'raw-expr'\n ) {\n return expr;\n }\n }\n return ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\n\nfunction toSetExpression(value: unknown, desc: ColumnDescriptor): AnyExpression {\n if (isExpressionSource(value)) {\n return value.toExpr();\n }\n return ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\n\nfunction buildInsertRow<Schema extends ColumnSchema>(\n schema: Schema,\n values: TableInsertRow<Schema>,\n): Record<string, InsertValue> {\n const row: Record<string, InsertValue> = {};\n const rawValues = blindCast<\n Record<string, unknown>,\n 'TableInsertRow<Schema> maps Schema keys to unknown; indexing by the same string keys is correct by construction'\n >(values);\n for (const [col, desc] of Object.entries(schema)) {\n row[col] = toInsertValue(rawValues[col], desc);\n }\n return row;\n}\n\nfunction buildSetMap<Schema extends ColumnSchema>(\n schema: Schema,\n values: TableSetValues<Schema> | undefined,\n): Record<string, AnyExpression> {\n if (values === undefined) return {};\n const set: Record<string, AnyExpression> = {};\n const rawSchema = blindCast<\n Record<string, ColumnDescriptor>,\n 'Schema extends ColumnSchema = Record<string, ColumnDescriptor>; runtime key access is correct by construction'\n >(schema);\n const rawValues = blindCast<\n Record<string, unknown>,\n 'TableSetValues<Schema> maps Schema keys to unknown; iterating with Object.entries is correct by construction'\n >(values);\n for (const [col, value] of Object.entries(rawValues)) {\n const desc = rawSchema[col];\n if (desc !== undefined) {\n set[col] = toSetExpression(value, desc);\n }\n }\n return set;\n}\n"],"mappings":";;;;AAqBA,SAAgB,IAAI,OAA6D;CAC/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Y,UAGhB,MAAM;CACR,MAAM,YAAY,UAGhB,MAAM;CACR,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,GAAG;EACpD,MAAM,OAAO,UAAU;EACvB,IAAI,SAAS,KAAA,GACX,IAAI,OAAO,gBAAgB,OAAO,IAAI;CAE1C;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"contract-free.mjs","names":[],"sources":["../../src/contract-free/column.ts","../../src/contract-free/table.ts"],"sourcesContent":["import type { ColumnDefaultLiteralInputValue } from '@prisma-next/contract/types';\nimport type { ReferentialAction } from '@prisma-next/sql-contract/types';\nimport type { CodecRef } from '../ast/codec-types';\nimport type { AnyDdlColumnDefault } from '../ast/ddl-types';\nimport {\n CheckExpressionConstraint,\n DdlColumn,\n ForeignKeyConstraint,\n FunctionColumnDefault,\n LiteralColumnDefault,\n PrimaryKeyConstraint,\n UniqueConstraint,\n} from '../ast/ddl-types';\n\nexport interface DdlColumnOptions {\n readonly notNull?: boolean;\n readonly primaryKey?: boolean;\n readonly default?: AnyDdlColumnDefault;\n readonly codecRef?: CodecRef;\n}\n\nexport function lit(value: ColumnDefaultLiteralInputValue): LiteralColumnDefault {\n return new LiteralColumnDefault(value);\n}\n\nexport function fn(expression: string): FunctionColumnDefault {\n return new FunctionColumnDefault(expression);\n}\n\nexport function col(name: string, type: string, options?: DdlColumnOptions): DdlColumn {\n return new DdlColumn({ name, type, ...options });\n}\n\nexport function primaryKey(\n columns: readonly string[],\n options?: { readonly name?: string },\n): PrimaryKeyConstraint {\n return new PrimaryKeyConstraint({ columns, ...options });\n}\n\nexport function foreignKey(\n columns: readonly string[],\n refTable: string,\n refColumns: readonly string[],\n options?: {\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n },\n): ForeignKeyConstraint {\n return new ForeignKeyConstraint({ columns, refTable, refColumns, ...options });\n}\n\nexport function unique(\n columns: readonly string[],\n options?: { readonly name?: string },\n): UniqueConstraint {\n return new UniqueConstraint({ columns, ...options });\n}\n\nexport function checkExpression(name: string, expression: string): CheckExpressionConstraint {\n return new CheckExpressionConstraint({ name, expression });\n}\n","import type { ParamSpec } from '@prisma-next/operations';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport { structuredError } from '@prisma-next/utils/structured-error';\nimport {\n AggregateExpr,\n AndExpr,\n type AnyExpression,\n type AnyFromSource,\n BinaryExpr,\n ColumnRef,\n ExistsExpr,\n IdentifierRef,\n InsertAst,\n InsertOnConflict,\n type InsertValue,\n JoinAst,\n LiteralExpr,\n NullCheckExpr,\n OperationExpr,\n OrderByItem,\n OrExpr,\n ParamRef,\n ProjectionItem,\n RawExpr,\n SelectAst,\n TableSource,\n UpdateAst,\n} from '../ast/types';\n\nexport interface ColumnDescriptor {\n readonly codecId: string;\n readonly nullable: boolean;\n}\n\nexport type ColumnSchema = Record<string, ColumnDescriptor>;\n\n/**\n * A composable WHERE / ON expression. Wraps an `AnyExpression` and exposes\n * fluent boolean combinators, mirroring the spirit of `sql-builder`'s\n * `Expression` interface without the contract-bound type machinery.\n */\nexport class CfExpr {\n constructor(readonly ast: AnyExpression) {}\n\n and(other: CfExpr): CfExpr {\n return new CfExpr(AndExpr.of([this.ast, other.ast]));\n }\n\n or(other: CfExpr): CfExpr {\n return new CfExpr(OrExpr.of([this.ast, other.ast]));\n }\n\n not(): CfExpr {\n return new CfExpr(this.ast.not());\n }\n\n isNull(): CfExpr {\n return new CfExpr(NullCheckExpr.isNull(this.ast));\n }\n\n isNotNull(): CfExpr {\n return new CfExpr(NullCheckExpr.isNotNull(this.ast));\n }\n\n eqLit(value: number | string | boolean): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, LiteralExpr.of(value)));\n }\n\n gtLit(value: number | string | boolean): CfExpr {\n return new CfExpr(BinaryExpr.gt(this.ast, LiteralExpr.of(value)));\n }\n\n eqParam(value: unknown, codecId: string): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, ParamRef.of(value, { codec: { codecId } })));\n }\n\n eqExpr(other: CfExpr): CfExpr {\n return new CfExpr(BinaryExpr.eq(this.ast, other.ast));\n }\n}\n\nexport interface CfFnOptions {\n readonly method: string;\n readonly template: string;\n readonly self: CfExpr;\n readonly args?: ReadonlyArray<CfExpr>;\n readonly returns: ParamSpec;\n}\n\nexport const cfExpr = {\n countStar(): CfExpr {\n return new CfExpr(AggregateExpr.count());\n },\n lit(value: number | string | boolean): CfExpr {\n return new CfExpr(LiteralExpr.of(value));\n },\n identifierRef(name: string): CfExpr {\n return new CfExpr(IdentifierRef.of(name));\n },\n param(value: unknown, codecId: string): CfExpr {\n return new CfExpr(ParamRef.of(value, { codec: { codecId } }));\n },\n /**\n * Catalog function call lowered via a `'function'`-strategy template\n * (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so\n * target packages only supply vocabulary: template, codec'd operands,\n * and return spec.\n */\n fn(options: CfFnOptions): CfExpr {\n return new CfExpr(\n new OperationExpr({\n method: options.method,\n self: options.self.ast,\n args: options.args?.map((arg) => arg.ast),\n returns: options.returns,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: options.template,\n },\n }),\n );\n },\n columnRef(qualifier: string, name: string): CfExpr {\n return new CfExpr(ColumnRef.of(qualifier, name));\n },\n allOf(exprs: ReadonlyArray<CfExpr>): CfExpr {\n return new CfExpr(AndExpr.of(exprs.map((expr) => expr.ast)));\n },\n /**\n * Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a\n * `RawExpr`. For zero-operand catalog functions where a `'function'`\n * lowering template has nothing to substitute.\n */\n raw(sql: string, returns: ParamSpec): CfExpr {\n return new CfExpr(new RawExpr({ parts: [sql], returns }));\n },\n exists(query: CfExprSelectQuery): CfExpr {\n return new CfExpr(ExistsExpr.exists(query.build()));\n },\n notExists(query: CfExprSelectQuery): CfExpr {\n return new CfExpr(ExistsExpr.notExists(query.build()));\n },\n};\n\n/** Aliased table source for catalog queries (no namespace coordinate). */\nexport function cfTable(name: string, alias?: string): TableSource {\n return TableSource.named(name, alias);\n}\n\nexport class CfExprSelectQuery {\n constructor(\n private readonly src: AnyFromSource | undefined,\n private readonly projectionItems: ReadonlyArray<ProjectionItem>,\n private readonly whereExpr: CfExpr | undefined,\n private readonly joinItems: ReadonlyArray<JoinAst> = [],\n private readonly limitValue: number | undefined = undefined,\n ) {}\n\n from(source: AnyFromSource): CfExprSelectQuery {\n return new CfExprSelectQuery(\n source,\n this.projectionItems,\n this.whereExpr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n join(source: AnyFromSource, on: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n [...this.joinItems, JoinAst.inner(source, on.ast)],\n this.limitValue,\n );\n }\n\n leftJoin(source: AnyFromSource, on: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n [...this.joinItems, JoinAst.left(source, on.ast)],\n this.limitValue,\n );\n }\n\n project(alias: string, expr: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n [...this.projectionItems, ProjectionItem.of(alias, expr.ast)],\n this.whereExpr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n where(expr: CfExpr): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n expr,\n this.joinItems,\n this.limitValue,\n );\n }\n\n limit(value: number): CfExprSelectQuery {\n return new CfExprSelectQuery(\n this.src,\n this.projectionItems,\n this.whereExpr,\n this.joinItems,\n value,\n );\n }\n\n build(): SelectAst {\n if (this.joinItems.length > 0 && this.src === undefined) {\n throw structuredError(\n 'ORM.ARGUMENT_INVALID',\n 'CfExprSelectQuery: cannot add a JOIN without a FROM clause',\n );\n }\n const base =\n this.src !== undefined\n ? SelectAst.from(this.src).withProjection(this.projectionItems)\n : SelectAst.noFrom().withProjection(this.projectionItems);\n const withJoins = this.joinItems.length > 0 ? base.withJoins(this.joinItems) : base;\n const withWhere =\n this.whereExpr !== undefined ? withJoins.withWhere(this.whereExpr.ast) : withJoins;\n return this.limitValue !== undefined ? withWhere.withLimit(this.limitValue) : withWhere;\n }\n}\n\nexport function exprSelect(): CfExprSelectQuery {\n return new CfExprSelectQuery(undefined, [], undefined);\n}\n\n/**\n * Per-column authoring handle exposed as a keyed property on a {@link TableHandle}.\n * Carries codec metadata baked at declaration time so no codec ID, table name, or\n * column name needs to be repeated at the call site.\n */\nexport interface ColumnProxy {\n readonly codecId: string;\n readonly nullable: boolean;\n readonly columnName: string;\n readonly tableName: string;\n eq(value: unknown): CfExpr;\n neq(value: unknown): CfExpr;\n isNull(): CfExpr;\n isNotNull(): CfExpr;\n toRef(): ColumnRef;\n toProjectionItem(alias?: string): ProjectionItem;\n}\n\n/**\n * Object passed to the {@link CfConflictClause.doUpdate} callback. Each key\n * resolves to a `ColumnRef` for the corresponding `excluded.<column>`, so the\n * upsert conflict-update branch can copy proposed values without re-binding\n * parameters.\n */\nexport type ExcludedProxy<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]: ColumnRef;\n};\n\nexport type TableInsertRow<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]: unknown;\n};\n\nexport type TableSetValues<Schema extends ColumnSchema> = {\n readonly [K in keyof Schema]?: unknown;\n};\n\n/**\n * Fluent authoring handle for a fixed control-plane table. Column proxies are\n * exposed as keyed properties so `handle.columnName.eq(value)` composes without\n * threading codec IDs, table names, or column refs at the call site.\n */\nexport type TableHandle<Schema extends ColumnSchema> = {\n readonly source: TableSource;\n insert(row: TableInsertRow<Schema>): CfInsertQuery<Schema>;\n upsert(row: TableInsertRow<Schema>): CfUpsertBuilder<Schema>;\n update(): CfUpdateQuery<Schema>;\n select(...columns: ReadonlyArray<ColumnProxy>): CfSelectQuery;\n} & {\n readonly [K in keyof Schema]: ColumnProxy;\n};\n\nexport class CfInsertQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly returningItems: ReadonlyArray<ProjectionItem> | undefined = undefined,\n ) {}\n\n returning(...columns: ReadonlyArray<ColumnProxy>): CfInsertQuery<Schema> {\n return new CfInsertQuery(\n this.src,\n this.schema,\n this.rowValues,\n columns.map((col) => col.toProjectionItem()),\n );\n }\n\n build(): InsertAst {\n const row = buildInsertRow(this.schema, this.rowValues);\n const ast = InsertAst.into(this.src).withRows([row]);\n return this.returningItems ? ast.withReturning(this.returningItems) : ast;\n }\n}\n\nexport class CfUpsertBuilder<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n ) {}\n\n onConflict(...columns: ReadonlyArray<ColumnProxy>): CfConflictClause<Schema> {\n return new CfConflictClause(this.src, this.schema, this.rowValues, [...columns]);\n }\n}\n\nexport class CfConflictClause<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly conflictCols: ReadonlyArray<ColumnProxy>,\n ) {}\n\n doUpdate(\n setOrCallback:\n | TableSetValues<Schema>\n | ((excluded: ExcludedProxy<Schema>) => TableSetValues<Schema>),\n ): CfUpsertQuery<Schema> {\n const set =\n typeof setOrCallback === 'function'\n ? setOrCallback(buildExcludedProxy(this.schema))\n : setOrCallback;\n return new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, set);\n }\n\n doNothing(): CfUpsertQuery<Schema> {\n return new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, undefined);\n }\n}\n\nexport class CfUpsertQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly rowValues: TableInsertRow<Schema>,\n private readonly conflictCols: ReadonlyArray<ColumnProxy>,\n private readonly updateSet: TableSetValues<Schema> | undefined,\n ) {}\n\n build(): InsertAst {\n const row = buildInsertRow(this.schema, this.rowValues);\n const conflictRefs = this.conflictCols.map((col) => col.toRef());\n const onConflict =\n this.updateSet === undefined\n ? InsertOnConflict.on(conflictRefs).doNothing()\n : InsertOnConflict.on(conflictRefs).doUpdateSet(buildSetMap(this.schema, this.updateSet));\n return InsertAst.into(this.src).withRows([row]).withOnConflict(onConflict);\n }\n}\n\nexport class CfUpdateQuery<Schema extends ColumnSchema> {\n constructor(\n private readonly src: TableSource,\n private readonly schema: Schema,\n private readonly setValues: TableSetValues<Schema> | undefined = undefined,\n private readonly whereExpr: CfExpr | undefined = undefined,\n private readonly returningItems: ReadonlyArray<ProjectionItem> | undefined = undefined,\n ) {}\n\n set(values: TableSetValues<Schema>): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(this.src, this.schema, values, this.whereExpr, this.returningItems);\n }\n\n where(expr: CfExpr): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(this.src, this.schema, this.setValues, expr, this.returningItems);\n }\n\n returning(...columns: ReadonlyArray<ColumnProxy>): CfUpdateQuery<Schema> {\n return new CfUpdateQuery(\n this.src,\n this.schema,\n this.setValues,\n this.whereExpr,\n columns.map((col) => col.toProjectionItem()),\n );\n }\n\n build(): UpdateAst {\n const set = buildSetMap(this.schema, this.setValues);\n const base = UpdateAst.table(this.src).withSet(set);\n const withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n return this.returningItems ? withWhere.withReturning(this.returningItems) : withWhere;\n }\n}\n\nexport class CfSelectQuery {\n constructor(\n private readonly src: TableSource,\n private readonly projectionItems: ReadonlyArray<ProjectionItem>,\n private readonly whereExpr: CfExpr | undefined = undefined,\n private readonly orderByItems: ReadonlyArray<OrderByItem> = [],\n ) {}\n\n where(expr: CfExpr): CfSelectQuery {\n return new CfSelectQuery(this.src, this.projectionItems, expr, this.orderByItems);\n }\n\n orderBy(column: ColumnProxy, dir: 'asc' | 'desc' = 'asc'): CfSelectQuery {\n const item = dir === 'asc' ? OrderByItem.asc(column.toRef()) : OrderByItem.desc(column.toRef());\n return new CfSelectQuery(this.src, this.projectionItems, this.whereExpr, [\n ...this.orderByItems,\n item,\n ]);\n }\n\n build(): SelectAst {\n const base = SelectAst.from(this.src).withProjection(this.projectionItems);\n const withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n return this.orderByItems.length > 0 ? withWhere.withOrderBy(this.orderByItems) : withWhere;\n }\n}\n\n/**\n * Declare a control-plane table once, binding column codecs at declaration time.\n * Returns a `TableHandle` whose column properties compose expressions directly\n * without per-call-site codec or column-name threading.\n *\n * ```ts\n * const marker = pgTable({ name: 'marker', schema: 'prisma_contract' }, {\n * space: text(),\n * core_hash: text(),\n * updated_at: timestamptz(),\n * });\n *\n * const query = marker.update()\n * .set({ core_hash: newHash, updated_at: NOW })\n * .where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom)))\n * .returning(marker.space)\n * .build();\n * ```\n */\nexport function table<Schema extends ColumnSchema>(\n source: TableSource,\n schema: Schema,\n): TableHandle<Schema> {\n const proxies: Record<string, ColumnProxy> = {};\n for (const [col, desc] of Object.entries(schema)) {\n proxies[col] = makeColumnProxy(source.alias ?? source.name, col, desc);\n }\n\n const handle = {\n ...proxies,\n source,\n insert: (row: TableInsertRow<Schema>) => new CfInsertQuery(source, schema, row),\n upsert: (row: TableInsertRow<Schema>) => new CfUpsertBuilder(source, schema, row),\n update: () => new CfUpdateQuery(source, schema),\n select: (...cols: ReadonlyArray<ColumnProxy>) =>\n new CfSelectQuery(\n source,\n cols.map((col) => col.toProjectionItem()),\n ),\n };\n\n return blindCast<\n TableHandle<Schema>,\n 'Column proxies are dynamically built from Schema keys — TypeScript cannot verify the per-key ColumnProxy constraint at the spread call site. Construction is correct by construction: every key maps to makeColumnProxy(source.name, key, schema[key]).'\n >(handle);\n}\n\nfunction makeColumnProxy(\n tableName: string,\n columnName: string,\n desc: ColumnDescriptor,\n): ColumnProxy {\n const ref = ColumnRef.of(tableName, columnName);\n return {\n codecId: desc.codecId,\n nullable: desc.nullable,\n columnName,\n tableName,\n eq: (value) =>\n value === null\n ? new CfExpr(NullCheckExpr.isNull(ref))\n : new CfExpr(BinaryExpr.eq(ref, toSetExpression(value, desc))),\n neq: (value) =>\n value === null\n ? new CfExpr(NullCheckExpr.isNotNull(ref))\n : new CfExpr(BinaryExpr.neq(ref, toSetExpression(value, desc))),\n isNull: () => new CfExpr(NullCheckExpr.isNull(ref)),\n isNotNull: () => new CfExpr(NullCheckExpr.isNotNull(ref)),\n toRef: () => ref,\n toProjectionItem: (alias = columnName) =>\n ProjectionItem.of(alias, ref, { codecId: desc.codecId }),\n };\n}\n\nfunction buildExcludedProxy<Schema extends ColumnSchema>(schema: Schema): ExcludedProxy<Schema> {\n return blindCast<\n ExcludedProxy<Schema>,\n 'Object.fromEntries cannot preserve per-key ColumnRef types — correct by construction: every key maps to ColumnRef.of(\"excluded\", key).'\n >(Object.fromEntries(Object.keys(schema).map((col) => [col, ColumnRef.of('excluded', col)])));\n}\n\nfunction isExpressionSource(value: unknown): value is { toExpr(): AnyExpression } {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'toExpr' in value &&\n typeof value.toExpr === 'function'\n );\n}\n\nfunction toInsertValue(value: unknown, desc: ColumnDescriptor): InsertValue {\n if (isExpressionSource(value)) {\n const expr = value.toExpr();\n if (\n expr.kind === 'column-ref' ||\n expr.kind === 'param-ref' ||\n expr.kind === 'prepared-param-ref' ||\n expr.kind === 'raw-expr'\n ) {\n return expr;\n }\n }\n return ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\n\nfunction toSetExpression(value: unknown, desc: ColumnDescriptor): AnyExpression {\n if (isExpressionSource(value)) {\n return value.toExpr();\n }\n return ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\n\nfunction buildInsertRow<Schema extends ColumnSchema>(\n schema: Schema,\n values: TableInsertRow<Schema>,\n): Record<string, InsertValue> {\n const row: Record<string, InsertValue> = {};\n const rawValues = blindCast<\n Record<string, unknown>,\n 'TableInsertRow<Schema> maps Schema keys to unknown; indexing by the same string keys is correct by construction'\n >(values);\n for (const [col, desc] of Object.entries(schema)) {\n row[col] = toInsertValue(rawValues[col], desc);\n }\n return row;\n}\n\nfunction buildSetMap<Schema extends ColumnSchema>(\n schema: Schema,\n values: TableSetValues<Schema> | undefined,\n): Record<string, AnyExpression> {\n if (values === undefined) return {};\n const set: Record<string, AnyExpression> = {};\n const rawSchema = blindCast<\n Record<string, ColumnDescriptor>,\n 'Schema extends ColumnSchema = Record<string, ColumnDescriptor>; runtime key access is correct by construction'\n >(schema);\n const rawValues = blindCast<\n Record<string, unknown>,\n 'TableSetValues<Schema> maps Schema keys to unknown; iterating with Object.entries is correct by construction'\n >(values);\n for (const [col, value] of Object.entries(rawValues)) {\n const desc = rawSchema[col];\n if (desc !== undefined) {\n set[col] = toSetExpression(value, desc);\n }\n }\n return set;\n}\n"],"mappings":";;;;;AAqBA,SAAgB,IAAI,OAA6D;CAC/E,OAAO,IAAI,qBAAqB,KAAK;AACvC;AAEA,SAAgB,GAAG,YAA2C;CAC5D,OAAO,IAAI,sBAAsB,UAAU;AAC7C;AAEA,SAAgB,IAAI,MAAc,MAAc,SAAuC;CACrF,OAAO,IAAI,UAAU;EAAE;EAAM;EAAM,GAAG;CAAQ,CAAC;AACjD;AAEA,SAAgB,WACd,SACA,SACsB;CACtB,OAAO,IAAI,qBAAqB;EAAE;EAAS,GAAG;CAAQ,CAAC;AACzD;AAEA,SAAgB,WACd,SACA,UACA,YACA,SAKsB;CACtB,OAAO,IAAI,qBAAqB;EAAE;EAAS;EAAU;EAAY,GAAG;CAAQ,CAAC;AAC/E;AAEA,SAAgB,OACd,SACA,SACkB;CAClB,OAAO,IAAI,iBAAiB;EAAE;EAAS,GAAG;CAAQ,CAAC;AACrD;AAEA,SAAgB,gBAAgB,MAAc,YAA+C;CAC3F,OAAO,IAAI,0BAA0B;EAAE;EAAM;CAAW,CAAC;AAC3D;;;;;;;;ACrBA,IAAa,SAAb,MAAa,OAAO;CACG;CAArB,YAAY,KAA6B;EAApB,KAAA,MAAA;CAAqB;CAE1C,IAAI,OAAu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,QAAQ,EAAE,CAAC;AAChE;AAEA,SAAS,gBAAgB,OAAgB,MAAuC;CAC9E,IAAI,mBAAmB,KAAK,GAC1B,OAAO,MAAM,OAAO;CAEtB,OAAO,SAAS,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AAChE;AAEA,SAAS,eACP,QACA,QAC6B;CAC7B,MAAM,MAAmC,CAAC;CAC1C,MAAM,YAAY,UAGhB,MAAM;CACR,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,MAAM,GAC7C,IAAI,OAAO,cAAc,UAAU,MAAM,IAAI;CAE/C,OAAO;AACT;AAEA,SAAS,YACP,QACA,QAC+B;CAC/B,IAAI,WAAW,KAAA,GAAW,OAAO,CAAC;CAClC,MAAM,MAAqC,CAAC;CAC5C,MAAM,YAAY,UAGhB,MAAM;CACR,MAAM,YAAY,UAGhB,MAAM;CACR,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,GAAG;EACpD,MAAM,OAAO,UAAU;EACvB,IAAI,SAAS,KAAA,GACX,IAAI,OAAO,gBAAgB,OAAO,IAAI;CAE1C;CACA,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as CodecRef } from "../codec-types-
|
|
2
|
-
import {
|
|
1
|
+
import { o as CodecRef } from "../codec-types-Bayoa4PI.mjs";
|
|
2
|
+
import { et as ParamRef, o as AnyExpression, ot as RawSqlLiteral } from "../types-CWlaErjN.mjs";
|
|
3
3
|
import { QueryOperationReturn } from "@prisma-next/sql-contract/types";
|
|
4
4
|
import { ParamSpec } from "@prisma-next/operations";
|
|
5
5
|
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as OperationExpr, M as RawExpr, k as ParamRef } from "../types-CINOak-F.mjs";
|
|
2
2
|
import { runtimeError } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
//#region src/expression.ts
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "../middleware-
|
|
1
|
+
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "../middleware-_9-4TYKC.mjs";
|
|
2
2
|
export { type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, type SqlParamRefMutator, type SqlParamRefMutatorInternal, createSqlParamRefMutator };
|
package/dist/exports/plan.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "../sql-execution-plan-
|
|
2
|
-
import { n as planFromAst, t as SqlQueryPlan } from "../plan-
|
|
1
|
+
import { t as SqlExecutionPlan } from "../sql-execution-plan-B-C-6cZN.mjs";
|
|
2
|
+
import { n as planFromAst, t as SqlQueryPlan } from "../plan-Dq94efZJ.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-
|
|
1
|
+
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "../query-lane-context-DTCOHMXn.mjs";
|
|
2
2
|
export { AppliedMutationDefault, CodecDescriptorRegistry, ExecutionContext, MutationDefaultsOp, MutationDefaultsOptions, TypeHelperRegistry };
|
package/dist/exports/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as TableMetadata, E as SqlOrmPlan, S as TableKey, T as RuntimeScope, _ as RawTemplateFactory, a as ColumnsOf, b as SqlPlan, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "../types-
|
|
1
|
+
import { C as TableMetadata, E as SqlOrmPlan, S as TableKey, T as RuntimeScope, _ as RawTemplateFactory, a as ColumnsOf, b as SqlPlan, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "../types-CRV7uuOC.mjs";
|
|
2
2
|
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, Expr, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, type RuntimeScope, SqlBuilderOptions, type SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as DdlColumnDefaultVisitor, c as DdlTableConstraint, d as LiteralColumnDefault, f as PrimaryKeyConstraint, i as DdlColumnDefault, l as ForeignKeyConstraint, m as isDdlNode, n as CheckExpressionConstraint, o as DdlColumnRenderContext, p as UniqueConstraint, r as DdlColumn, s as DdlNode, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-
|
|
1
|
+
import { a as CodecMeta, c as ContractCodecRegistry, d as DescriptorCodecTraits, f as ExtractCodecTypes, g as frozenCodecRef, 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-Bayoa4PI.mjs";
|
|
2
|
+
import { $ as OrderByItem, A as ExpressionRewriter, B as JoinOnExpr, C as Direction, Ct as JsonDocumentProjection, D as ExistsExpr, E as EqColJoinOn, F as IdentifierRef, G as ListExpression, H as JsonObjectEntry, I as InsertAst, J as LoweredStatement, K as LiteralExpr, L as InsertOnConflict, M as FunctionCallExpr, N as FunctionSource, O as ExprVisitor, P as FunctionSourceAlias, Q as OrExpr, R as InsertValue, S as DerivedTableSource, St as CodecJsonValueProjection, T as DoUpdateSetConflictAction, Tt as NativeJsonValueProjection, U as JsonObjectExpr, V as JsonArrayAggExpr, W as LimitOffsetValue, X as NullCheckExpr, Y as NotExpr, Z as OperationExpr, _ as CaseExpr, _t as isQueryAst, a as AndExpr, at as RawSqlExpr, b as DefaultValueExpr, bt as whereExprKinds, c as AnyInsertOnConflictAction, ct as SelectAstOptions, d as AnyParamRef, dt as TableSource, et as ParamRef, f as AnyQueryAst, ft as ToWhereExpr, g as CaseBranch, gt as WindowFuncExpr, h as BinaryOp, ht as WindowFn, i as AggregateOpFn, it as RawExpr, j as ExpressionSource, k as ExpressionFolder, l as AnyInsertValue, lt as SubqueryExpr, m as BinaryExpr, mt as WhereArg, n as AggregateExpr, nt as ProjectionExpr, o as AnyExpression, ot as RawSqlLiteral, p as AstRewriter, pt as UpdateAst, q as LoweredParam, r as AggregateFn, rt as ProjectionItem, s as AnyFromSource, st as SelectAst, t as AggregateCountFn, tt as PreparedParamRef, u as AnyOperationArg, ut as TableRef, v as CastExpr, vt as isWhereExpr, w as DoNothingConflictAction, wt as JsonValueProjectionVisitor, x as DeleteAst, xt as AnyJsonValueProjection, y as ColumnRef, yt as queryAstKinds, z as JoinAst } from "./types-CWlaErjN.mjs";
|
|
3
|
+
import { a as DdlColumnDefaultVisitor, c as DdlTableConstraint, d as LiteralColumnDefault, f as PrimaryKeyConstraint, i as DdlColumnDefault, l as ForeignKeyConstraint, m as isDdlNode, n as CheckExpressionConstraint, o as DdlColumnRenderContext, p as UniqueConstraint, r as DdlColumn, s as DdlNode, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-B3SfjPGI.mjs";
|
|
4
4
|
import { Adapter, AdapterProfile, AdapterTarget, Lowerer, LowererContext, MarkerReadResult, PreparedExecuteRequest, 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";
|
|
5
|
-
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-
|
|
5
|
+
import { a as MutationDefaultsOptions, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as TypeHelperRegistry, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-DTCOHMXn.mjs";
|
|
6
6
|
import { BuildOperationSpec, CodecExpression, CodecTypesBase, CodecValue, Expression, RawCodecInferer, RawSqlBuilder, RawSqlTag, ScalarListExpression, ScopeField, TraitExpression, buildOperation, codecOf, createRawSql, param, toExpr } from "./exports/expression.mjs";
|
|
7
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
8
|
-
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-
|
|
9
|
-
import { n as planFromAst, t as SqlQueryPlan } from "./plan-
|
|
7
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-B-C-6cZN.mjs";
|
|
8
|
+
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-_9-4TYKC.mjs";
|
|
9
|
+
import { n as planFromAst, t as SqlQueryPlan } from "./plan-Dq94efZJ.mjs";
|
|
10
10
|
import "./exports/plan.mjs";
|
|
11
11
|
import "./exports/query-lane-context.mjs";
|
|
12
|
-
import { C as TableMetadata, E as SqlOrmPlan, S as TableKey, T as RuntimeScope, _ as RawTemplateFactory, a as ColumnsOf, b as SqlPlan, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "./types-
|
|
13
|
-
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CheckExpressionConstraint, Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecMeta, type CodecRef, type CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonObjectEntry, JsonObjectExpr, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, PreparedExecuteRequest, PreparedParamRef, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawCodecInferer, RawExpr, RawFactory, RawFunctionOptions, RawSqlBuilder, RawSqlExpr, RawSqlLiteral, RawSqlTag, RawTemplateFactory, RawTemplateOptions, type 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, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, 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 };
|
|
12
|
+
import { C as TableMetadata, E as SqlOrmPlan, S as TableKey, T as RuntimeScope, _ as RawTemplateFactory, a as ColumnsOf, b as SqlPlan, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TablesOf, x as TableDef, y as SqlBuilderOptions } from "./types-CRV7uuOC.mjs";
|
|
13
|
+
export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, CodecMeta, type CodecRef, type CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, PreparedExecuteRequest, PreparedParamRef, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawCodecInferer, RawExpr, RawFactory, RawFunctionOptions, RawSqlBuilder, RawSqlExpr, RawSqlLiteral, RawSqlTag, RawTemplateFactory, RawTemplateOptions, type 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, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryResult, SqlQueryable, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, frozenCodecRef, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
1
|
+
import { A as PreparedParamRef, B as isWhereExpr, C as LiteralExpr, D as OrExpr, E as OperationExpr, F as SubqueryExpr, H as whereExprKinds, I as TableSource, L as UpdateAst, M as RawExpr, N as RawSqlExpr, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, U as frozenCodecRef, V as queryAstKinds, _ as InsertAst, a as CastExpr, b as JsonArrayAggExpr, c as DeleteAst, d as DoUpdateSetConflictAction, f as EqColJoinOn, g as IdentifierRef, h as FunctionSource, i as CaseExpr, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst, z as isQueryAst } from "./types-CINOak-F.mjs";
|
|
2
|
+
import { a as ForeignKeyConstraint, c as PrimaryKeyConstraint, i as DdlNode, l as UniqueConstraint, n as DdlColumn, o as FunctionColumnDefault, r as DdlColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as isDdlNode } from "./ddl-types-BUoa33yk.mjs";
|
|
3
3
|
import { n as compact, t as collectOrderedParamRefs } from "./util-DQQgv2j1.mjs";
|
|
4
|
-
import { 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, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, 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 { CodecJsonValueProjection, JsonDocumentProjection, NativeJsonValueProjection, 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, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, 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";
|
|
5
5
|
import { buildOperation, codecOf, createRawSql, param, toExpr } from "./exports/expression.mjs";
|
|
6
6
|
import { t as createSqlParamRefMutator } from "./middleware-CMr4CHNz.mjs";
|
|
7
7
|
import { planFromAst } from "./exports/plan.mjs";
|
|
8
8
|
import "./exports/query-lane-context.mjs";
|
|
9
9
|
import "./exports/types.mjs";
|
|
10
|
-
export { AggregateExpr, AndExpr, BinaryExpr, CheckExpressionConstraint, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, 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 };
|
|
10
|
+
export { AggregateExpr, AndExpr, BinaryExpr, CaseExpr, CastExpr, CheckExpressionConstraint, CodecJsonValueProjection, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, frozenCodecRef, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, 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,4 +1,4 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
1
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-B-C-6cZN.mjs";
|
|
2
2
|
import { ParamRefMutator } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
//#region src/middleware/param-ref-mutator.d.ts
|
|
4
4
|
/**
|
|
@@ -115,4 +115,4 @@ interface SqlParamRefMutatorInternal<TCodecMap extends Record<string, unknown> =
|
|
|
115
115
|
declare function createSqlParamRefMutator<TCodecMap extends Record<string, unknown> = Record<string, unknown>>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap>;
|
|
116
116
|
//#endregion
|
|
117
117
|
export { SqlParamRefMutatorInternal as a, SqlParamRefMutator as i, ParamRefEntryUnion as n, createSqlParamRefMutator as o, ParamRefHandle as r, ParamRefEntry as t };
|
|
118
|
-
//# sourceMappingURL=middleware-
|
|
118
|
+
//# sourceMappingURL=middleware-_9-4TYKC.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-
|
|
1
|
+
{"version":3,"file":"middleware-_9-4TYKC.d.mts","names":[],"sources":["../src/middleware/param-ref-mutator.ts"],"mappings":";;;;;;;;;;;;;cAec;;;;;;;;;;UAWG,eAAe;YACpB,sBAAsB;;;;;;;UAQjB,cAAc;WACpB,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAWR,mBAAmB,kBAAkB,8BAC1C,WAAW,qBAAqB,cAAc,YAAW,sBAC5D;;;;;;;;;;;;;;;;;;;;;;;;;UA0Ba,mBACf,kBAAkB,0BAA0B,iCACpC;;EAER,WAAW,iBAAiB,mBAAmB;;;;;;;EAQ/C,aAAa,uBAAuB,oBAClC,KAAK,eAAe,WACpB,UAAU,UAAU;EAEtB,aAAa,KAAK,2BAA2B;;EAG7C,cACE,SAAS;aACE,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAeE,2BACf,kBAAkB,0BAA0B,iCACpC,mBAAmB;EAC3B;;;;;;;;;;;;;;;;;iBAoBc,yBACd,kBAAkB,0BAA0B,yBAC5C,MAAM,mBAAmB,2BAA2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AnyQueryAst } from "./types-
|
|
1
|
+
import { f as AnyQueryAst } from "./types-CWlaErjN.mjs";
|
|
2
2
|
import { Contract } from "@prisma-next/contract/types";
|
|
3
3
|
import { QueryPlan } from "@prisma-next/framework-components/runtime";
|
|
4
4
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
@@ -40,4 +40,4 @@ interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
|
|
|
40
40
|
declare function planFromAst<Row = unknown>(ast: AnyQueryAst, contract: Contract<SqlStorage>, laneId?: string): SqlQueryPlan<Row>;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { planFromAst as n, SqlQueryPlan as t };
|
|
43
|
-
//# sourceMappingURL=plan-
|
|
43
|
+
//# sourceMappingURL=plan-Dq94efZJ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-
|
|
1
|
+
{"version":3,"file":"plan-Dq94efZJ.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAkBiB,aAAa,uBAAuB,UAAU;WACpD,KAAK;WACL;;;;;;;;;;;;;;;;;;;iBAoBK,YAAY,eAC1B,KAAK,aACL,UAAU,SAAS,aACnB,kBACC,aAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ContractCodecRegistry } from "./codec-types-
|
|
1
|
+
import { c as ContractCodecRegistry } from "./codec-types-Bayoa4PI.mjs";
|
|
2
2
|
import { Contract } from "@prisma-next/contract/types";
|
|
3
3
|
import { CodecDescriptor, CodecRef } from "@prisma-next/framework-components/codec";
|
|
4
4
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
@@ -89,4 +89,4 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
|
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
91
|
export { MutationDefaultsOptions as a, MutationDefaultsOp as i, CodecDescriptorRegistry as n, TypeHelperRegistry as o, ExecutionContext as r, AppliedMutationDefault as t };
|
|
92
|
-
//# sourceMappingURL=query-lane-context-
|
|
92
|
+
//# sourceMappingURL=query-lane-context-DTCOHMXn.d.mts.map
|
package/dist/{query-lane-context-BNbbusGn.d.mts.map → query-lane-context-DTCOHMXn.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-lane-context-
|
|
1
|
+
{"version":3,"file":"query-lane-context-DTCOHMXn.d.mts","names":[],"sources":["../src/query-lane-context.ts"],"mappings":";;;;;;;;;UASiB;;;;EAIf,cAAc,kBAAkB;;;;;;;;;;;;;;EAchC,kBAAkB,qBAAqB,eAAe,iBAAiB;;;;EAIvE,UAAU,iBAAiB;;;;EAI3B,aAAa,8BAA8B;;;;;KAMjC,qBAAqB;KAErB;KAEA;WACD;WACA;;KAGC;WACD,IAAI;WACJ;;;;;;;;WAQA;WACA,QAAQ;;;;;WAKR,oBAAoB;;;;;;;UAQd,iBAAiB,kBAAkB,SAAS,cAAc,SAAS;WACzE,UAAU;;;;WAIV,gBAAgB;;;;WAIhB,kBAAkB;WAClB,iBAAiB;;;;WAIjB,OAAO;;;;EAIhB,sBAAsB,SAAS,0BAA0B,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AnyQueryAst } from "./types-
|
|
1
|
+
import { f as AnyQueryAst } from "./types-CWlaErjN.mjs";
|
|
2
2
|
import { ExecutionPlan } from "@prisma-next/framework-components/runtime";
|
|
3
3
|
//#region src/sql-execution-plan.d.ts
|
|
4
4
|
/**
|
|
@@ -28,4 +28,4 @@ interface SqlExecutionPlan<Row = unknown> extends ExecutionPlan<Row> {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { SqlExecutionPlan as t };
|
|
31
|
-
//# sourceMappingURL=sql-execution-plan-
|
|
31
|
+
//# sourceMappingURL=sql-execution-plan-B-C-6cZN.d.mts.map
|
package/dist/{sql-execution-plan-CPw3uKrJ.d.mts.map → sql-execution-plan-B-C-6cZN.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-execution-plan-
|
|
1
|
+
{"version":3,"file":"sql-execution-plan-B-C-6cZN.d.mts","names":[],"sources":["../src/sql-execution-plan.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB,iBAAiB,uBAAuB,cAAc;WAC5D;WACA;WACA,KAAK"}
|