@prisma-next/sql-relational-core 0.3.0-dev.12 → 0.3.0-dev.122
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 +18 -1
- package/dist/errors-BNiBIGfC.d.mts +2 -0
- package/dist/errors-DXSQwbhk.mjs +3 -0
- package/dist/exports/ast.d.mts +126 -0
- package/dist/exports/ast.d.mts.map +1 -0
- package/dist/exports/ast.mjs +253 -0
- package/dist/exports/ast.mjs.map +1 -0
- package/dist/exports/errors.d.mts +2 -0
- package/dist/exports/errors.mjs +3 -0
- package/dist/exports/guards.d.mts +5 -0
- package/dist/exports/guards.mjs +3 -0
- package/dist/exports/operations-registry.d.mts +5 -0
- package/dist/exports/operations-registry.mjs +3 -0
- package/dist/exports/param.d.mts +5 -0
- package/dist/exports/param.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 +2 -0
- package/dist/exports/query-lane-context.mjs +1 -0
- package/dist/exports/query-operations.d.mts +2 -0
- package/dist/exports/query-operations.mjs +18 -0
- package/dist/exports/query-operations.mjs.map +1 -0
- package/dist/exports/schema.d.mts +5 -0
- package/dist/exports/schema.mjs +4 -0
- package/dist/exports/types.d.mts +4 -0
- package/dist/exports/types.mjs +3 -0
- package/dist/exports/utils/guards.d.mts +5 -0
- package/dist/exports/utils/guards.mjs +3 -0
- package/dist/guards-D1ax7TKN.mjs +57 -0
- package/dist/guards-D1ax7TKN.mjs.map +1 -0
- package/dist/guards-DC2Ll67p.d.mts +31 -0
- package/dist/guards-DC2Ll67p.d.mts.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +13 -0
- package/dist/operations-registry-CBmGut8O.d.mts +9 -0
- package/dist/operations-registry-CBmGut8O.d.mts.map +1 -0
- package/dist/operations-registry-D8INFH9J.mjs +145 -0
- package/dist/operations-registry-D8INFH9J.mjs.map +1 -0
- package/dist/param-CFyhvphn.mjs +14 -0
- package/dist/param-CFyhvphn.mjs.map +1 -0
- package/dist/param-Cmdv_exJ.d.mts +8 -0
- package/dist/param-Cmdv_exJ.d.mts.map +1 -0
- package/dist/plan-BrZtMUA9.d.mts +517 -0
- package/dist/plan-BrZtMUA9.d.mts.map +1 -0
- package/dist/query-lane-context-BTtg0xm8.d.mts +278 -0
- package/dist/query-lane-context-BTtg0xm8.d.mts.map +1 -0
- package/dist/query-operation-registry-B6bClJs8.d.mts +27 -0
- package/dist/query-operation-registry-B6bClJs8.d.mts.map +1 -0
- package/dist/schema-XcyJSq4j.mjs +174 -0
- package/dist/schema-XcyJSq4j.mjs.map +1 -0
- package/dist/schema-j3Srik3R.d.mts +88 -0
- package/dist/schema-j3Srik3R.d.mts.map +1 -0
- package/dist/types-BZKzxgOb.mjs +18 -0
- package/dist/types-BZKzxgOb.mjs.map +1 -0
- package/dist/types-CMyotK6U.d.mts +443 -0
- package/dist/types-CMyotK6U.d.mts.map +1 -0
- package/dist/types-I6Hsg-GU.mjs +1102 -0
- package/dist/types-I6Hsg-GU.mjs.map +1 -0
- package/package.json +37 -53
- package/src/ast/codec-types.ts +123 -22
- package/src/ast/driver-types.ts +20 -3
- package/src/ast/join.ts +3 -23
- package/src/ast/sql-codecs.ts +81 -0
- package/src/ast/types.ts +1704 -74
- package/src/exports/ast.ts +1 -7
- package/src/exports/guards.ts +3 -4
- package/src/exports/query-operations.ts +1 -0
- package/src/exports/utils/guards.ts +1 -0
- package/src/operations-registry.ts +115 -89
- package/src/plan.ts +4 -4
- package/src/query-lane-context.ts +79 -1
- package/src/query-operation-registry.ts +35 -0
- package/src/schema.ts +104 -43
- package/src/types.ts +333 -84
- package/src/utils/guards.ts +44 -80
- 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-CBTYMOX2.js +0 -152
- package/dist/chunk-CBTYMOX2.js.map +0 -1
- package/dist/chunk-G52ENULI.js +0 -1
- package/dist/chunk-G52ENULI.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-MM74SVJ4.js +0 -13
- package/dist/chunk-MM74SVJ4.js.map +0 -1
- package/dist/chunk-U7AXAUJA.js +0 -1
- package/dist/chunk-U7AXAUJA.js.map +0 -1
- package/dist/chunk-WZBPVEZI.js +0 -320
- package/dist/chunk-WZBPVEZI.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/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/utils/guards.ts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import type { StorageColumn } from '@prisma-next/sql-contract/types';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { ExpressionSource, OperationExpr } from '../ast/types';
|
|
3
|
+
import type {
|
|
4
|
+
AnyColumnBuilder,
|
|
5
|
+
AnyExpressionSource,
|
|
6
|
+
ExpressionBuilder,
|
|
7
|
+
ParamPlaceholder,
|
|
8
|
+
ValueSource,
|
|
9
|
+
} from '../types';
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
* Helper to extract columnMeta from a ColumnBuilder.
|
|
7
|
-
* Returns StorageColumn if present, undefined otherwise.
|
|
8
|
-
* AnyColumnBuilder is a union that includes types with columnMeta property,
|
|
9
|
-
* so we can safely access it after checking for existence.
|
|
10
|
-
*/
|
|
11
|
-
export function getColumnMeta(expr: AnyColumnBuilder): StorageColumn | undefined {
|
|
12
|
-
// AnyColumnBuilder includes AnyColumnBuilderBase which has columnMeta: StorageColumn
|
|
13
|
-
// and ColumnBuilder which has columnMeta: ColumnMeta extends StorageColumn
|
|
14
|
-
// TypeScript should narrow the type after the 'in' check
|
|
11
|
+
export function getColumnMeta(expr: AnyExpressionSource): StorageColumn | undefined {
|
|
15
12
|
if ('columnMeta' in expr) {
|
|
16
13
|
return expr.columnMeta;
|
|
17
14
|
}
|
|
18
15
|
return undefined;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
/**
|
|
22
|
-
* Type predicate to check if a value is a ParamPlaceholder.
|
|
23
|
-
*/
|
|
24
18
|
export function isParamPlaceholder(value: unknown): value is ParamPlaceholder {
|
|
25
19
|
return (
|
|
26
20
|
typeof value === 'object' &&
|
|
@@ -32,57 +26,18 @@ export function isParamPlaceholder(value: unknown): value is ParamPlaceholder {
|
|
|
32
26
|
);
|
|
33
27
|
}
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
* Recursively extracts the base ColumnRef from an OperationExpr.
|
|
37
|
-
* If the expression is already a ColumnRef, it is returned directly.
|
|
38
|
-
*/
|
|
39
|
-
export function extractBaseColumnRef(expr: ColumnRef | OperationExpr): ColumnRef {
|
|
40
|
-
if (expr.kind === 'col') {
|
|
41
|
-
return expr;
|
|
42
|
-
}
|
|
43
|
-
return extractBaseColumnRef(expr.self);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Recursively collects all ColumnRef nodes from an expression tree.
|
|
48
|
-
* Handles nested OperationExpr structures by traversing both self and args.
|
|
49
|
-
*/
|
|
50
|
-
export function collectColumnRefs(
|
|
51
|
-
expr: ColumnRef | ParamRef | LiteralExpr | OperationExpr,
|
|
52
|
-
): ColumnRef[] {
|
|
53
|
-
if (expr.kind === 'col') {
|
|
54
|
-
return [expr];
|
|
55
|
-
}
|
|
56
|
-
if (expr.kind === 'operation') {
|
|
57
|
-
const refs: ColumnRef[] = collectColumnRefs(expr.self);
|
|
58
|
-
for (const arg of expr.args) {
|
|
59
|
-
refs.push(...collectColumnRefs(arg));
|
|
60
|
-
}
|
|
61
|
-
return refs;
|
|
62
|
-
}
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Type predicate to check if an expression is an OperationExpr.
|
|
68
|
-
*/
|
|
69
|
-
export function isOperationExpr(expr: AnyColumnBuilder | OperationExpr): expr is OperationExpr {
|
|
70
|
-
return typeof expr === 'object' && expr !== null && 'kind' in expr && expr.kind === 'operation';
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Helper to extract table and column from a ColumnBuilder or OperationExpr.
|
|
75
|
-
* For OperationExpr, recursively unwraps to find the base ColumnRef.
|
|
76
|
-
*/
|
|
77
|
-
export function getColumnInfo(expr: AnyColumnBuilder | OperationExpr): {
|
|
29
|
+
export function getColumnInfo(expr: AnyExpressionSource | OperationExpr): {
|
|
78
30
|
table: string;
|
|
79
31
|
column: string;
|
|
80
32
|
} {
|
|
81
|
-
if (
|
|
82
|
-
const baseCol =
|
|
33
|
+
if (expr.kind === 'operation') {
|
|
34
|
+
const baseCol = expr.baseColumnRef();
|
|
35
|
+
return { table: baseCol.table, column: baseCol.column };
|
|
36
|
+
}
|
|
37
|
+
if (isExpressionBuilder(expr)) {
|
|
38
|
+
const baseCol = expr.expr.baseColumnRef();
|
|
83
39
|
return { table: baseCol.table, column: baseCol.column };
|
|
84
40
|
}
|
|
85
|
-
// expr is ColumnBuilder - TypeScript can't narrow properly
|
|
86
41
|
const colBuilder = expr as unknown as { table: string; column: string };
|
|
87
42
|
return { table: colBuilder.table, column: colBuilder.column };
|
|
88
43
|
}
|
|
@@ -100,24 +55,33 @@ export function isColumnBuilder(value: unknown): value is AnyColumnBuilder {
|
|
|
100
55
|
}
|
|
101
56
|
|
|
102
57
|
/**
|
|
103
|
-
*
|
|
104
|
-
* Returns the OperationExpr if the builder is an OperationExpr or has an _operationExpr property,
|
|
105
|
-
* otherwise returns undefined.
|
|
106
|
-
*
|
|
107
|
-
* @design-note: This function accesses the hidden `_operationExpr` property, which is a code smell.
|
|
108
|
-
* The issue is that `executeOperation()` in relational-core returns a ColumnBuilder-shaped object
|
|
109
|
-
* with a hidden `_operationExpr` property, creating coupling between lanes and relational-core
|
|
110
|
-
* implementation details. A cleaner design would be to have operation results be a separate
|
|
111
|
-
* type (e.g., `OperationResultBuilder`) that properly represents expression nodes rather than
|
|
112
|
-
* pretending to be a ColumnBuilder. This would require refactoring the operation execution
|
|
113
|
-
* system in relational-core to return proper expression types.
|
|
58
|
+
* Type predicate to check if a value is an ExpressionBuilder.
|
|
114
59
|
*/
|
|
115
|
-
export function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
60
|
+
export function isExpressionBuilder(value: unknown): value is ExpressionBuilder {
|
|
61
|
+
return (
|
|
62
|
+
typeof value === 'object' &&
|
|
63
|
+
value !== null &&
|
|
64
|
+
'kind' in value &&
|
|
65
|
+
(value as { kind: unknown }).kind === 'expression'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Type predicate to check if a value is an ExpressionSource (has toExpr method).
|
|
71
|
+
*/
|
|
72
|
+
export function isExpressionSource(value: unknown): value is ExpressionSource {
|
|
73
|
+
return (
|
|
74
|
+
typeof value === 'object' &&
|
|
75
|
+
value !== null &&
|
|
76
|
+
'toExpr' in value &&
|
|
77
|
+
typeof (value as ExpressionSource).toExpr === 'function'
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Type predicate to check if a value is a ValueSource.
|
|
83
|
+
* ValueSource is either a ParamPlaceholder or an ExpressionSource.
|
|
84
|
+
*/
|
|
85
|
+
export function isValueSource(value: unknown): value is ValueSource {
|
|
86
|
+
return isParamPlaceholder(value) || isExpressionSource(value);
|
|
123
87
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CodecRegistry } from './codec-types';
|
|
2
|
-
export type AdapterTarget = string;
|
|
3
|
-
export interface AdapterProfile<TTarget extends AdapterTarget = AdapterTarget> {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly target: TTarget;
|
|
6
|
-
readonly capabilities: Record<string, unknown>;
|
|
7
|
-
/**
|
|
8
|
-
* Returns the adapter's default codec registry.
|
|
9
|
-
* The registry contains codecs provided by the adapter for converting
|
|
10
|
-
* between wire types and JavaScript types.
|
|
11
|
-
*/
|
|
12
|
-
codecs(): CodecRegistry;
|
|
13
|
-
}
|
|
14
|
-
export interface LoweredPayload<TBody = unknown> {
|
|
15
|
-
readonly profileId?: string;
|
|
16
|
-
readonly body: TBody;
|
|
17
|
-
readonly annotations?: Record<string, unknown>;
|
|
18
|
-
}
|
|
19
|
-
export interface LowererContext<TContract = unknown> {
|
|
20
|
-
readonly contract: TContract;
|
|
21
|
-
readonly params?: readonly unknown[];
|
|
22
|
-
}
|
|
23
|
-
export type Lowerer<Ast = unknown, TContract = unknown, TBody = unknown> = (ast: Ast, context: LowererContext<TContract>) => LoweredPayload<TBody>;
|
|
24
|
-
export interface Adapter<Ast = unknown, TContract = unknown, TBody = unknown> {
|
|
25
|
-
readonly profile: AdapterProfile;
|
|
26
|
-
lower(ast: Ast, context: LowererContext<TContract>): LoweredPayload<TBody>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=adapter-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-types.d.ts","sourceRoot":"","sources":["../../src/ast/adapter-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,aAAa,GAAG,aAAa;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C;;;;OAIG;IACH,MAAM,IAAI,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,OAAO;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,cAAc,CAAC,SAAS,GAAG,OAAO;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACtC;AAED,MAAM,MAAM,OAAO,CAAC,GAAG,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO,IAAI,CACzE,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,KAC/B,cAAc,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,WAAW,OAAO,CAAC,GAAG,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO;IAC1E,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;CAC5E"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type { O } from 'ts-toolbelt';
|
|
2
|
-
/**
|
|
3
|
-
* Codec metadata for database-specific type information.
|
|
4
|
-
* Used for schema introspection and verification.
|
|
5
|
-
*/
|
|
6
|
-
export interface CodecMeta {
|
|
7
|
-
readonly db?: {
|
|
8
|
-
readonly sql?: {
|
|
9
|
-
readonly postgres?: {
|
|
10
|
-
readonly nativeType: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Codec interface for encoding/decoding values between wire format and JavaScript types.
|
|
17
|
-
*
|
|
18
|
-
* Codecs are pure, synchronous functions with no side effects or IO.
|
|
19
|
-
* They provide deterministic conversion between database wire types and JS values.
|
|
20
|
-
*/
|
|
21
|
-
export interface Codec<Id extends string = string, TWire = unknown, TJs = unknown> {
|
|
22
|
-
/**
|
|
23
|
-
* Namespaced codec identifier in format 'namespace/name@version'
|
|
24
|
-
* Examples: 'pg/text@1', 'pg/uuid@1', 'pg/timestamptz@1'
|
|
25
|
-
*/
|
|
26
|
-
readonly id: Id;
|
|
27
|
-
/**
|
|
28
|
-
* Contract scalar type IDs that this codec can handle.
|
|
29
|
-
* Examples: ['text'], ['int4', 'float8'], ['timestamp', 'timestamptz']
|
|
30
|
-
*/
|
|
31
|
-
readonly targetTypes: readonly string[];
|
|
32
|
-
/**
|
|
33
|
-
* Optional metadata for database-specific type information.
|
|
34
|
-
* Used for schema introspection and verification.
|
|
35
|
-
*/
|
|
36
|
-
readonly meta?: CodecMeta;
|
|
37
|
-
/**
|
|
38
|
-
* Decode a wire value (from database) to JavaScript type.
|
|
39
|
-
* Must be synchronous and pure (no side effects).
|
|
40
|
-
*/
|
|
41
|
-
decode(wire: TWire): TJs;
|
|
42
|
-
/**
|
|
43
|
-
* Encode a JavaScript value to wire format (for database).
|
|
44
|
-
* Optional - if not provided, values pass through unchanged.
|
|
45
|
-
* Must be synchronous and pure (no side effects).
|
|
46
|
-
*/
|
|
47
|
-
encode?(value: TJs): TWire;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Registry interface for codecs organized by ID and by contract scalar type.
|
|
51
|
-
*
|
|
52
|
-
* The registry allows looking up codecs by their namespaced ID or by the
|
|
53
|
-
* contract scalar types they handle. Multiple codecs may handle the same
|
|
54
|
-
* scalar type; ordering in byScalar reflects preference (adapter first,
|
|
55
|
-
* then packs, then app overrides).
|
|
56
|
-
*/
|
|
57
|
-
export interface CodecRegistry {
|
|
58
|
-
get(id: string): Codec<string> | undefined;
|
|
59
|
-
has(id: string): boolean;
|
|
60
|
-
getByScalar(scalar: string): readonly Codec<string>[];
|
|
61
|
-
getDefaultCodec(scalar: string): Codec<string> | undefined;
|
|
62
|
-
register(codec: Codec<string>): void;
|
|
63
|
-
[Symbol.iterator](): Iterator<Codec<string>>;
|
|
64
|
-
values(): IterableIterator<Codec<string>>;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Codec factory - creates a codec with typeId and encode/decode functions.
|
|
68
|
-
*/
|
|
69
|
-
export declare function codec<Id extends string, TWire, TJs>(config: {
|
|
70
|
-
typeId: Id;
|
|
71
|
-
targetTypes: readonly string[];
|
|
72
|
-
encode: (value: TJs) => TWire;
|
|
73
|
-
decode: (wire: TWire) => TJs;
|
|
74
|
-
meta?: CodecMeta;
|
|
75
|
-
}): Codec<Id, TWire, TJs>;
|
|
76
|
-
/**
|
|
77
|
-
* Type helpers to extract codec types.
|
|
78
|
-
*/
|
|
79
|
-
export type CodecId<T> = T extends Codec<infer Id, unknown, unknown> ? Id : T extends {
|
|
80
|
-
readonly id: infer Id;
|
|
81
|
-
} ? Id : never;
|
|
82
|
-
export type CodecInput<T> = T extends Codec<string, unknown, infer JsT> ? JsT : never;
|
|
83
|
-
export type CodecOutput<T> = T extends Codec<string, unknown, infer JsT> ? JsT : never;
|
|
84
|
-
/**
|
|
85
|
-
* Type helper to extract codec types from builder instance.
|
|
86
|
-
*/
|
|
87
|
-
export type ExtractCodecTypes<ScalarNames extends {
|
|
88
|
-
readonly [K in keyof ScalarNames]: Codec<string>;
|
|
89
|
-
} = Record<never, never>> = {
|
|
90
|
-
readonly [K in keyof ScalarNames as ScalarNames[K] extends Codec<infer Id, unknown, unknown> ? Id : never]: {
|
|
91
|
-
readonly input: CodecInput<ScalarNames[K]>;
|
|
92
|
-
readonly output: CodecOutput<ScalarNames[K]>;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Type helper to extract data type IDs from builder instance.
|
|
97
|
-
* Uses ExtractCodecTypes which preserves literal types as keys.
|
|
98
|
-
* Since ExtractCodecTypes<Record<K, ScalarNames[K]>> has exactly one key (the Id),
|
|
99
|
-
* we extract it by creating a mapped type that uses the Id as both key and value,
|
|
100
|
-
* then extract the value type. This preserves literal types.
|
|
101
|
-
*/
|
|
102
|
-
export type ExtractDataTypes<ScalarNames extends {
|
|
103
|
-
readonly [K in keyof ScalarNames]: Codec<string>;
|
|
104
|
-
}> = {
|
|
105
|
-
readonly [K in keyof ScalarNames]: {
|
|
106
|
-
readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;
|
|
107
|
-
}[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Builder interface for declaring codecs.
|
|
111
|
-
*/
|
|
112
|
-
export interface CodecDefBuilder<ScalarNames extends {
|
|
113
|
-
readonly [K in keyof ScalarNames]: Codec<string>;
|
|
114
|
-
} = Record<never, never>> {
|
|
115
|
-
readonly CodecTypes: ExtractCodecTypes<ScalarNames>;
|
|
116
|
-
add<ScalarName extends string, CodecImpl extends Codec<string>>(scalarName: ScalarName, codecImpl: CodecImpl): CodecDefBuilder<O.Overwrite<ScalarNames, Record<ScalarName, CodecImpl>> & Record<ScalarName, CodecImpl>>;
|
|
117
|
-
readonly codecDefinitions: {
|
|
118
|
-
readonly [K in keyof ScalarNames]: {
|
|
119
|
-
readonly typeId: ScalarNames[K] extends Codec<infer Id extends string, unknown, unknown> ? Id : never;
|
|
120
|
-
readonly scalar: K;
|
|
121
|
-
readonly codec: ScalarNames[K];
|
|
122
|
-
readonly input: CodecInput<ScalarNames[K]>;
|
|
123
|
-
readonly output: CodecOutput<ScalarNames[K]>;
|
|
124
|
-
readonly jsType: CodecOutput<ScalarNames[K]>;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
readonly dataTypes: {
|
|
128
|
-
readonly [K in keyof ScalarNames]: {
|
|
129
|
-
readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;
|
|
130
|
-
}[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Create a new codec registry.
|
|
135
|
-
*/
|
|
136
|
-
export declare function createCodecRegistry(): CodecRegistry;
|
|
137
|
-
/**
|
|
138
|
-
* Create a new codec definition builder.
|
|
139
|
-
*/
|
|
140
|
-
export declare function defineCodecs(): CodecDefBuilder<Record<never, never>>;
|
|
141
|
-
//# sourceMappingURL=codec-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types.d.ts","sourceRoot":"","sources":["../../src/ast/codec-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE;QACZ,QAAQ,CAAC,GAAG,CAAC,EAAE;YACb,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;aAC7B,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,KAAK,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO;IAC/E;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAExC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC;IAEzB;;;;OAIG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,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C,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;SACxE,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACtD,CAAC;CACH;AAkHD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAEpE"}
|
package/dist/ast/common.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ColumnRef, LiteralExpr, OperationExpr, ParamRef, TableRef } from './types';
|
|
2
|
-
export declare function createTableRef(name: string): TableRef;
|
|
3
|
-
export declare function createColumnRef(table: string, column: string): ColumnRef;
|
|
4
|
-
export declare function createParamRef(index: number, name?: string): ParamRef;
|
|
5
|
-
export declare function createOperationExpr(operation: OperationExpr): OperationExpr;
|
|
6
|
-
export declare function createLiteralExpr(value: unknown): LiteralExpr;
|
|
7
|
-
//# sourceMappingURL=common.d.ts.map
|
package/dist/ast/common.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/ast/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGzF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAKrD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAMxE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAMrE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,aAAa,GAAG,aAAa,CAE3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAK7D"}
|
package/dist/ast/delete.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BinaryExpr, ColumnRef, DeleteAst, TableRef } from './types';
|
|
2
|
-
export interface CreateDeleteAstOptions {
|
|
3
|
-
readonly table: TableRef;
|
|
4
|
-
readonly where: BinaryExpr;
|
|
5
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
6
|
-
}
|
|
7
|
-
export declare function createDeleteAst(options: CreateDeleteAstOptions): DeleteAst;
|
|
8
|
-
//# sourceMappingURL=delete.d.ts.map
|
package/dist/ast/delete.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/ast/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG1E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAO1E"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface SqlExecuteRequest {
|
|
2
|
-
readonly sql: string;
|
|
3
|
-
readonly params?: readonly unknown[];
|
|
4
|
-
}
|
|
5
|
-
export interface SqlQueryResult<Row = Record<string, unknown>> {
|
|
6
|
-
readonly rows: ReadonlyArray<Row>;
|
|
7
|
-
readonly rowCount?: number | null;
|
|
8
|
-
readonly [key: string]: unknown;
|
|
9
|
-
}
|
|
10
|
-
export interface SqlExplainResult<Row = Record<string, unknown>> {
|
|
11
|
-
readonly rows: ReadonlyArray<Row>;
|
|
12
|
-
}
|
|
13
|
-
export interface SqlDriver {
|
|
14
|
-
connect(): Promise<void>;
|
|
15
|
-
execute<Row = Record<string, unknown>>(request: SqlExecuteRequest): AsyncIterable<Row>;
|
|
16
|
-
explain?(request: SqlExecuteRequest): Promise<SqlExplainResult>;
|
|
17
|
-
query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<SqlQueryResult<Row>>;
|
|
18
|
-
close(): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=driver-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"driver-types.d.ts","sourceRoot":"","sources":["../../src/ast/driver-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,cAAc,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7D,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACvF,OAAO,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChE,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAC1B,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
package/dist/ast/insert.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ColumnRef, InsertAst, ParamRef, TableRef } from './types';
|
|
2
|
-
export interface CreateInsertAstOptions {
|
|
3
|
-
readonly table: TableRef;
|
|
4
|
-
readonly values: Record<string, ColumnRef | ParamRef>;
|
|
5
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
6
|
-
}
|
|
7
|
-
export declare function createInsertAst(options: CreateInsertAstOptions): InsertAst;
|
|
8
|
-
//# sourceMappingURL=insert.d.ts.map
|
package/dist/ast/insert.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/ast/insert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAO1E"}
|
package/dist/ast/join.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { JoinOnBuilder } from '../types';
|
|
2
|
-
import type { ColumnRef, JoinAst, JoinOnExpr, TableRef } from './types';
|
|
3
|
-
export declare function createJoin(joinType: 'inner' | 'left' | 'right' | 'full', table: TableRef, on: JoinOnExpr): JoinAst;
|
|
4
|
-
export declare function createJoinOnExpr(left: ColumnRef, right: ColumnRef): JoinOnExpr;
|
|
5
|
-
export declare function createJoinOnBuilder(): JoinOnBuilder;
|
|
6
|
-
//# sourceMappingURL=join.d.ts.map
|
package/dist/ast/join.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../src/ast/join.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,aAAa,EAAmB,MAAM,UAAU,CAAC;AAEjF,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExE,wBAAgB,UAAU,CACxB,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAC7C,KAAK,EAAE,QAAQ,EACf,EAAE,EAAE,UAAU,GACb,OAAO,CAOT;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,UAAU,CAM9E;AA2BD,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|
package/dist/ast/order.d.ts
DELETED
package/dist/ast/order.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/ast/order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEnE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,GAAG,aAAa,EAC/B,GAAG,EAAE,KAAK,GAAG,MAAM,GAClB;IAAE,IAAI,EAAE,SAAS,GAAG,aAAa,CAAC;IAAC,GAAG,EAAE,SAAS,CAAA;CAAE,CAKrD"}
|
package/dist/ast/predicate.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { BinaryExpr, BinaryOp, ColumnRef, ExistsExpr, OperationExpr, ParamRef, SelectAst } from './types';
|
|
2
|
-
export declare function createBinaryExpr(op: BinaryOp, left: ColumnRef | OperationExpr, right: ColumnRef | ParamRef): BinaryExpr;
|
|
3
|
-
export declare function createExistsExpr(not: boolean, subquery: SelectAst): ExistsExpr;
|
|
4
|
-
//# sourceMappingURL=predicate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../src/ast/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACV,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,SAAS,GAAG,aAAa,EAC/B,KAAK,EAAE,SAAS,GAAG,QAAQ,GAC1B,UAAU,CAOZ;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,GAAG,UAAU,CAM9E"}
|
package/dist/ast/select.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { BinaryExpr, ColumnRef, Direction, ExistsExpr, IncludeAst, IncludeRef, JoinAst, OperationExpr, SelectAst, TableRef } from './types';
|
|
2
|
-
export interface CreateSelectAstOptions {
|
|
3
|
-
readonly from: TableRef;
|
|
4
|
-
readonly joins?: ReadonlyArray<JoinAst>;
|
|
5
|
-
readonly includes?: ReadonlyArray<IncludeAst>;
|
|
6
|
-
readonly project: ReadonlyArray<{
|
|
7
|
-
alias: string;
|
|
8
|
-
expr: ColumnRef | IncludeRef | OperationExpr;
|
|
9
|
-
}>;
|
|
10
|
-
readonly where?: BinaryExpr | ExistsExpr;
|
|
11
|
-
readonly orderBy?: ReadonlyArray<{
|
|
12
|
-
expr: ColumnRef | OperationExpr;
|
|
13
|
-
dir: Direction;
|
|
14
|
-
}>;
|
|
15
|
-
readonly limit?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare function createSelectAst(options: CreateSelectAstOptions): SelectAst;
|
|
18
|
-
//# sourceMappingURL=select.d.ts.map
|
package/dist/ast/select.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ast/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,aAAa,EACb,SAAS,EACT,QAAQ,EACT,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;KAC9C,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,SAAS,GAAG,aAAa,CAAC;QAAC,GAAG,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAW1E"}
|
package/dist/ast/types.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import type { ReturnSpec } from '@prisma-next/operations';
|
|
2
|
-
import type { SqlLoweringSpec } from '@prisma-next/sql-operations';
|
|
3
|
-
export type Direction = 'asc' | 'desc';
|
|
4
|
-
export interface TableRef {
|
|
5
|
-
readonly kind: 'table';
|
|
6
|
-
readonly name: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ColumnRef {
|
|
9
|
-
readonly kind: 'col';
|
|
10
|
-
readonly table: string;
|
|
11
|
-
readonly column: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ParamRef {
|
|
14
|
-
readonly kind: 'param';
|
|
15
|
-
readonly index: number;
|
|
16
|
-
readonly name?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface LiteralExpr {
|
|
19
|
-
readonly kind: 'literal';
|
|
20
|
-
readonly value: unknown;
|
|
21
|
-
}
|
|
22
|
-
export interface OperationExpr {
|
|
23
|
-
readonly kind: 'operation';
|
|
24
|
-
readonly method: string;
|
|
25
|
-
readonly forTypeId: string;
|
|
26
|
-
readonly self: ColumnRef | OperationExpr;
|
|
27
|
-
readonly args: ReadonlyArray<ColumnRef | ParamRef | LiteralExpr | OperationExpr>;
|
|
28
|
-
readonly returns: ReturnSpec;
|
|
29
|
-
readonly lowering: SqlLoweringSpec;
|
|
30
|
-
}
|
|
31
|
-
export declare function isOperationExpr(expr: ColumnRef | OperationExpr): expr is OperationExpr;
|
|
32
|
-
export type BinaryOp = 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte';
|
|
33
|
-
export interface BinaryExpr {
|
|
34
|
-
readonly kind: 'bin';
|
|
35
|
-
readonly op: BinaryOp;
|
|
36
|
-
readonly left: ColumnRef | OperationExpr;
|
|
37
|
-
readonly right: ColumnRef | ParamRef;
|
|
38
|
-
}
|
|
39
|
-
export interface ExistsExpr {
|
|
40
|
-
readonly kind: 'exists';
|
|
41
|
-
readonly not: boolean;
|
|
42
|
-
readonly subquery: SelectAst;
|
|
43
|
-
}
|
|
44
|
-
export type JoinOnExpr = {
|
|
45
|
-
readonly kind: 'eqCol';
|
|
46
|
-
readonly left: ColumnRef;
|
|
47
|
-
readonly right: ColumnRef;
|
|
48
|
-
};
|
|
49
|
-
export interface JoinAst {
|
|
50
|
-
readonly kind: 'join';
|
|
51
|
-
readonly joinType: 'inner' | 'left' | 'right' | 'full';
|
|
52
|
-
readonly table: TableRef;
|
|
53
|
-
readonly on: JoinOnExpr;
|
|
54
|
-
}
|
|
55
|
-
export interface IncludeRef {
|
|
56
|
-
readonly kind: 'includeRef';
|
|
57
|
-
readonly alias: string;
|
|
58
|
-
}
|
|
59
|
-
export interface IncludeAst {
|
|
60
|
-
readonly kind: 'includeMany';
|
|
61
|
-
readonly alias: string;
|
|
62
|
-
readonly child: {
|
|
63
|
-
readonly table: TableRef;
|
|
64
|
-
readonly on: JoinOnExpr;
|
|
65
|
-
readonly where?: BinaryExpr | ExistsExpr;
|
|
66
|
-
readonly orderBy?: ReadonlyArray<{
|
|
67
|
-
expr: ColumnRef | OperationExpr;
|
|
68
|
-
dir: Direction;
|
|
69
|
-
}>;
|
|
70
|
-
readonly limit?: number;
|
|
71
|
-
readonly project: ReadonlyArray<{
|
|
72
|
-
alias: string;
|
|
73
|
-
expr: ColumnRef | OperationExpr;
|
|
74
|
-
}>;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export interface SelectAst {
|
|
78
|
-
readonly kind: 'select';
|
|
79
|
-
readonly from: TableRef;
|
|
80
|
-
readonly joins?: ReadonlyArray<JoinAst>;
|
|
81
|
-
readonly includes?: ReadonlyArray<IncludeAst>;
|
|
82
|
-
readonly project: ReadonlyArray<{
|
|
83
|
-
alias: string;
|
|
84
|
-
expr: ColumnRef | IncludeRef | OperationExpr | LiteralExpr;
|
|
85
|
-
}>;
|
|
86
|
-
readonly where?: BinaryExpr | ExistsExpr;
|
|
87
|
-
readonly orderBy?: ReadonlyArray<{
|
|
88
|
-
expr: ColumnRef | OperationExpr;
|
|
89
|
-
dir: Direction;
|
|
90
|
-
}>;
|
|
91
|
-
readonly limit?: number;
|
|
92
|
-
}
|
|
93
|
-
export interface InsertAst {
|
|
94
|
-
readonly kind: 'insert';
|
|
95
|
-
readonly table: TableRef;
|
|
96
|
-
readonly values: Record<string, ColumnRef | ParamRef>;
|
|
97
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
98
|
-
}
|
|
99
|
-
export interface UpdateAst {
|
|
100
|
-
readonly kind: 'update';
|
|
101
|
-
readonly table: TableRef;
|
|
102
|
-
readonly set: Record<string, ColumnRef | ParamRef>;
|
|
103
|
-
readonly where: BinaryExpr;
|
|
104
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
105
|
-
}
|
|
106
|
-
export interface DeleteAst {
|
|
107
|
-
readonly kind: 'delete';
|
|
108
|
-
readonly table: TableRef;
|
|
109
|
-
readonly where: BinaryExpr;
|
|
110
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
111
|
-
}
|
|
112
|
-
export type QueryAst = SelectAst | InsertAst | UpdateAst | DeleteAst;
|
|
113
|
-
export interface LoweredStatement {
|
|
114
|
-
readonly sql: string;
|
|
115
|
-
readonly params: readonly unknown[];
|
|
116
|
-
readonly annotations?: Record<string, unknown>;
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/ast/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAKnE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,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C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD"}
|
package/dist/ast/update.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BinaryExpr, ColumnRef, ParamRef, TableRef, UpdateAst } from './types';
|
|
2
|
-
export interface CreateUpdateAstOptions {
|
|
3
|
-
readonly table: TableRef;
|
|
4
|
-
readonly set: Record<string, ColumnRef | ParamRef>;
|
|
5
|
-
readonly where: BinaryExpr;
|
|
6
|
-
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
7
|
-
}
|
|
8
|
-
export declare function createUpdateAst(options: CreateUpdateAstOptions): UpdateAst;
|
|
9
|
-
//# sourceMappingURL=update.d.ts.map
|
package/dist/ast/update.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/ast/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAQ1E"}
|
package/dist/ast/util.d.ts
DELETED
package/dist/ast/util.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/ast/util.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAQlE"}
|
package/dist/chunk-2F7DSEOU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["export { planInvalid, planUnsupported } from '@prisma-next/plan';\n"],"mappings":";AAAA,SAAS,aAAa,uBAAuB;","names":[]}
|
package/dist/chunk-36WJWNHT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-36WJWNHT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|