@prisma-next/sql-builder 0.0.1 → 0.3.0-dev.128
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/dist/db-DB_rRT9u.d.mts +318 -0
- package/dist/db-DB_rRT9u.d.mts.map +1 -0
- package/dist/exports/types.d.mts +2 -0
- package/dist/exports/types.mjs +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/runtime/index.d.mts +34 -0
- package/dist/runtime/index.d.mts.map +1 -0
- package/dist/runtime/index.mjs +769 -0
- package/dist/runtime/index.mjs.map +1 -0
- package/package.json +35 -35
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2026] [Prisma Data, Inc]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import * as _prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
|
|
2
|
+
import { AnyFromSource, SelectAst } from "@prisma-next/sql-relational-core/ast";
|
|
3
|
+
import { ExtractCodecTypes, ExtractQueryOperationTypes, QueryOperationTypesBase, StorageTable, StorageTable as StorageTable$1 } from "@prisma-next/sql-contract/types";
|
|
4
|
+
import { SqlQueryPlan } from "@prisma-next/sql-relational-core/plan";
|
|
5
|
+
|
|
6
|
+
//#region src/scope.d.ts
|
|
7
|
+
type GatedMethod<Capabilities, Required, Method> = Capabilities extends Required ? Method : never;
|
|
8
|
+
type CodecTypesBase = Record<string, {
|
|
9
|
+
readonly input: unknown;
|
|
10
|
+
readonly output: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
declare const ExpressionType: unique symbol;
|
|
13
|
+
declare const JoinOuterScope: unique symbol;
|
|
14
|
+
declare const SubqueryMarker: unique symbol;
|
|
15
|
+
type Expand<T> = { [K in keyof T]: T[K] } & unknown;
|
|
16
|
+
type EmptyRow = Record<never, ScopeField>;
|
|
17
|
+
type ScopeField = {
|
|
18
|
+
codecId: string;
|
|
19
|
+
nullable: boolean;
|
|
20
|
+
};
|
|
21
|
+
type ScopeTable = Record<string, ScopeField>;
|
|
22
|
+
type Scope = {
|
|
23
|
+
topLevel: ScopeTable;
|
|
24
|
+
namespaces: Record<string, ScopeTable>;
|
|
25
|
+
};
|
|
26
|
+
type JoinSource<Row extends ScopeTable, Alias extends string> = {
|
|
27
|
+
readonly [JoinOuterScope]: {
|
|
28
|
+
topLevel: Row;
|
|
29
|
+
namespaces: Record<Alias, Row>;
|
|
30
|
+
};
|
|
31
|
+
getJoinOuterScope(): Scope;
|
|
32
|
+
buildAst(): AnyFromSource;
|
|
33
|
+
};
|
|
34
|
+
type DefaultScope<Name$1 extends string, Table extends StorageTable$1> = {
|
|
35
|
+
topLevel: StorageTableToScopeTable<Table>;
|
|
36
|
+
namespaces: { [K in Name$1]: StorageTableToScopeTable<Table> };
|
|
37
|
+
};
|
|
38
|
+
type StorageTableToScopeTable<T extends StorageTable$1> = { [K in keyof T['columns']]: {
|
|
39
|
+
codecId: T['columns'][K]['codecId'];
|
|
40
|
+
nullable: T['columns'][K]['nullable'];
|
|
41
|
+
} };
|
|
42
|
+
type MergeScopes<A extends Scope, B extends Scope> = {
|
|
43
|
+
topLevel: Expand<Omit<A['topLevel'], keyof B['topLevel']> & Omit<B['topLevel'], keyof A['topLevel']>>;
|
|
44
|
+
namespaces: Expand<A['namespaces'] & B['namespaces']>;
|
|
45
|
+
};
|
|
46
|
+
type RebindScope<S extends Scope, OldKey extends string, NewKey extends string> = {
|
|
47
|
+
topLevel: S['topLevel'];
|
|
48
|
+
namespaces: Expand<Omit<S['namespaces'], OldKey> & Record<NewKey, S['namespaces'][OldKey]>>;
|
|
49
|
+
};
|
|
50
|
+
type NullableScopeTable<S extends ScopeTable> = { [K in keyof S]: {
|
|
51
|
+
codecId: S[K]['codecId'];
|
|
52
|
+
nullable: true;
|
|
53
|
+
} };
|
|
54
|
+
type NullableScope<S extends Scope> = {
|
|
55
|
+
topLevel: NullableScopeTable<S['topLevel']>;
|
|
56
|
+
namespaces: { [TableName in keyof S['namespaces']]: NullableScopeTable<S['namespaces'][TableName]> };
|
|
57
|
+
};
|
|
58
|
+
type Subquery<RowType extends Record<string, ScopeField>> = {
|
|
59
|
+
[SubqueryMarker]: RowType;
|
|
60
|
+
buildAst(): SelectAst;
|
|
61
|
+
getRowFields(): Record<string, ScopeField>;
|
|
62
|
+
};
|
|
63
|
+
type QueryContext = {
|
|
64
|
+
readonly codecTypes: CodecTypesBase;
|
|
65
|
+
readonly capabilities: Record<string, Record<string, boolean>>;
|
|
66
|
+
readonly queryOperationTypes: QueryOperationTypesBase;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/expression.d.ts
|
|
70
|
+
type Expression<T extends ScopeField> = {
|
|
71
|
+
[ExpressionType]: T;
|
|
72
|
+
buildAst(): _prisma_next_sql_relational_core_ast0.AnyExpression;
|
|
73
|
+
};
|
|
74
|
+
type WithField<Source, Field extends ScopeField, Alias extends string> = Expand<Source & { [K in Alias]: Field }>;
|
|
75
|
+
type WithFields<Source, FromScope extends ScopeTable, Columns extends readonly (keyof FromScope)[]> = Expand<Source & Pick<FromScope, Columns[number]>>;
|
|
76
|
+
type ExtractScopeFields<T extends Record<string, Expression<ScopeField>>> = { [K in keyof T]: T[K] extends Expression<infer F extends ScopeField> ? F : never };
|
|
77
|
+
type FieldProxy<AvailableScope extends Scope> = { [K in keyof AvailableScope['topLevel']]: Expression<AvailableScope['topLevel'][K]> } & { [TableName in keyof AvailableScope['namespaces']]: { [K in keyof AvailableScope['namespaces'][TableName]]: Expression<AvailableScope['namespaces'][TableName][K]> } };
|
|
78
|
+
type ExpressionOrValue<T extends ScopeField, CT extends Record<string, {
|
|
79
|
+
readonly input: unknown;
|
|
80
|
+
}>> = Expression<T> | (T['codecId'] extends keyof CT ? CT[T['codecId']]['input'] : never);
|
|
81
|
+
type BooleanCodecType = {
|
|
82
|
+
codecId: 'pg/bool@1';
|
|
83
|
+
nullable: boolean;
|
|
84
|
+
};
|
|
85
|
+
type ExpressionBuilder<AvailableScope extends Scope, QC extends QueryContext> = (fields: FieldProxy<AvailableScope>, fns: Functions<QC>) => Expression<BooleanCodecType>;
|
|
86
|
+
type OrderByDirection = 'asc' | 'desc';
|
|
87
|
+
type OrderByNulls = 'first' | 'last';
|
|
88
|
+
type OrderByOptions = {
|
|
89
|
+
direction?: OrderByDirection;
|
|
90
|
+
nulls?: OrderByNulls;
|
|
91
|
+
};
|
|
92
|
+
type OrderByScope<AvailableScope extends Scope, RowType extends Record<string, ScopeField>> = {
|
|
93
|
+
topLevel: Expand<AvailableScope['topLevel'] & RowType>;
|
|
94
|
+
namespaces: AvailableScope['namespaces'];
|
|
95
|
+
};
|
|
96
|
+
type ExtensionFunctionArgs<Args extends readonly ScopeField[], CT extends Record<string, {
|
|
97
|
+
readonly input: unknown;
|
|
98
|
+
}>> = { [I in keyof Args]: ExpressionOrValue<Args[I], CT> };
|
|
99
|
+
type DeriveExtFunctions<OT extends QueryOperationTypesBase, CT extends Record<string, {
|
|
100
|
+
readonly input: unknown;
|
|
101
|
+
}>> = { [K in keyof OT]: (...args: ExtensionFunctionArgs<OT[K]['args'], CT>) => Expression<OT[K]['returns']> };
|
|
102
|
+
type BuiltinFunctions<CT extends Record<string, {
|
|
103
|
+
readonly input: unknown;
|
|
104
|
+
}>> = {
|
|
105
|
+
eq: <CodecId extends string>(a: ExpressionOrValue<{
|
|
106
|
+
codecId: CodecId;
|
|
107
|
+
nullable: boolean;
|
|
108
|
+
}, CT> | null, b: ExpressionOrValue<{
|
|
109
|
+
codecId: CodecId;
|
|
110
|
+
nullable: boolean;
|
|
111
|
+
}, CT> | null) => Expression<BooleanCodecType>;
|
|
112
|
+
ne: <T extends ScopeField>(a: ExpressionOrValue<T, CT> | null, b: ExpressionOrValue<T, CT> | null) => Expression<BooleanCodecType>;
|
|
113
|
+
gt: <T extends ScopeField>(a: ExpressionOrValue<T, CT>, b: ExpressionOrValue<T, CT>) => Expression<BooleanCodecType>;
|
|
114
|
+
gte: <T extends ScopeField>(a: ExpressionOrValue<T, CT>, b: ExpressionOrValue<T, CT>) => Expression<BooleanCodecType>;
|
|
115
|
+
lt: <T extends ScopeField>(a: ExpressionOrValue<T, CT>, b: ExpressionOrValue<T, CT>) => Expression<BooleanCodecType>;
|
|
116
|
+
lte: <T extends ScopeField>(a: ExpressionOrValue<T, CT>, b: ExpressionOrValue<T, CT>) => Expression<BooleanCodecType>;
|
|
117
|
+
and: (...ands: ExpressionOrValue<BooleanCodecType, CT>[]) => Expression<BooleanCodecType>;
|
|
118
|
+
or: (...ors: ExpressionOrValue<BooleanCodecType, CT>[]) => Expression<BooleanCodecType>;
|
|
119
|
+
exists: (subquery: Subquery<Record<string, ScopeField>>) => Expression<BooleanCodecType>;
|
|
120
|
+
notExists: (subquery: Subquery<Record<string, ScopeField>>) => Expression<BooleanCodecType>;
|
|
121
|
+
in: {
|
|
122
|
+
<CodecId extends string>(expr: Expression<{
|
|
123
|
+
codecId: CodecId;
|
|
124
|
+
nullable: boolean;
|
|
125
|
+
}>, subquery: Subquery<Record<string, {
|
|
126
|
+
codecId: CodecId;
|
|
127
|
+
nullable: boolean;
|
|
128
|
+
}>>): Expression<BooleanCodecType>;
|
|
129
|
+
<CodecId extends string>(expr: Expression<{
|
|
130
|
+
codecId: CodecId;
|
|
131
|
+
nullable: boolean;
|
|
132
|
+
}>, values: Array<ExpressionOrValue<{
|
|
133
|
+
codecId: CodecId;
|
|
134
|
+
nullable: boolean;
|
|
135
|
+
}, CT>>): Expression<BooleanCodecType>;
|
|
136
|
+
};
|
|
137
|
+
notIn: {
|
|
138
|
+
<CodecId extends string>(expr: Expression<{
|
|
139
|
+
codecId: CodecId;
|
|
140
|
+
nullable: boolean;
|
|
141
|
+
}>, subquery: Subquery<Record<string, {
|
|
142
|
+
codecId: CodecId;
|
|
143
|
+
nullable: boolean;
|
|
144
|
+
}>>): Expression<BooleanCodecType>;
|
|
145
|
+
<CodecId extends string>(expr: Expression<{
|
|
146
|
+
codecId: CodecId;
|
|
147
|
+
nullable: boolean;
|
|
148
|
+
}>, values: Array<ExpressionOrValue<{
|
|
149
|
+
codecId: CodecId;
|
|
150
|
+
nullable: boolean;
|
|
151
|
+
}, CT>>): Expression<BooleanCodecType>;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
type Functions<QC extends QueryContext> = BuiltinFunctions<QC['codecTypes']> & DeriveExtFunctions<QC['queryOperationTypes'], QC['codecTypes']>;
|
|
155
|
+
type CountField = {
|
|
156
|
+
codecId: 'pg/int8@1';
|
|
157
|
+
nullable: false;
|
|
158
|
+
};
|
|
159
|
+
type AggregateOnlyFunctions = {
|
|
160
|
+
count: (expr?: Expression<ScopeField>) => Expression<CountField>;
|
|
161
|
+
sum: <T extends ScopeField>(expr: Expression<T>) => Expression<{
|
|
162
|
+
codecId: T['codecId'];
|
|
163
|
+
nullable: true;
|
|
164
|
+
}>;
|
|
165
|
+
avg: <T extends ScopeField>(expr: Expression<T>) => Expression<{
|
|
166
|
+
codecId: T['codecId'];
|
|
167
|
+
nullable: true;
|
|
168
|
+
}>;
|
|
169
|
+
min: <T extends ScopeField>(expr: Expression<T>) => Expression<{
|
|
170
|
+
codecId: T['codecId'];
|
|
171
|
+
nullable: true;
|
|
172
|
+
}>;
|
|
173
|
+
max: <T extends ScopeField>(expr: Expression<T>) => Expression<{
|
|
174
|
+
codecId: T['codecId'];
|
|
175
|
+
nullable: true;
|
|
176
|
+
}>;
|
|
177
|
+
};
|
|
178
|
+
type AggregateFunctions<QC extends QueryContext> = Functions<QC> & AggregateOnlyFunctions;
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/resolve.d.ts
|
|
181
|
+
type ResolveRow<Row extends Record<string, ScopeField>, CodecTypes extends Record<string, {
|
|
182
|
+
readonly output: unknown;
|
|
183
|
+
}>> = Expand<{ -readonly [K in keyof Row]: Row[K]['codecId'] extends keyof CodecTypes ? Row[K]['nullable'] extends true ? CodecTypes[Row[K]['codecId']]['output'] | null : CodecTypes[Row[K]['codecId']]['output'] : unknown }>;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/types/mutation-query.d.ts
|
|
186
|
+
type ReturningCapability = {
|
|
187
|
+
sql: {
|
|
188
|
+
returning: true;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
type InsertValues<Table extends StorageTable, CT extends Record<string, {
|
|
192
|
+
readonly input: unknown;
|
|
193
|
+
}>> = { [K in keyof Table['columns']]?: Table['columns'][K]['codecId'] extends keyof CT ? CT[Table['columns'][K]['codecId']]['input'] : unknown };
|
|
194
|
+
type UpdateValues<Table extends StorageTable, CT extends Record<string, {
|
|
195
|
+
readonly input: unknown;
|
|
196
|
+
}>> = { [K in keyof Table['columns']]?: Table['columns'][K]['codecId'] extends keyof CT ? CT[Table['columns'][K]['codecId']]['input'] : unknown };
|
|
197
|
+
interface InsertQuery<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField>> {
|
|
198
|
+
returning: GatedMethod<QC['capabilities'], ReturningCapability, <Columns extends (keyof AvailableScope['topLevel'] & string)[]>(...columns: Columns) => InsertQuery<QC, AvailableScope, WithFields<EmptyRow, AvailableScope['topLevel'], Columns>>>;
|
|
199
|
+
build(): SqlQueryPlan<ResolveRow<RowType, QC['codecTypes']>>;
|
|
200
|
+
}
|
|
201
|
+
interface UpdateQuery<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField>> {
|
|
202
|
+
where(expr: ExpressionBuilder<AvailableScope, QC>): UpdateQuery<QC, AvailableScope, RowType>;
|
|
203
|
+
returning: GatedMethod<QC['capabilities'], ReturningCapability, <Columns extends (keyof AvailableScope['topLevel'] & string)[]>(...columns: Columns) => UpdateQuery<QC, AvailableScope, WithFields<EmptyRow, AvailableScope['topLevel'], Columns>>>;
|
|
204
|
+
build(): SqlQueryPlan<ResolveRow<RowType, QC['codecTypes']>>;
|
|
205
|
+
}
|
|
206
|
+
interface DeleteQuery<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField>> {
|
|
207
|
+
where(expr: ExpressionBuilder<AvailableScope, QC>): DeleteQuery<QC, AvailableScope, RowType>;
|
|
208
|
+
returning: GatedMethod<QC['capabilities'], ReturningCapability, <Columns extends (keyof AvailableScope['topLevel'] & string)[]>(...columns: Columns) => DeleteQuery<QC, AvailableScope, WithFields<EmptyRow, AvailableScope['topLevel'], Columns>>>;
|
|
209
|
+
build(): SqlQueryPlan<ResolveRow<RowType, QC['codecTypes']>>;
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/types/joined-tables.d.ts
|
|
213
|
+
interface JoinedTables<QC extends QueryContext, AvailableScope extends Scope> extends WithSelect<QC, AvailableScope, EmptyRow>, WithJoin<QC, AvailableScope, QC['capabilities']> {}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/types/grouped-query.d.ts
|
|
216
|
+
interface GroupedQuery<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField>> extends Subquery<RowType>, WithPagination, WithDistinct, WithAlias<RowType>, WithBuild<QC, RowType> {
|
|
217
|
+
groupBy(...fields: ((keyof RowType | keyof AvailableScope['topLevel']) & string)[]): GroupedQuery<QC, AvailableScope, RowType>;
|
|
218
|
+
groupBy(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: Functions<QC>) => Expression<ScopeField>): GroupedQuery<QC, AvailableScope, RowType>;
|
|
219
|
+
having(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: AggregateFunctions<QC>) => Expression<BooleanCodecType>): GroupedQuery<QC, AvailableScope, RowType>;
|
|
220
|
+
orderBy(field: (keyof RowType | keyof AvailableScope['topLevel']) & string, options?: OrderByOptions): GroupedQuery<QC, AvailableScope, RowType>;
|
|
221
|
+
orderBy(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: AggregateFunctions<QC>) => Expression<ScopeField>, options?: OrderByOptions): GroupedQuery<QC, AvailableScope, RowType>;
|
|
222
|
+
distinctOn: GatedMethod<QC['capabilities'], {
|
|
223
|
+
postgres: {
|
|
224
|
+
distinctOn: true;
|
|
225
|
+
};
|
|
226
|
+
}, {
|
|
227
|
+
(...fields: ((keyof RowType | keyof AvailableScope['topLevel']) & string)[]): GroupedQuery<QC, AvailableScope, RowType>;
|
|
228
|
+
(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: Functions<QC>) => Expression<ScopeField>): GroupedQuery<QC, AvailableScope, RowType>;
|
|
229
|
+
}>;
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/types/select-query.d.ts
|
|
233
|
+
interface SelectQuery<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField>> extends Subquery<RowType>, WithSelect<QC, AvailableScope, RowType>, WithPagination, WithDistinct, WithAlias<RowType>, WithBuild<QC, RowType> {
|
|
234
|
+
where(expr: ExpressionBuilder<AvailableScope, QC>): SelectQuery<QC, AvailableScope, RowType>;
|
|
235
|
+
orderBy(field: (keyof RowType | keyof AvailableScope['topLevel']) & string, options?: OrderByOptions): SelectQuery<QC, AvailableScope, RowType>;
|
|
236
|
+
orderBy(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: Functions<QC>) => Expression<ScopeField>, options?: OrderByOptions): SelectQuery<QC, AvailableScope, RowType>;
|
|
237
|
+
groupBy(...fields: ((keyof RowType | keyof AvailableScope['topLevel']) & string)[]): GroupedQuery<QC, AvailableScope, RowType>;
|
|
238
|
+
groupBy(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: Functions<QC>) => Expression<ScopeField>): GroupedQuery<QC, AvailableScope, RowType>;
|
|
239
|
+
distinctOn: GatedMethod<QC['capabilities'], {
|
|
240
|
+
postgres: {
|
|
241
|
+
distinctOn: true;
|
|
242
|
+
};
|
|
243
|
+
}, {
|
|
244
|
+
(...fields: ((keyof RowType | keyof AvailableScope['topLevel']) & string)[]): SelectQuery<QC, AvailableScope, RowType>;
|
|
245
|
+
(expr: (fields: FieldProxy<OrderByScope<AvailableScope, RowType>>, fns: Functions<QC>) => Expression<ScopeField>): SelectQuery<QC, AvailableScope, RowType>;
|
|
246
|
+
}>;
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/types/shared.d.ts
|
|
250
|
+
interface LateralBuilder<QC extends QueryContext, ParentScope extends Scope> {
|
|
251
|
+
from<Other extends JoinSource<ScopeTable, string | never>>(other: Other): SelectQuery<QC, MergeScopes<ParentScope, Other[typeof JoinOuterScope]>, EmptyRow>;
|
|
252
|
+
}
|
|
253
|
+
interface WithSelect<QC extends QueryContext, AvailableScope extends Scope, RowType extends Record<string, ScopeField> = EmptyRow> {
|
|
254
|
+
select<Columns extends (keyof AvailableScope['topLevel'] & string)[]>(...columns: Columns): SelectQuery<QC, AvailableScope, WithFields<RowType, AvailableScope['topLevel'], Columns>>;
|
|
255
|
+
select<Alias extends string, Field extends ScopeField>(alias: Alias, expr: (fields: FieldProxy<AvailableScope>, fns: AggregateFunctions<QC>) => Expression<Field>): SelectQuery<QC, AvailableScope, WithField<RowType, Field, Alias>>;
|
|
256
|
+
select<Result extends Record<string, Expression<ScopeField>>>(callback: (fields: FieldProxy<AvailableScope>, fns: AggregateFunctions<QC>) => Result): SelectQuery<QC, AvailableScope, Expand<RowType & ExtractScopeFields<Result>>>;
|
|
257
|
+
}
|
|
258
|
+
interface WithJoin<QC extends QueryContext, AvailableScope extends Scope, Capabilities> {
|
|
259
|
+
innerJoin<Other extends JoinSource<ScopeTable, string | never>>(other: Other, on: ExpressionBuilder<MergeScopes<AvailableScope, Other[typeof JoinOuterScope]>, QC>): JoinedTables<QC, MergeScopes<AvailableScope, Other[typeof JoinOuterScope]>>;
|
|
260
|
+
outerLeftJoin<Other extends JoinSource<ScopeTable, string | never>>(other: Other, on: ExpressionBuilder<MergeScopes<AvailableScope, Other[typeof JoinOuterScope]>, QC>): JoinedTables<QC, MergeScopes<AvailableScope, NullableScope<Other[typeof JoinOuterScope]>>>;
|
|
261
|
+
outerRightJoin<Other extends JoinSource<ScopeTable, string | never>>(other: Other, on: ExpressionBuilder<MergeScopes<AvailableScope, Other[typeof JoinOuterScope]>, QC>): JoinedTables<QC, MergeScopes<NullableScope<AvailableScope>, Other[typeof JoinOuterScope]>>;
|
|
262
|
+
outerFullJoin<Other extends JoinSource<ScopeTable, string | never>>(other: Other, on: ExpressionBuilder<MergeScopes<AvailableScope, Other[typeof JoinOuterScope]>, QC>): JoinedTables<QC, MergeScopes<NullableScope<AvailableScope>, NullableScope<Other[typeof JoinOuterScope]>>>;
|
|
263
|
+
lateralJoin: GatedMethod<Capabilities, {
|
|
264
|
+
sql: {
|
|
265
|
+
lateral: true;
|
|
266
|
+
};
|
|
267
|
+
}, <Alias extends string, LateralRow extends Record<string, ScopeField>>(alias: Alias, builder: (lateral: LateralBuilder<QC, AvailableScope>) => Subquery<LateralRow>) => JoinedTables<QC, MergeScopes<AvailableScope, {
|
|
268
|
+
topLevel: LateralRow;
|
|
269
|
+
namespaces: Record<Alias, LateralRow>;
|
|
270
|
+
}>>>;
|
|
271
|
+
outerLateralJoin: GatedMethod<Capabilities, {
|
|
272
|
+
sql: {
|
|
273
|
+
lateral: true;
|
|
274
|
+
};
|
|
275
|
+
}, <Alias extends string, LateralRow extends Record<string, ScopeField>>(alias: Alias, builder: (lateral: LateralBuilder<QC, AvailableScope>) => Subquery<LateralRow>) => JoinedTables<QC, MergeScopes<AvailableScope, NullableScope<{
|
|
276
|
+
topLevel: LateralRow;
|
|
277
|
+
namespaces: Record<Alias, LateralRow>;
|
|
278
|
+
}>>>>;
|
|
279
|
+
}
|
|
280
|
+
interface WithPagination {
|
|
281
|
+
limit(count: number): this;
|
|
282
|
+
offset(count: number): this;
|
|
283
|
+
}
|
|
284
|
+
interface WithDistinct {
|
|
285
|
+
distinct(): this;
|
|
286
|
+
}
|
|
287
|
+
interface WithAlias<RowType extends Record<string, ScopeField>> {
|
|
288
|
+
as<Alias extends string>(newAlias: Alias): JoinSource<RowType, Alias>;
|
|
289
|
+
}
|
|
290
|
+
interface WithBuild<QC extends QueryContext, RowType extends Record<string, ScopeField>> {
|
|
291
|
+
build(): SqlQueryPlan<ResolveRow<RowType, QC['codecTypes']>>;
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/types/table-proxy.d.ts
|
|
295
|
+
type ContractToQC<C extends TableProxyContract> = {
|
|
296
|
+
readonly codecTypes: ExtractCodecTypes<C>;
|
|
297
|
+
readonly capabilities: C['capabilities'];
|
|
298
|
+
readonly queryOperationTypes: ExtractQueryOperationTypes<C>;
|
|
299
|
+
};
|
|
300
|
+
interface TableProxy<C extends TableProxyContract, Name$1 extends string & keyof C['storage']['tables'], Alias extends string = Name$1, AvailableScope extends Scope = DefaultScope<Name$1, C['storage']['tables'][Name$1]>, QC extends QueryContext = ContractToQC<C>> extends JoinSource<StorageTableToScopeTable<C['storage']['tables'][Name$1]>, Alias>, WithSelect<QC, AvailableScope, EmptyRow>, WithJoin<QC, AvailableScope, C['capabilities']> {
|
|
301
|
+
as<NewAlias extends string>(newAlias: NewAlias): TableProxy<C, Name$1, NewAlias, RebindScope<AvailableScope, Alias, NewAlias>>;
|
|
302
|
+
insert(values: InsertValues<C['storage']['tables'][Name$1], QC['codecTypes']>): InsertQuery<QC, AvailableScope, EmptyRow>;
|
|
303
|
+
update(set: UpdateValues<C['storage']['tables'][Name$1], QC['codecTypes']>): UpdateQuery<QC, AvailableScope, EmptyRow>;
|
|
304
|
+
delete(): DeleteQuery<QC, AvailableScope, EmptyRow>;
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/types/db.d.ts
|
|
308
|
+
type CapabilitiesBase = Record<string, Record<string, boolean>>;
|
|
309
|
+
type TableProxyContract = {
|
|
310
|
+
readonly storage: {
|
|
311
|
+
readonly tables: Record<string, StorageTable>;
|
|
312
|
+
};
|
|
313
|
+
readonly capabilities: CapabilitiesBase;
|
|
314
|
+
};
|
|
315
|
+
type Db<C extends TableProxyContract> = { [Name in string & keyof C['storage']['tables']]: TableProxy<C, Name> };
|
|
316
|
+
//#endregion
|
|
317
|
+
export { ScopeField as _, DeleteQuery as a, ResolveRow as c, FieldProxy as d, Functions as f, Scope as g, QueryContext as h, GroupedQuery as i, AggregateFunctions as l, GatedMethod as m, TableProxy as n, InsertQuery as o, ExpressionType as p, SelectQuery as r, UpdateQuery as s, Db as t, Expression as u, Subquery as v };
|
|
318
|
+
//# sourceMappingURL=db-DB_rRT9u.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-DB_rRT9u.d.mts","names":[],"sources":["../src/scope.ts","../src/expression.ts","../src/resolve.ts","../src/types/mutation-query.ts","../src/types/joined-tables.ts","../src/types/grouped-query.ts","../src/types/select-query.ts","../src/types/shared.ts","../src/types/table-proxy.ts","../src/types/db.ts"],"sourcesContent":[],"mappings":";;;;;;KAGY,8CAA8C,qBAAqB,WAC3E;KAGC,cAAA,GAAiB;;;AAJtB,CAAA,CAAA;AAA0D,cAKrC,cALqC,EAAA,OAAA,MAAA;AAAqB,cAM1D,cAN0D,EAAA,OAAA,MAAA;AAC3E,cAMiB,cANjB,EAAA,OAAA,MAAA;AAAM,KAQE,MARF,CAAA,CAAA,CAAA,GAAA,QAGL,MAKiC,CALjC,GAKqC,CALvB,CAKyB,CALzB,CAAA,EACnB,GAAqB,OAAA;AACA,KAIT,QAAA,GAAW,MAJ2B,CAAA,KAAA,EAIb,UAJa,CAAA;AAC7B,KAKT,UAAA,GALsC;EAEtC,OAAA,EAAM,M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N,QRxCM,CAAA;AAElD;;;KSTY,gBAAA,GAAmB,eAAe;KAElC,kBAAA;;qBAC2B,eAAe;ETH1C,CAAA;EAA8C,SAAA,YAAA,ESIjC,gBTJiC;CAAqB;AAC3E,KSMQ,ETNR,CAAA,USMqB,kBTNrB,CAAA,GAAA,WAAM,MAAA,GAAA,MSOgB,CTPhB,CAAA,SAAA,CAAA,CAAA,QAAA,CAAA,GSOyC,UTPzC,CSOoD,CTPpD,ESOuD,ITPvD,CAAA,EACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as ScopeField, a as DeleteQuery, c as ResolveRow, f as Functions, g as Scope, h as QueryContext, i as GroupedQuery, l as AggregateFunctions, m as GatedMethod, n as TableProxy, o as InsertQuery, r as SelectQuery, s as UpdateQuery, t as Db, u as Expression, v as Subquery } from "../db-DB_rRT9u.mjs";
|
|
2
|
+
export { type AggregateFunctions, type Db, type DeleteQuery, type Expression, type Functions, type GatedMethod, type GroupedQuery, type InsertQuery, type QueryContext, type ResolveRow, type Scope, type ScopeField, type SelectQuery, type Subquery, type TableProxy, type UpdateQuery };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as ScopeField, a as DeleteQuery, c as ResolveRow, f as Functions, g as Scope, h as QueryContext, i as GroupedQuery, l as AggregateFunctions, m as GatedMethod, n as TableProxy, o as InsertQuery, r as SelectQuery, s as UpdateQuery, t as Db, u as Expression, v as Subquery } from "./db-DB_rRT9u.mjs";
|
|
2
|
+
export { type AggregateFunctions, type Db, type DeleteQuery, type Expression, type Functions, type GatedMethod, type GroupedQuery, type InsertQuery, type QueryContext, type ResolveRow, type Scope, type ScopeField, type SelectQuery, type Subquery, type TableProxy, type UpdateQuery };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { _ as ScopeField, d as FieldProxy, f as Functions, g as Scope, h as QueryContext, l as AggregateFunctions, p as ExpressionType, t as Db, u as Expression } from "../db-DB_rRT9u.mjs";
|
|
2
|
+
import { AnyExpression } from "@prisma-next/sql-relational-core/ast";
|
|
3
|
+
import { SqlContract, SqlStorage } from "@prisma-next/sql-contract/types";
|
|
4
|
+
import { QueryOperationEntry } from "@prisma-next/sql-relational-core/query-operations";
|
|
5
|
+
import { ExecutionContext } from "@prisma-next/sql-relational-core/query-lane-context";
|
|
6
|
+
|
|
7
|
+
//#region src/runtime/expression-impl.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Runtime wrapper around a relational-core AST expression node.
|
|
10
|
+
* Carries ScopeField metadata (codecId, nullable) for plan generation.
|
|
11
|
+
*/
|
|
12
|
+
declare class ExpressionImpl<T extends ScopeField = ScopeField> implements Expression<T> {
|
|
13
|
+
readonly [ExpressionType]: T;
|
|
14
|
+
private readonly ast;
|
|
15
|
+
readonly field: T;
|
|
16
|
+
constructor(ast: AnyExpression, field: T);
|
|
17
|
+
buildAst(): AnyExpression;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/runtime/field-proxy.d.ts
|
|
21
|
+
declare function createFieldProxy<S extends Scope>(scope: S): FieldProxy<S>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/runtime/functions.d.ts
|
|
24
|
+
declare function createFunctions<QC extends QueryContext>(queryOperationTypes: Readonly<Record<string, QueryOperationEntry>>): Functions<QC>;
|
|
25
|
+
declare function createAggregateFunctions<QC extends QueryContext>(queryOperationTypes: Readonly<Record<string, QueryOperationEntry>>): AggregateFunctions<QC>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/runtime/sql.d.ts
|
|
28
|
+
interface SqlOptions<C extends SqlContract<SqlStorage>> {
|
|
29
|
+
readonly context: ExecutionContext<C>;
|
|
30
|
+
}
|
|
31
|
+
declare function sql<C extends SqlContract<SqlStorage>>(options: SqlOptions<C>): Db<C>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ExpressionImpl, type SqlOptions, createAggregateFunctions, createFieldProxy, createFunctions, sql };
|
|
34
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/runtime/expression-impl.ts","../../src/runtime/field-proxy.ts","../../src/runtime/functions.ts","../../src/runtime/sql.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AASa,cAAA,cAAc,CAAA,UAAW,UAAX,GAAwB,UAAxB,CAAA,YAA+C,UAA/C,CAA0D,CAA1D,CAAA,CAAA;EAAW,UAClB,cAAA,CADkB,EACD,CADC;EAAa,iBAAA,GAAA;EAAkC,SAAA,KAAA,EAGnE,CAHmE;EAChD,WAAA,CAAA,GAAA,EAIlB,aAJkB,EAAA,KAAA,EAII,CAJJ;EAAjB,QAAA,CAAA,CAAA,EASN,aATM;;;;iBCLJ,2BAA2B,cAAc,IAAI,WAAW;;;iBCuJxD,2BAA2B,mCACpB,SAAS,eAAe,wBAC5C,UAAU;iBAiBG,oCAAoC,mCAC7B,SAAS,eAAe,wBAC5C,mBAAmB;;;UC3KL,qBAAqB,YAAY;oBAC9B,iBAAiB;;iBAGrB,cAAc,YAAY,sBAAsB,WAAW,KAAK,GAAG"}
|