@prisma-next/sql-lane 0.3.0-dev.3 → 0.3.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WA646VY6.js → chunk-AWSKRSFP.js} +2 -2
- package/dist/{chunk-WA646VY6.js.map → chunk-AWSKRSFP.js.map} +1 -1
- package/dist/exports/sql.d.ts +5 -5
- package/dist/exports/sql.d.ts.map +1 -0
- package/dist/exports/sql.js +1 -1
- package/dist/index.d.ts +5 -116
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/raw.d.ts +11 -0
- package/dist/raw.d.ts.map +1 -0
- package/dist/sql/builder.d.ts +11 -0
- package/dist/sql/builder.d.ts.map +1 -0
- package/dist/sql/context.d.ts +5 -0
- package/dist/sql/context.d.ts.map +1 -0
- package/dist/sql/include-builder.d.ts +35 -0
- package/dist/sql/include-builder.d.ts.map +1 -0
- package/dist/sql/join-builder.d.ts +4 -0
- package/dist/sql/join-builder.d.ts.map +1 -0
- package/dist/sql/mutation-builder.d.ts +64 -0
- package/dist/sql/mutation-builder.d.ts.map +1 -0
- package/dist/sql/plan.d.ts +4 -0
- package/dist/sql/plan.d.ts.map +1 -0
- package/dist/sql/predicate-builder.d.ts +11 -0
- package/dist/sql/predicate-builder.d.ts.map +1 -0
- package/dist/sql/projection.d.ts +18 -0
- package/dist/sql/projection.d.ts.map +1 -0
- package/dist/sql/select-builder.d.ts +35 -0
- package/dist/sql/select-builder.d.ts.map +1 -0
- package/dist/types/internal.d.ts +35 -0
- package/dist/types/internal.d.ts.map +1 -0
- package/dist/types/public.d.ts +18 -0
- package/dist/types/public.d.ts.map +1 -0
- package/dist/utils/assertions.d.ts +28 -0
- package/dist/utils/assertions.d.ts.map +1 -0
- package/dist/utils/capabilities.d.ts +4 -0
- package/dist/utils/capabilities.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +30 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/state.d.ts +30 -0
- package/dist/utils/state.d.ts.map +1 -0
- package/package.json +16 -16
- package/src/exports/sql.ts +12 -0
- package/src/index.ts +13 -0
- package/src/raw.ts +230 -0
- package/src/sql/builder.ts +66 -0
- package/src/sql/context.ts +10 -0
- package/src/sql/include-builder.ts +248 -0
- package/src/sql/join-builder.ts +18 -0
- package/src/sql/mutation-builder.ts +494 -0
- package/src/sql/plan.ts +289 -0
- package/src/sql/predicate-builder.ts +130 -0
- package/src/sql/projection.ts +112 -0
- package/src/sql/select-builder.ts +449 -0
- package/src/types/internal.ts +41 -0
- package/src/types/public.ts +36 -0
- package/src/utils/assertions.ts +34 -0
- package/src/utils/capabilities.ts +39 -0
- package/src/utils/errors.ts +168 -0
- package/src/utils/state.ts +40 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,116 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { createJoinOnBuilder } from '
|
|
5
|
-
|
|
6
|
-
import { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
7
|
-
|
|
8
|
-
declare const RAW_OPTIONS_SENTINEL: unique symbol;
|
|
9
|
-
interface RawTemplateOptionsSentinel {
|
|
10
|
-
readonly [RAW_OPTIONS_SENTINEL]: true;
|
|
11
|
-
readonly value: RawTemplateOptions;
|
|
12
|
-
}
|
|
13
|
-
declare function rawOptions(options: RawTemplateOptions): RawTemplateOptionsSentinel;
|
|
14
|
-
|
|
15
|
-
interface InsertBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
16
|
-
readonly output: unknown;
|
|
17
|
-
}> = Record<string, never>, Row = unknown> {
|
|
18
|
-
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): InsertBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
19
|
-
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
20
|
-
}
|
|
21
|
-
interface UpdateBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
22
|
-
readonly output: unknown;
|
|
23
|
-
}> = Record<string, never>, Row = unknown> {
|
|
24
|
-
where(predicate: BinaryBuilder): UpdateBuilder<TContract, CodecTypes, Row>;
|
|
25
|
-
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): UpdateBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
26
|
-
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
27
|
-
}
|
|
28
|
-
interface DeleteBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
29
|
-
readonly output: unknown;
|
|
30
|
-
}> = Record<string, never>, Row = unknown> {
|
|
31
|
-
where(predicate: BinaryBuilder): DeleteBuilder<TContract, CodecTypes, Row>;
|
|
32
|
-
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): DeleteBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
33
|
-
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface ProjectionState {
|
|
37
|
-
readonly aliases: string[];
|
|
38
|
-
readonly columns: (AnyColumnBuilder | null)[];
|
|
39
|
-
}
|
|
40
|
-
interface JoinState {
|
|
41
|
-
readonly joinType: 'inner' | 'left' | 'right' | 'full';
|
|
42
|
-
readonly table: TableRef;
|
|
43
|
-
readonly on: JoinOnPredicate;
|
|
44
|
-
}
|
|
45
|
-
interface IncludeState {
|
|
46
|
-
readonly alias: string;
|
|
47
|
-
readonly table: TableRef;
|
|
48
|
-
readonly on: JoinOnPredicate;
|
|
49
|
-
readonly childProjection: ProjectionState;
|
|
50
|
-
readonly childWhere?: AnyBinaryBuilder;
|
|
51
|
-
readonly childOrderBy?: AnyOrderBuilder;
|
|
52
|
-
readonly childLimit?: number;
|
|
53
|
-
}
|
|
54
|
-
interface BuilderState {
|
|
55
|
-
from?: TableRef;
|
|
56
|
-
joins?: ReadonlyArray<JoinState>;
|
|
57
|
-
includes?: ReadonlyArray<IncludeState>;
|
|
58
|
-
projection?: ProjectionState;
|
|
59
|
-
where?: AnyBinaryBuilder;
|
|
60
|
-
orderBy?: AnyOrderBuilder;
|
|
61
|
-
limit?: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
type ProjectionInput = Record<string, AnyColumnBuilder | boolean | NestedProjection>;
|
|
65
|
-
|
|
66
|
-
interface IncludeChildBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
67
|
-
readonly output: unknown;
|
|
68
|
-
}> = Record<string, never>, ChildRow = unknown> {
|
|
69
|
-
select<P extends NestedProjection>(projection: P): IncludeChildBuilder<TContract, CodecTypes, InferNestedProjectionRow<P, CodecTypes>>;
|
|
70
|
-
where(expr: AnyBinaryBuilder): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
71
|
-
orderBy(order: AnyOrderBuilder): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
72
|
-
limit(count: number): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare class SelectBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, Row = unknown, CodecTypes extends Record<string, {
|
|
76
|
-
readonly output: unknown;
|
|
77
|
-
}> = Record<string, never>, Includes extends Record<string, unknown> = Record<string, never>> {
|
|
78
|
-
private readonly contract;
|
|
79
|
-
private readonly codecTypes;
|
|
80
|
-
private readonly context;
|
|
81
|
-
private state;
|
|
82
|
-
constructor(options: SqlBuilderOptions<TContract>, state?: BuilderState);
|
|
83
|
-
from(table: TableRef): SelectBuilderImpl<TContract, unknown, CodecTypes, Record<string, never>>;
|
|
84
|
-
innerJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
85
|
-
leftJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
86
|
-
rightJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
87
|
-
fullJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
88
|
-
includeMany<ChildProjection extends NestedProjection, ChildRow = InferNestedProjectionRow<ChildProjection, CodecTypes>, AliasName extends string = string>(childTable: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate, childBuilder: (child: IncludeChildBuilder<TContract, CodecTypes, unknown>) => IncludeChildBuilder<TContract, CodecTypes, ChildRow>, options?: {
|
|
89
|
-
alias?: AliasName;
|
|
90
|
-
}): SelectBuilderImpl<TContract, Row, CodecTypes, Includes & {
|
|
91
|
-
[K in AliasName]: ChildRow;
|
|
92
|
-
}>;
|
|
93
|
-
private _addJoin;
|
|
94
|
-
where(expr: AnyBinaryBuilder): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
95
|
-
select<P extends ProjectionInput>(projection: P): SelectBuilderImpl<TContract, InferNestedProjectionRow<P, CodecTypes, Includes>, CodecTypes, Includes>;
|
|
96
|
-
orderBy(order: AnyOrderBuilder): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
97
|
-
limit(count: number): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
98
|
-
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
99
|
-
private ensureFrom;
|
|
100
|
-
private ensureProjection;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type SelectBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, Row = unknown, CodecTypes extends Record<string, {
|
|
104
|
-
readonly output: unknown;
|
|
105
|
-
}> = Record<string, never>, Includes extends Record<string, unknown> = Record<string, never>> = SelectBuilderImpl<TContract, Row, CodecTypes, Includes> & {
|
|
106
|
-
readonly raw: RawFactory;
|
|
107
|
-
insert(table: TableRef, values: Record<string, ParamPlaceholder>): InsertBuilder<TContract, CodecTypes>;
|
|
108
|
-
update(table: TableRef, set: Record<string, ParamPlaceholder>): UpdateBuilder<TContract, CodecTypes>;
|
|
109
|
-
delete(table: TableRef): DeleteBuilder<TContract, CodecTypes>;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
declare function sql<TContract extends SqlContract<SqlStorage>, CodecTypesOverride extends Record<string, {
|
|
113
|
-
readonly output: unknown;
|
|
114
|
-
}> = ExtractCodecTypes<TContract>>(options: SqlBuilderOptions<TContract>): SelectBuilder<TContract, unknown, CodecTypesOverride, ExtractOperationTypes<TContract>>;
|
|
115
|
-
|
|
116
|
-
export { type IncludeChildBuilder, type SelectBuilder, rawOptions, sql };
|
|
1
|
+
export type { ColumnsOf, JoinOnBuilder, RawFactory, RawFunctionOptions, RawTemplateOptions, SqlBuilderOptions, TableKey, TablesOf, } from '@prisma-next/sql-relational-core/types';
|
|
2
|
+
export { rawOptions } from './raw';
|
|
3
|
+
export type { IncludeChildBuilder, SelectBuilder } from './sql/builder';
|
|
4
|
+
export { createJoinOnBuilder, sql } from './sql/builder';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/raw.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import type { RawFactory, RawTemplateOptions } from '@prisma-next/sql-relational-core/types';
|
|
3
|
+
declare const RAW_OPTIONS_SENTINEL: unique symbol;
|
|
4
|
+
export declare function createRawFactory(contract: SqlContract<SqlStorage>): RawFactory;
|
|
5
|
+
interface RawTemplateOptionsSentinel {
|
|
6
|
+
readonly [RAW_OPTIONS_SENTINEL]: true;
|
|
7
|
+
readonly value: RawTemplateOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare function rawOptions(options: RawTemplateOptions): RawTemplateOptionsSentinel;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../src/raw.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EACV,UAAU,EAGV,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAEhD,QAAA,MAAM,oBAAoB,eAAuB,CAAC;AAgBlD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAkD9E;AAmHD,UAAU,0BAA0B;IAClC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;CACpC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,0BAA0B,CAKlF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExtractCodecTypes, ExtractOperationTypes, SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import { createJoinOnBuilder } from '@prisma-next/sql-relational-core/ast';
|
|
3
|
+
import type { SqlBuilderOptions } from '@prisma-next/sql-relational-core/types';
|
|
4
|
+
import type { SelectBuilder } from '../types/public';
|
|
5
|
+
export { createJoinOnBuilder };
|
|
6
|
+
export type { DeleteBuilder, InsertBuilder, SelectBuilder, UpdateBuilder } from '../types/public';
|
|
7
|
+
export type { IncludeChildBuilder } from './include-builder';
|
|
8
|
+
export declare function sql<TContract extends SqlContract<SqlStorage>, CodecTypesOverride extends Record<string, {
|
|
9
|
+
readonly output: unknown;
|
|
10
|
+
}> = ExtractCodecTypes<TContract>>(options: SqlBuilderOptions<TContract>): SelectBuilder<TContract, unknown, CodecTypesOverride, ExtractOperationTypes<TContract>>;
|
|
11
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/sql/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAElG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,wBAAgB,GAAG,CACjB,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,EACzC,kBAAkB,SAAS,MAAM,CAC/B,MAAM,EACN;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAC7B,GAAG,iBAAiB,CAAC,SAAS,CAAC,EAEhC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACpC,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAuCzF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import type { QueryLaneContext } from '@prisma-next/sql-relational-core/query-lane-context';
|
|
3
|
+
export type SqlContext<TContract extends SqlContract<SqlStorage>> = QueryLaneContext<TContract>;
|
|
4
|
+
export declare function createSqlContext<TContract extends SqlContract<SqlStorage>>(context: QueryLaneContext<TContract>): SqlContext<TContract>;
|
|
5
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/sql/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAE5F,MAAM,MAAM,UAAU,CAAC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAEhG,wBAAgB,gBAAgB,CAAC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,EACxE,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,GACnC,UAAU,CAAC,SAAS,CAAC,CAEvB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ParamDescriptor } from '@prisma-next/contract/types';
|
|
2
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
+
import type { IncludeAst, TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
4
|
+
import type { AnyBinaryBuilder, AnyOrderBuilder, CodecTypes as CodecTypesMap, InferNestedProjectionRow, NestedProjection } from '@prisma-next/sql-relational-core/types';
|
|
5
|
+
import type { IncludeState, ProjectionState } from '../utils/state';
|
|
6
|
+
export interface IncludeChildBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
7
|
+
readonly output: unknown;
|
|
8
|
+
}> = Record<string, never>, ChildRow = unknown> {
|
|
9
|
+
select<P extends NestedProjection>(projection: P): IncludeChildBuilder<TContract, CodecTypes, InferNestedProjectionRow<P, CodecTypes>>;
|
|
10
|
+
where(expr: AnyBinaryBuilder): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
11
|
+
orderBy(order: AnyOrderBuilder): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
12
|
+
limit(count: number): IncludeChildBuilder<TContract, CodecTypes, ChildRow>;
|
|
13
|
+
}
|
|
14
|
+
export declare class IncludeChildBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends CodecTypesMap = CodecTypesMap, ChildRow = unknown> implements IncludeChildBuilder<TContract, CodecTypes, ChildRow> {
|
|
15
|
+
private readonly contract;
|
|
16
|
+
private readonly codecTypes;
|
|
17
|
+
private readonly table;
|
|
18
|
+
private childProjection?;
|
|
19
|
+
private childWhere?;
|
|
20
|
+
private childOrderBy?;
|
|
21
|
+
private childLimit?;
|
|
22
|
+
constructor(contract: TContract, codecTypes: CodecTypes, table: TableRef);
|
|
23
|
+
select<P extends NestedProjection>(projection: P): IncludeChildBuilderImpl<TContract, CodecTypes, InferNestedProjectionRow<P, CodecTypes>>;
|
|
24
|
+
where(expr: AnyBinaryBuilder): IncludeChildBuilderImpl<TContract, CodecTypes, ChildRow>;
|
|
25
|
+
orderBy(order: AnyOrderBuilder): IncludeChildBuilderImpl<TContract, CodecTypes, ChildRow>;
|
|
26
|
+
limit(count: number): IncludeChildBuilderImpl<TContract, CodecTypes, ChildRow>;
|
|
27
|
+
getState(): {
|
|
28
|
+
childProjection: ProjectionState;
|
|
29
|
+
childWhere?: AnyBinaryBuilder;
|
|
30
|
+
childOrderBy?: AnyOrderBuilder;
|
|
31
|
+
childLimit?: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare function buildIncludeAst(include: IncludeState, contract: SqlContract<SqlStorage>, paramsMap: Record<string, unknown>, paramDescriptors: ParamDescriptor[], paramValues: unknown[]): IncludeAst;
|
|
35
|
+
//# sourceMappingURL=include-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include-builder.d.ts","sourceRoot":"","sources":["../../src/sql/include-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAGV,UAAU,EAEV,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAO9C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,UAAU,IAAI,aAAa,EAC3B,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,wCAAwC,CAAC;AAUhD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIpE,MAAM,WAAW,mBAAmB,CAClC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EACnE,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACvF,QAAQ,GAAG,OAAO;IAElB,MAAM,CAAC,CAAC,SAAS,gBAAgB,EAC/B,UAAU,EAAE,CAAC,GACZ,mBAAmB,CAAC,SAAS,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IACvF,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,EAAE,UAAU,E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EAAE,QAAQ,CAAC;IAuB9E,QAAQ,IAAI;QACV,eAAe,EAAE,eAAe,CAAC;QACjC,UAAU,CAAC,EAAE,gBAAgB,CAAC;QAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;QAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CAuBF;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,EACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,gBAAgB,EAAE,eAAe,EAAE,EACnC,WAAW,EAAE,OAAO,EAAE,GACrB,UAAU,CA0DZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join-builder.d.ts","sourceRoot":"","sources":["../../src/sql/join-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAOpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAQrD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
3
|
+
import type { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
4
|
+
import type { AnyColumnBuilder, BinaryBuilder, BuildOptions, InferReturningRow, ParamPlaceholder, SqlBuilderOptions } from '@prisma-next/sql-relational-core/types';
|
|
5
|
+
export interface InsertBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
6
|
+
readonly output: unknown;
|
|
7
|
+
}> = Record<string, never>, Row = unknown> {
|
|
8
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): InsertBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
9
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
10
|
+
}
|
|
11
|
+
export interface UpdateBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
12
|
+
readonly output: unknown;
|
|
13
|
+
}> = Record<string, never>, Row = unknown> {
|
|
14
|
+
where(predicate: BinaryBuilder): UpdateBuilder<TContract, CodecTypes, Row>;
|
|
15
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): UpdateBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
16
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
19
|
+
readonly output: unknown;
|
|
20
|
+
}> = Record<string, never>, Row = unknown> {
|
|
21
|
+
where(predicate: BinaryBuilder): DeleteBuilder<TContract, CodecTypes, Row>;
|
|
22
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): DeleteBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
23
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
24
|
+
}
|
|
25
|
+
export declare class InsertBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
26
|
+
readonly output: unknown;
|
|
27
|
+
}> = Record<string, never>, Row = unknown> implements InsertBuilder<TContract, CodecTypes, Row> {
|
|
28
|
+
private readonly contract;
|
|
29
|
+
private readonly context;
|
|
30
|
+
private readonly table;
|
|
31
|
+
private readonly values;
|
|
32
|
+
private returningColumns;
|
|
33
|
+
constructor(options: SqlBuilderOptions<TContract>, table: TableRef, values: Record<string, ParamPlaceholder>);
|
|
34
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): InsertBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
35
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
36
|
+
}
|
|
37
|
+
export declare class UpdateBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
38
|
+
readonly output: unknown;
|
|
39
|
+
}> = Record<string, never>, Row = unknown> implements UpdateBuilder<TContract, CodecTypes, Row> {
|
|
40
|
+
private readonly contract;
|
|
41
|
+
private readonly context;
|
|
42
|
+
private readonly table;
|
|
43
|
+
private readonly set;
|
|
44
|
+
private wherePredicate?;
|
|
45
|
+
private returningColumns;
|
|
46
|
+
constructor(options: SqlBuilderOptions<TContract>, table: TableRef, set: Record<string, ParamPlaceholder>);
|
|
47
|
+
where(predicate: BinaryBuilder): UpdateBuilder<TContract, CodecTypes, Row>;
|
|
48
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): UpdateBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
49
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
50
|
+
}
|
|
51
|
+
export declare class DeleteBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, CodecTypes extends Record<string, {
|
|
52
|
+
output: unknown;
|
|
53
|
+
}> = Record<string, never>, Row = unknown> implements DeleteBuilder<TContract, CodecTypes, Row> {
|
|
54
|
+
private readonly contract;
|
|
55
|
+
private readonly context;
|
|
56
|
+
private readonly table;
|
|
57
|
+
private wherePredicate?;
|
|
58
|
+
private returningColumns;
|
|
59
|
+
constructor(options: SqlBuilderOptions<TContract>, table: TableRef);
|
|
60
|
+
where(predicate: BinaryBuilder): DeleteBuilder<TContract, CodecTypes, Row>;
|
|
61
|
+
returning<const Columns extends readonly AnyColumnBuilder[]>(...columns: Columns): DeleteBuilder<TContract, CodecTypes, InferReturningRow<Columns>>;
|
|
62
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=mutation-builder.d.ts.map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AAiB,CAAC,OAAO,CAAC,CAAC;IAgBnE,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC;CA8EjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/sql/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAW5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,CAiRvD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ParamDescriptor } from '@prisma-next/contract/types';
|
|
2
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
+
import type { BinaryExpr } from '@prisma-next/sql-relational-core/ast';
|
|
4
|
+
import type { BinaryBuilder } from '@prisma-next/sql-relational-core/types';
|
|
5
|
+
export interface BuildWhereExprResult {
|
|
6
|
+
expr: BinaryExpr;
|
|
7
|
+
codecId: string | undefined;
|
|
8
|
+
paramName: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildWhereExpr(contract: SqlContract<SqlStorage>, where: BinaryBuilder, paramsMap: Record<string, unknown>, descriptors: ParamDescriptor[], values: unknown[]): BuildWhereExprResult;
|
|
11
|
+
//# sourceMappingURL=predicate-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predicate-builder.d.ts","sourceRoot":"","sources":["../../src/sql/predicate-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,wCAAwC,CAAC;AAc9F,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,EACjC,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,WAAW,EAAE,eAAe,EAAE,EAC9B,MAAM,EAAE,OAAO,EAAE,GAChB,oBAAoB,CA0FtB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
2
|
+
import type { AnyColumnBuilder, NestedProjection } from '@prisma-next/sql-relational-core/types';
|
|
3
|
+
import type { ProjectionInput } from '../types/internal';
|
|
4
|
+
import type { IncludeState, ProjectionState } from '../utils/state';
|
|
5
|
+
export declare function generateAlias(path: string[]): string;
|
|
6
|
+
export declare class AliasTracker {
|
|
7
|
+
private readonly aliases;
|
|
8
|
+
private readonly aliasToPath;
|
|
9
|
+
register(path: string[]): string;
|
|
10
|
+
getPath(alias: string): string[] | undefined;
|
|
11
|
+
has(alias: string): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function flattenProjection(projection: NestedProjection, tracker: AliasTracker, currentPath?: string[]): {
|
|
14
|
+
aliases: string[];
|
|
15
|
+
columns: AnyColumnBuilder[];
|
|
16
|
+
};
|
|
17
|
+
export declare function buildProjectionState(_table: TableRef, projection: ProjectionInput, includes?: ReadonlyArray<IncludeState>): ProjectionState;
|
|
18
|
+
//# sourceMappingURL=projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/sql/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAEjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASzD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAKpD;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAE3D,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;IAWhC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAI5C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAG5B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,gBAAgB,EAC5B,OAAO,EAAE,YAAY,EACrB,WAAW,GAAE,MAAM,EAAO,GACzB;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAqBpD;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,eAAe,EAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,GACrC,eAAe,CAmCjB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
3
|
+
import type { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';
|
|
4
|
+
import type { AnyBinaryBuilder, AnyOrderBuilder, BuildOptions, InferNestedProjectionRow, JoinOnBuilder, JoinOnPredicate, NestedProjection, SqlBuilderOptions } from '@prisma-next/sql-relational-core/types';
|
|
5
|
+
import type { ProjectionInput } from '../types/internal';
|
|
6
|
+
import type { BuilderState } from '../utils/state';
|
|
7
|
+
import { type IncludeChildBuilder } from './include-builder';
|
|
8
|
+
export declare class SelectBuilderImpl<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, Row = unknown, CodecTypes extends Record<string, {
|
|
9
|
+
readonly output: unknown;
|
|
10
|
+
}> = Record<string, never>, Includes extends Record<string, unknown> = Record<string, never>> {
|
|
11
|
+
private readonly contract;
|
|
12
|
+
private readonly codecTypes;
|
|
13
|
+
private readonly context;
|
|
14
|
+
private state;
|
|
15
|
+
constructor(options: SqlBuilderOptions<TContract>, state?: BuilderState);
|
|
16
|
+
from(table: TableRef): SelectBuilderImpl<TContract, unknown, CodecTypes, Record<string, never>>;
|
|
17
|
+
innerJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
18
|
+
leftJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
19
|
+
rightJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
20
|
+
fullJoin(table: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
21
|
+
includeMany<ChildProjection extends NestedProjection, ChildRow = InferNestedProjectionRow<ChildProjection, CodecTypes>, AliasName extends string = string>(childTable: TableRef, on: (on: JoinOnBuilder) => JoinOnPredicate, childBuilder: (child: IncludeChildBuilder<TContract, CodecTypes, unknown>) => IncludeChildBuilder<TContract, CodecTypes, ChildRow>, options?: {
|
|
22
|
+
alias?: AliasName;
|
|
23
|
+
}): SelectBuilderImpl<TContract, Row, CodecTypes, Includes & {
|
|
24
|
+
[K in AliasName]: ChildRow;
|
|
25
|
+
}>;
|
|
26
|
+
private _addJoin;
|
|
27
|
+
where(expr: AnyBinaryBuilder): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
28
|
+
select<P extends ProjectionInput>(projection: P): SelectBuilderImpl<TContract, InferNestedProjectionRow<P, CodecTypes, Includes>, CodecTypes, Includes>;
|
|
29
|
+
orderBy(order: AnyOrderBuilder): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
30
|
+
limit(count: number): SelectBuilderImpl<TContract, Row, CodecTypes, Includes>;
|
|
31
|
+
build(options?: BuildOptions): SqlQueryPlan<Row>;
|
|
32
|
+
private ensureFrom;
|
|
33
|
+
private ensureProjection;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=select-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-builder.d.ts","sourceRoot":"","sources":["../../src/sql/select-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAQV,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAQ9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAczD,OAAO,KAAK,EAAE,YAAY,EAA4C,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,iBAAiB,CAC5B,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EACnE,GAAG,GAAG,OAAO,EACb,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAA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next/contract/types';
|
|
2
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
3
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
4
|
+
import type { AnyBinaryBuilder, AnyColumnBuilder, AnyOrderBuilder, NestedProjection } from '@prisma-next/sql-relational-core/types';
|
|
5
|
+
import type { ProjectionState } from '../utils/state';
|
|
6
|
+
export type ProjectionInput = Record<string, AnyColumnBuilder | boolean | NestedProjection>;
|
|
7
|
+
export interface MetaBuildArgs {
|
|
8
|
+
readonly contract: SqlContract<SqlStorage>;
|
|
9
|
+
readonly table: TableRef;
|
|
10
|
+
readonly projection: ProjectionState;
|
|
11
|
+
readonly joins?: ReadonlyArray<{
|
|
12
|
+
readonly joinType: 'inner' | 'left' | 'right' | 'full';
|
|
13
|
+
readonly table: TableRef;
|
|
14
|
+
readonly on: {
|
|
15
|
+
readonly left: unknown;
|
|
16
|
+
readonly right: unknown;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
readonly includes?: ReadonlyArray<{
|
|
20
|
+
readonly alias: string;
|
|
21
|
+
readonly table: TableRef;
|
|
22
|
+
readonly on: {
|
|
23
|
+
readonly left: unknown;
|
|
24
|
+
readonly right: unknown;
|
|
25
|
+
};
|
|
26
|
+
readonly childProjection: ProjectionState;
|
|
27
|
+
readonly childWhere?: AnyBinaryBuilder;
|
|
28
|
+
readonly childOrderBy?: AnyOrderBuilder;
|
|
29
|
+
}>;
|
|
30
|
+
readonly where?: AnyBinaryBuilder;
|
|
31
|
+
readonly orderBy?: AnyOrderBuilder;
|
|
32
|
+
readonly paramDescriptors: ParamDescriptor[];
|
|
33
|
+
readonly paramCodecs?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE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QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;QACvC,QAAQ,CAAC,YAAY,CAAC,EAAE,eAAe,CAAC;KACzC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
3
|
+
import type { ParamPlaceholder, RawFactory } from '@prisma-next/sql-relational-core/types';
|
|
4
|
+
import type { DeleteBuilder, InsertBuilder, UpdateBuilder } from '../sql/mutation-builder';
|
|
5
|
+
import type { SelectBuilderImpl } from '../sql/select-builder';
|
|
6
|
+
export type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
7
|
+
export type { AnyColumnBuilder, BuildOptions, InferReturningRow, ParamPlaceholder, RawFactory, SqlBuilderOptions, } from '@prisma-next/sql-relational-core/types';
|
|
8
|
+
export type SelectBuilder<TContract extends SqlContract<SqlStorage> = SqlContract<SqlStorage>, Row = unknown, CodecTypes extends Record<string, {
|
|
9
|
+
readonly output: unknown;
|
|
10
|
+
}> = Record<string, never>, Includes extends Record<string, unknown> = Record<string, never>> = SelectBuilderImpl<TContract, Row, CodecTypes, Includes> & {
|
|
11
|
+
readonly raw: RawFactory;
|
|
12
|
+
insert(table: TableRef, values: Record<string, ParamPlaceholder>): InsertBuilder<TContract, CodecTypes>;
|
|
13
|
+
update(table: TableRef, set: Record<string, ParamPlaceholder>): UpdateBuilder<TContract, CodecTypes>;
|
|
14
|
+
delete(table: TableRef): DeleteBuilder<TContract, CodecTypes>;
|
|
15
|
+
};
|
|
16
|
+
export type { IncludeChildBuilder } from '../sql/include-builder';
|
|
17
|
+
export type { DeleteBuilder, InsertBuilder, UpdateBuilder } from '../sql/mutation-builder';
|
|
18
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/types/public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,YAAY,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAClB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,MAAM,aAAa,CACvB,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EACnE,GAAG,GAAG,OAAO,EACb,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACvF,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAC9D,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG;IAC5D,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,MAAM,CACJ,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACvC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,CACJ,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACpC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;CAC/D,CAAC;AAEF,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AnyColumnBuilder } from '@prisma-next/sql-relational-core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that a ColumnBuilder has table and column properties.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertColumnBuilder(col: unknown, context: string): AnyColumnBuilder;
|
|
6
|
+
/**
|
|
7
|
+
* Asserts that a JoinOnPredicate has valid left and right columns.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertJoinOnPredicate(on: {
|
|
10
|
+
left?: {
|
|
11
|
+
table?: string;
|
|
12
|
+
column?: string;
|
|
13
|
+
};
|
|
14
|
+
right?: {
|
|
15
|
+
table?: string;
|
|
16
|
+
column?: string;
|
|
17
|
+
};
|
|
18
|
+
}): asserts on is {
|
|
19
|
+
left: {
|
|
20
|
+
table: string;
|
|
21
|
+
column: string;
|
|
22
|
+
};
|
|
23
|
+
right: {
|
|
24
|
+
table: string;
|
|
25
|
+
column: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../src/utils/assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAYnF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE;IACxC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,GAAG,OAAO,CAAC,EAAE,IAAI;IAChB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C,CAIA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
|
|
2
|
+
export declare function checkIncludeCapabilities(contract: SqlContract<SqlStorage>): void;
|
|
3
|
+
export declare function checkReturningCapability(contract: SqlContract<SqlStorage>): void;
|
|
4
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/utils/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAQ/E,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI,CAkBhF;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI,CAUhF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function errorAliasPathEmpty(): never;
|
|
2
|
+
export declare function errorAliasCollision(path: string[], alias: string, existingPath?: string[]): never;
|
|
3
|
+
export declare function errorLimitMustBeNonNegativeInteger(): never;
|
|
4
|
+
export declare function errorChildProjectionMustBeSpecified(): never;
|
|
5
|
+
export declare function errorIncludeRequiresCapabilities(target?: string): never;
|
|
6
|
+
export declare function errorIncludeCapabilitiesNotTrue(target?: string, values?: {
|
|
7
|
+
lateral?: unknown;
|
|
8
|
+
jsonAgg?: unknown;
|
|
9
|
+
}): never;
|
|
10
|
+
export declare function errorUnknownTable(tableName: string): never;
|
|
11
|
+
export declare function errorSelfJoinNotSupported(): never;
|
|
12
|
+
export declare function errorChildProjectionEmpty(): never;
|
|
13
|
+
export declare function errorIncludeAliasCollision(alias: string, type: 'projection' | 'include'): never;
|
|
14
|
+
export declare function errorMissingColumnForAlias(alias: string, index: number): never;
|
|
15
|
+
export declare function errorMissingAlias(index: number): never;
|
|
16
|
+
export declare function errorInvalidColumnForAlias(alias: string, index: number): never;
|
|
17
|
+
export declare function errorFromMustBeCalled(): never;
|
|
18
|
+
export declare function errorSelectMustBeCalled(): never;
|
|
19
|
+
export declare function errorMissingParameter(paramName: string): never;
|
|
20
|
+
export declare function errorInvalidProjectionValue(path: string[]): never;
|
|
21
|
+
export declare function errorIncludeAliasNotFound(alias: string): never;
|
|
22
|
+
export declare function errorInvalidProjectionKey(key: string): never;
|
|
23
|
+
export declare function errorProjectionEmpty(): never;
|
|
24
|
+
export declare function errorReturningRequiresCapability(target?: string): never;
|
|
25
|
+
export declare function errorReturningCapabilityNotTrue(target?: string, value?: unknown): never;
|
|
26
|
+
export declare function errorUnknownColumn(columnName: string, tableName: string): never;
|
|
27
|
+
export declare function errorWhereMustBeCalledForUpdate(): never;
|
|
28
|
+
export declare function errorFailedToBuildWhereClause(): never;
|
|
29
|
+
export declare function errorWhereMustBeCalledForDelete(): never;
|
|
30
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,KAAK,CAE3C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAIjG;AAED,wBAAgB,kCAAkC,IAAI,KAAK,CAE1D;AAED,wBAAgB,mCAAmC,IAAI,KAAK,CAE3D;AAED,wBAAgB,gCAAgC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAevE;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAChD,KAAK,CAcP;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAE1D;AAED,wBAAgB,yBAAyB,IAAI,KAAK,CAEjD;AAED,wBAAgB,yBAAyB,IAAI,KAAK,CAEjD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,KAAK,CAI/F;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAE9E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAEtD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAE9E;AAED,wBAAgB,qBAAqB,IAAI,KAAK,CAE7C;AAED,wBAAgB,uBAAuB,IAAI,KAAK,CAE/C;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAE9D;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAIjE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAI9D;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAI5D;AAED,wBAAgB,oBAAoB,IAAI,KAAK,CAE5C;AAED,wBAAgB,gCAAgC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAevE;AAED,wBAAgB,+BAA+B,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAcvF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAE/E;AAED,wBAAgB,+BAA+B,IAAI,KAAK,CAEvD;AAED,wBAAgB,6BAA6B,IAAI,KAAK,CAErD;AAED,wBAAgB,+BAA+B,IAAI,KAAK,CAEvD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TableRef } from '@prisma-next/sql-relational-core/ast';
|
|
2
|
+
import type { AnyBinaryBuilder, AnyColumnBuilder, AnyOrderBuilder, JoinOnPredicate } from '@prisma-next/sql-relational-core/types';
|
|
3
|
+
export interface ProjectionState {
|
|
4
|
+
readonly aliases: string[];
|
|
5
|
+
readonly columns: (AnyColumnBuilder | null)[];
|
|
6
|
+
}
|
|
7
|
+
export interface JoinState {
|
|
8
|
+
readonly joinType: 'inner' | 'left' | 'right' | 'full';
|
|
9
|
+
readonly table: TableRef;
|
|
10
|
+
readonly on: JoinOnPredicate;
|
|
11
|
+
}
|
|
12
|
+
export interface IncludeState {
|
|
13
|
+
readonly alias: string;
|
|
14
|
+
readonly table: TableRef;
|
|
15
|
+
readonly on: JoinOnPredicate;
|
|
16
|
+
readonly childProjection: ProjectionState;
|
|
17
|
+
readonly childWhere?: AnyBinaryBuilder;
|
|
18
|
+
readonly childOrderBy?: AnyOrderBuilder;
|
|
19
|
+
readonly childLimit?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface BuilderState {
|
|
22
|
+
from?: TableRef;
|
|
23
|
+
joins?: ReadonlyArray<JoinState>;
|
|
24
|
+
includes?: ReadonlyArray<IncludeState>;
|
|
25
|
+
projection?: ProjectionState;
|
|
26
|
+
where?: AnyBinaryBuilder;
|
|
27
|
+
orderBy?: AnyOrderBuilder;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/utils/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAG3B,QAAQ,CAAC,OAAO,EAAE,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACvD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC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