@prisma-next/sql-relational-core 0.3.0-dev.16 → 0.3.0-dev.162
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/LICENSE +201 -0
- package/README.md +20 -6
- package/dist/codec-types-DcEITed4.d.mts +144 -0
- package/dist/codec-types-DcEITed4.d.mts.map +1 -0
- package/dist/errors-Cs52upp3.d.mts +8 -0
- package/dist/errors-Cs52upp3.d.mts.map +1 -0
- package/dist/errors-D3xmG4h-.mjs +35 -0
- package/dist/errors-D3xmG4h-.mjs.map +1 -0
- package/dist/exports/ast.d.mts +158 -0
- package/dist/exports/ast.d.mts.map +1 -0
- package/dist/exports/ast.mjs +1358 -0
- package/dist/exports/ast.mjs.map +1 -0
- package/dist/exports/errors.d.mts +5 -0
- package/dist/exports/errors.mjs +3 -0
- package/dist/exports/plan.d.mts +2 -0
- package/dist/exports/plan.mjs +17 -0
- package/dist/exports/plan.mjs.map +1 -0
- package/dist/exports/query-lane-context.d.mts +3 -0
- package/dist/exports/query-lane-context.mjs +1 -0
- package/dist/exports/types.d.mts +4 -0
- package/dist/exports/types.mjs +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +7 -0
- package/dist/plan-5qUWdlJM.d.mts +28 -0
- package/dist/plan-5qUWdlJM.d.mts.map +1 -0
- package/dist/query-lane-context-UlR8vOkd.d.mts +89 -0
- package/dist/query-lane-context-UlR8vOkd.d.mts.map +1 -0
- package/dist/types-CLCtwVWx.d.mts +485 -0
- package/dist/types-CLCtwVWx.d.mts.map +1 -0
- package/dist/types-V1qiC5DO.d.mts +200 -0
- package/dist/types-V1qiC5DO.d.mts.map +1 -0
- package/package.json +31 -53
- package/src/ast/adapter-types.ts +11 -0
- package/src/ast/codec-types.ts +101 -53
- package/src/ast/driver-types.ts +20 -3
- package/src/ast/sql-codecs.ts +142 -0
- package/src/ast/types.ts +1681 -77
- package/src/errors.ts +47 -1
- package/src/exports/ast.ts +1 -8
- package/src/index.ts +0 -3
- package/src/plan.ts +4 -4
- package/src/query-lane-context.ts +81 -6
- package/src/types.ts +102 -354
- package/dist/ast/adapter-types.d.ts +0 -28
- package/dist/ast/adapter-types.d.ts.map +0 -1
- package/dist/ast/codec-types.d.ts +0 -141
- package/dist/ast/codec-types.d.ts.map +0 -1
- package/dist/ast/common.d.ts +0 -7
- package/dist/ast/common.d.ts.map +0 -1
- package/dist/ast/delete.d.ts +0 -8
- package/dist/ast/delete.d.ts.map +0 -1
- package/dist/ast/driver-types.d.ts +0 -20
- package/dist/ast/driver-types.d.ts.map +0 -1
- package/dist/ast/insert.d.ts +0 -8
- package/dist/ast/insert.d.ts.map +0 -1
- package/dist/ast/join.d.ts +0 -6
- package/dist/ast/join.d.ts.map +0 -1
- package/dist/ast/order.d.ts +0 -6
- package/dist/ast/order.d.ts.map +0 -1
- package/dist/ast/predicate.d.ts +0 -4
- package/dist/ast/predicate.d.ts.map +0 -1
- package/dist/ast/select.d.ts +0 -18
- package/dist/ast/select.d.ts.map +0 -1
- package/dist/ast/types.d.ts +0 -118
- package/dist/ast/types.d.ts.map +0 -1
- package/dist/ast/update.d.ts +0 -9
- package/dist/ast/update.d.ts.map +0 -1
- package/dist/ast/util.d.ts +0 -2
- package/dist/ast/util.d.ts.map +0 -1
- package/dist/chunk-2F7DSEOU.js +0 -8
- package/dist/chunk-2F7DSEOU.js.map +0 -1
- package/dist/chunk-36WJWNHT.js +0 -1
- package/dist/chunk-36WJWNHT.js.map +0 -1
- package/dist/chunk-5N34PNVZ.js +0 -62
- package/dist/chunk-5N34PNVZ.js.map +0 -1
- package/dist/chunk-7I3EMQID.js +0 -16
- package/dist/chunk-7I3EMQID.js.map +0 -1
- package/dist/chunk-D4JLPIWO.js +0 -13
- package/dist/chunk-D4JLPIWO.js.map +0 -1
- package/dist/chunk-G52ENULI.js +0 -1
- package/dist/chunk-G52ENULI.js.map +0 -1
- package/dist/chunk-J6O2HVBM.js +0 -320
- package/dist/chunk-J6O2HVBM.js.map +0 -1
- package/dist/chunk-KYSP7L5C.js +0 -16
- package/dist/chunk-KYSP7L5C.js.map +0 -1
- package/dist/chunk-M23L3JHG.js +0 -159
- package/dist/chunk-M23L3JHG.js.map +0 -1
- package/dist/chunk-U7AXAUJA.js +0 -1
- package/dist/chunk-U7AXAUJA.js.map +0 -1
- package/dist/chunk-U7IAFPVU.js +0 -152
- package/dist/chunk-U7IAFPVU.js.map +0 -1
- package/dist/errors.d.ts +0 -2
- package/dist/errors.d.ts.map +0 -1
- package/dist/exports/ast.d.ts +0 -14
- package/dist/exports/ast.d.ts.map +0 -1
- package/dist/exports/ast.js +0 -46
- package/dist/exports/ast.js.map +0 -1
- package/dist/exports/errors.d.ts +0 -2
- package/dist/exports/errors.d.ts.map +0 -1
- package/dist/exports/errors.js +0 -9
- package/dist/exports/errors.js.map +0 -1
- package/dist/exports/guards.d.ts +0 -2
- package/dist/exports/guards.d.ts.map +0 -1
- package/dist/exports/guards.js +0 -21
- package/dist/exports/guards.js.map +0 -1
- package/dist/exports/operations-registry.d.ts +0 -2
- package/dist/exports/operations-registry.d.ts.map +0 -1
- package/dist/exports/operations-registry.js +0 -9
- package/dist/exports/operations-registry.js.map +0 -1
- package/dist/exports/param.d.ts +0 -3
- package/dist/exports/param.d.ts.map +0 -1
- package/dist/exports/param.js +0 -7
- package/dist/exports/param.js.map +0 -1
- package/dist/exports/plan.d.ts +0 -2
- package/dist/exports/plan.d.ts.map +0 -1
- package/dist/exports/plan.js +0 -7
- package/dist/exports/plan.js.map +0 -1
- package/dist/exports/query-lane-context.d.ts +0 -2
- package/dist/exports/query-lane-context.d.ts.map +0 -1
- package/dist/exports/query-lane-context.js +0 -2
- package/dist/exports/query-lane-context.js.map +0 -1
- package/dist/exports/schema.d.ts +0 -3
- package/dist/exports/schema.d.ts.map +0 -1
- package/dist/exports/schema.js +0 -14
- package/dist/exports/schema.js.map +0 -1
- package/dist/exports/types.d.ts +0 -2
- package/dist/exports/types.d.ts.map +0 -1
- package/dist/exports/types.js +0 -10
- package/dist/exports/types.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -81
- package/dist/index.js.map +0 -1
- package/dist/operations-registry.d.ts +0 -5
- package/dist/operations-registry.d.ts.map +0 -1
- package/dist/param.d.ts +0 -4
- package/dist/param.d.ts.map +0 -1
- package/dist/plan.d.ts +0 -23
- package/dist/plan.d.ts.map +0 -1
- package/dist/query-lane-context.d.ts +0 -16
- package/dist/query-lane-context.d.ts.map +0 -1
- package/dist/schema.d.ts +0 -63
- package/dist/schema.d.ts.map +0 -1
- package/dist/types.d.ts +0 -332
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/guards.d.ts +0 -55
- package/dist/utils/guards.d.ts.map +0 -1
- package/src/ast/common.ts +0 -36
- package/src/ast/delete.ts +0 -17
- package/src/ast/insert.ts +0 -17
- package/src/ast/join.ts +0 -54
- package/src/ast/order.ts +0 -11
- package/src/ast/predicate.ts +0 -30
- package/src/ast/select.ts +0 -39
- package/src/ast/update.ts +0 -19
- package/src/exports/guards.ts +0 -10
- package/src/exports/operations-registry.ts +0 -1
- package/src/exports/param.ts +0 -2
- package/src/exports/schema.ts +0 -6
- package/src/operations-registry.ts +0 -237
- package/src/param.ts +0 -15
- package/src/schema.ts +0 -373
- package/src/utils/guards.ts +0 -123
package/src/ast/select.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BinaryExpr,
|
|
3
|
-
ColumnRef,
|
|
4
|
-
Direction,
|
|
5
|
-
ExistsExpr,
|
|
6
|
-
IncludeAst,
|
|
7
|
-
IncludeRef,
|
|
8
|
-
JoinAst,
|
|
9
|
-
OperationExpr,
|
|
10
|
-
SelectAst,
|
|
11
|
-
TableRef,
|
|
12
|
-
} from './types';
|
|
13
|
-
import { compact } from './util';
|
|
14
|
-
|
|
15
|
-
export interface CreateSelectAstOptions {
|
|
16
|
-
readonly from: TableRef;
|
|
17
|
-
readonly joins?: ReadonlyArray<JoinAst>;
|
|
18
|
-
readonly includes?: ReadonlyArray<IncludeAst>;
|
|
19
|
-
readonly project: ReadonlyArray<{
|
|
20
|
-
alias: string;
|
|
21
|
-
expr: ColumnRef | IncludeRef | OperationExpr;
|
|
22
|
-
}>;
|
|
23
|
-
readonly where?: BinaryExpr | ExistsExpr;
|
|
24
|
-
readonly orderBy?: ReadonlyArray<{ expr: ColumnRef | OperationExpr; dir: Direction }>;
|
|
25
|
-
readonly limit?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function createSelectAst(options: CreateSelectAstOptions): SelectAst {
|
|
29
|
-
return compact({
|
|
30
|
-
kind: 'select',
|
|
31
|
-
from: options.from,
|
|
32
|
-
joins: options.joins,
|
|
33
|
-
includes: options.includes,
|
|
34
|
-
project: options.project,
|
|
35
|
-
where: options.where,
|
|
36
|
-
orderBy: options.orderBy,
|
|
37
|
-
limit: options.limit,
|
|
38
|
-
}) as SelectAst;
|
|
39
|
-
}
|
package/src/ast/update.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { BinaryExpr, ColumnRef, ParamRef, TableRef, UpdateAst } from './types';
|
|
2
|
-
import { compact } from './util';
|
|
3
|
-
|
|
4
|
-
export interface CreateUpdateAstOptions {
|
|
5
|
-
readonly table: TableRef;
|
|
6
|
-
readonly set: Record<string, ColumnRef | ParamRef>;
|
|
7
|
-
readonly where: BinaryExpr;
|
|
8
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function createUpdateAst(options: CreateUpdateAstOptions): UpdateAst {
|
|
12
|
-
return compact({
|
|
13
|
-
kind: 'update',
|
|
14
|
-
table: options.table,
|
|
15
|
-
set: options.set,
|
|
16
|
-
where: options.where,
|
|
17
|
-
returning: options.returning,
|
|
18
|
-
}) as UpdateAst;
|
|
19
|
-
}
|
package/src/exports/guards.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { attachOperationsToColumnBuilder } from '../operations-registry';
|
package/src/exports/param.ts
DELETED
package/src/exports/schema.ts
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import type { OperationRegistry } from '@prisma-next/operations';
|
|
2
|
-
import { hasAllCapabilities } from '@prisma-next/operations';
|
|
3
|
-
import { planInvalid } from '@prisma-next/plan';
|
|
4
|
-
import type { StorageColumn } from '@prisma-next/sql-contract/types';
|
|
5
|
-
import type { SqlOperationSignature } from '@prisma-next/sql-operations';
|
|
6
|
-
import type { BinaryOp, ColumnRef, LiteralExpr, OperationExpr, ParamRef } from './ast/types';
|
|
7
|
-
import type { AnyColumnBuilder, ColumnBuilder, OperationTypes, ParamPlaceholder } from './types';
|
|
8
|
-
import { isParamPlaceholder } from './utils/guards';
|
|
9
|
-
|
|
10
|
-
function isColumnBuilder(value: unknown): value is AnyColumnBuilder {
|
|
11
|
-
return (
|
|
12
|
-
typeof value === 'object' &&
|
|
13
|
-
value !== null &&
|
|
14
|
-
'kind' in value &&
|
|
15
|
-
(value as { kind: unknown }).kind === 'column'
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Executes an operation and returns a column-shaped result object.
|
|
21
|
-
* This is the canonical entrypoint for operation invocation, enabling
|
|
22
|
-
* future enhancements like telemetry, caching, or tracing.
|
|
23
|
-
*
|
|
24
|
-
* @param signature - The operation signature from the registry
|
|
25
|
-
* @param selfBuilder - The column builder that the operation is called on
|
|
26
|
-
* @param args - The arguments passed to the operation
|
|
27
|
-
* @param columnMeta - The metadata of the column the operation is called on
|
|
28
|
-
* @returns A column-shaped builder with the operation expression attached
|
|
29
|
-
*/
|
|
30
|
-
function executeOperation(
|
|
31
|
-
signature: SqlOperationSignature,
|
|
32
|
-
selfBuilder: AnyColumnBuilder,
|
|
33
|
-
args: unknown[],
|
|
34
|
-
columnMeta: StorageColumn,
|
|
35
|
-
operationRegistry?: OperationRegistry,
|
|
36
|
-
contractCapabilities?: Record<string, Record<string, boolean>>,
|
|
37
|
-
): AnyColumnBuilder & { _operationExpr?: OperationExpr } {
|
|
38
|
-
if (args.length !== signature.args.length) {
|
|
39
|
-
throw planInvalid(
|
|
40
|
-
`Operation ${signature.method} expects ${signature.args.length} arguments, got ${args.length}`,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Check if this column builder has an existing operation expression
|
|
45
|
-
const selfBuilderWithExpr = selfBuilder as unknown as {
|
|
46
|
-
_operationExpr?: OperationExpr;
|
|
47
|
-
table: string;
|
|
48
|
-
column: string;
|
|
49
|
-
};
|
|
50
|
-
const selfExpr: ColumnRef | OperationExpr = selfBuilderWithExpr._operationExpr
|
|
51
|
-
? selfBuilderWithExpr._operationExpr
|
|
52
|
-
: {
|
|
53
|
-
kind: 'col',
|
|
54
|
-
table: selfBuilderWithExpr.table,
|
|
55
|
-
column: selfBuilderWithExpr.column,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const operationArgs: Array<ColumnRef | ParamRef | LiteralExpr | OperationExpr> = [];
|
|
59
|
-
for (let i = 0; i < args.length; i++) {
|
|
60
|
-
const arg = args[i];
|
|
61
|
-
const argSpec = signature.args[i];
|
|
62
|
-
if (!argSpec) {
|
|
63
|
-
throw planInvalid(`Missing argument spec for argument ${i}`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (argSpec.kind === 'param') {
|
|
67
|
-
if (!isParamPlaceholder(arg)) {
|
|
68
|
-
throw planInvalid(`Argument ${i} must be a parameter placeholder`);
|
|
69
|
-
}
|
|
70
|
-
operationArgs.push({
|
|
71
|
-
kind: 'param',
|
|
72
|
-
index: 0,
|
|
73
|
-
name: arg.name,
|
|
74
|
-
});
|
|
75
|
-
} else if (argSpec.kind === 'typeId') {
|
|
76
|
-
if (!isColumnBuilder(arg)) {
|
|
77
|
-
throw planInvalid(`Argument ${i} must be a ColumnBuilder`);
|
|
78
|
-
}
|
|
79
|
-
const colBuilderWithExpr = arg as unknown as {
|
|
80
|
-
_operationExpr?: OperationExpr;
|
|
81
|
-
table: string;
|
|
82
|
-
column: string;
|
|
83
|
-
};
|
|
84
|
-
// Check if the column builder has an operation expression
|
|
85
|
-
if (colBuilderWithExpr._operationExpr) {
|
|
86
|
-
operationArgs.push(colBuilderWithExpr._operationExpr);
|
|
87
|
-
} else {
|
|
88
|
-
// Fall back to raw ColumnRef
|
|
89
|
-
operationArgs.push({
|
|
90
|
-
kind: 'col',
|
|
91
|
-
table: colBuilderWithExpr.table,
|
|
92
|
-
column: colBuilderWithExpr.column,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
} else if (argSpec.kind === 'literal') {
|
|
96
|
-
operationArgs.push({
|
|
97
|
-
kind: 'literal',
|
|
98
|
-
value: arg,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const operationExpr: OperationExpr = {
|
|
104
|
-
kind: 'operation',
|
|
105
|
-
method: signature.method,
|
|
106
|
-
forTypeId: signature.forTypeId,
|
|
107
|
-
self: selfExpr,
|
|
108
|
-
args: operationArgs,
|
|
109
|
-
returns: signature.returns,
|
|
110
|
-
lowering: signature.lowering,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const returnTypeId = signature.returns.kind === 'typeId' ? signature.returns.type : undefined;
|
|
114
|
-
const returnColumnMeta: StorageColumn = returnTypeId
|
|
115
|
-
? {
|
|
116
|
-
...columnMeta,
|
|
117
|
-
codecId: returnTypeId,
|
|
118
|
-
}
|
|
119
|
-
: columnMeta;
|
|
120
|
-
|
|
121
|
-
const createComparisonMethod = (op: BinaryOp) => (value: ParamPlaceholder) =>
|
|
122
|
-
Object.freeze({
|
|
123
|
-
kind: 'binary' as const,
|
|
124
|
-
op,
|
|
125
|
-
left: operationExpr,
|
|
126
|
-
right: value,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const baseResult = {
|
|
130
|
-
kind: 'column' as const,
|
|
131
|
-
table: selfBuilderWithExpr.table,
|
|
132
|
-
column: selfBuilderWithExpr.column,
|
|
133
|
-
get columnMeta() {
|
|
134
|
-
return returnColumnMeta;
|
|
135
|
-
},
|
|
136
|
-
eq: createComparisonMethod('eq'),
|
|
137
|
-
neq: createComparisonMethod('neq'),
|
|
138
|
-
gt: createComparisonMethod('gt'),
|
|
139
|
-
lt: createComparisonMethod('lt'),
|
|
140
|
-
gte: createComparisonMethod('gte'),
|
|
141
|
-
lte: createComparisonMethod('lte'),
|
|
142
|
-
asc() {
|
|
143
|
-
return Object.freeze({
|
|
144
|
-
kind: 'order' as const,
|
|
145
|
-
expr: operationExpr,
|
|
146
|
-
dir: 'asc' as const,
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
desc() {
|
|
150
|
-
return Object.freeze({
|
|
151
|
-
kind: 'order' as const,
|
|
152
|
-
expr: operationExpr,
|
|
153
|
-
dir: 'desc' as const,
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
_operationExpr: operationExpr,
|
|
157
|
-
} as unknown as AnyColumnBuilder & {
|
|
158
|
-
_operationExpr?: OperationExpr;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
// If the return type is a typeId, attach operations for that type
|
|
162
|
-
if (returnTypeId && operationRegistry) {
|
|
163
|
-
const resultWithOps = attachOperationsToColumnBuilder(
|
|
164
|
-
baseResult as ColumnBuilder<string, StorageColumn, unknown, Record<string, never>>,
|
|
165
|
-
returnColumnMeta,
|
|
166
|
-
operationRegistry,
|
|
167
|
-
contractCapabilities,
|
|
168
|
-
) as AnyColumnBuilder & {
|
|
169
|
-
_operationExpr?: OperationExpr;
|
|
170
|
-
};
|
|
171
|
-
return Object.freeze(resultWithOps);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return Object.freeze(baseResult);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function attachOperationsToColumnBuilder<
|
|
178
|
-
ColumnName extends string,
|
|
179
|
-
ColumnMeta extends StorageColumn,
|
|
180
|
-
JsType = unknown,
|
|
181
|
-
Operations extends OperationTypes = Record<string, never>,
|
|
182
|
-
>(
|
|
183
|
-
columnBuilder: ColumnBuilder<ColumnName, ColumnMeta, JsType, Record<string, never>>,
|
|
184
|
-
columnMeta: ColumnMeta,
|
|
185
|
-
registry: OperationRegistry | undefined,
|
|
186
|
-
contractCapabilities?: Record<string, Record<string, boolean>>,
|
|
187
|
-
): ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations> {
|
|
188
|
-
if (!registry) {
|
|
189
|
-
return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Use codecId to look up operations registered for this column's type
|
|
193
|
-
const codecId = columnMeta.codecId;
|
|
194
|
-
if (!codecId) {
|
|
195
|
-
return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const operations = registry.byType(codecId) as SqlOperationSignature[];
|
|
199
|
-
if (operations.length === 0) {
|
|
200
|
-
return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const builderWithOps = columnBuilder as unknown as ColumnBuilder<
|
|
204
|
-
ColumnName,
|
|
205
|
-
ColumnMeta,
|
|
206
|
-
JsType,
|
|
207
|
-
Operations
|
|
208
|
-
>;
|
|
209
|
-
|
|
210
|
-
for (const operation of operations) {
|
|
211
|
-
if (operation.capabilities && operation.capabilities.length > 0) {
|
|
212
|
-
if (!contractCapabilities) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (!hasAllCapabilities(operation.capabilities, contractCapabilities)) {
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
// Method sugar: attach operation as a method on the column builder
|
|
221
|
-
(builderWithOps as Record<string, unknown>)[operation.method] = function (
|
|
222
|
-
this: ColumnBuilder<ColumnName, ColumnMeta, JsType, Record<string, never>>,
|
|
223
|
-
...args: unknown[]
|
|
224
|
-
) {
|
|
225
|
-
return executeOperation(
|
|
226
|
-
operation,
|
|
227
|
-
this as unknown as ColumnBuilder<string, StorageColumn, unknown>,
|
|
228
|
-
args,
|
|
229
|
-
columnMeta,
|
|
230
|
-
registry,
|
|
231
|
-
contractCapabilities,
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return builderWithOps;
|
|
237
|
-
}
|
package/src/param.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { planInvalid } from '@prisma-next/plan';
|
|
2
|
-
import type { ParamPlaceholder } from './types';
|
|
3
|
-
|
|
4
|
-
export type Parameter = ParamPlaceholder;
|
|
5
|
-
|
|
6
|
-
export function param(name: string): Parameter {
|
|
7
|
-
if (typeof name !== 'string' || name.length === 0) {
|
|
8
|
-
throw planInvalid('Parameter name must be a non-empty string');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return Object.freeze({
|
|
12
|
-
kind: 'param-placeholder' as const,
|
|
13
|
-
name,
|
|
14
|
-
}) satisfies Parameter;
|
|
15
|
-
}
|