prisma-sql 1.65.0 → 1.66.0
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/generator.cjs +4925 -1549
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +4917 -1550
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +2614 -1416
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +116 -52
- package/dist/index.d.ts +116 -52
- package/dist/index.js +2601 -1417
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,69 +1,34 @@
|
|
|
1
|
-
import { ParamMap, DirectiveProps } from '@dee-wan/schema-parser';
|
|
1
|
+
import { Model as Model$1, ParamMap, DirectiveProps } from '@dee-wan/schema-parser';
|
|
2
2
|
import { DMMF } from '@prisma/generator-helper';
|
|
3
3
|
|
|
4
4
|
type SqlDialect = 'postgres' | 'sqlite';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Model = Model$1;
|
|
7
|
+
interface ParamMapping {
|
|
8
|
+
index: number;
|
|
9
|
+
dynamicName?: string;
|
|
10
|
+
value?: unknown;
|
|
10
11
|
}
|
|
11
|
-
interface
|
|
12
|
-
model: string;
|
|
13
|
-
method: 'count';
|
|
14
|
-
args?: {
|
|
15
|
-
where?: Record<string, unknown>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
interface BatchResult {
|
|
12
|
+
interface SqlResult {
|
|
19
13
|
sql: string;
|
|
20
14
|
params: unknown[];
|
|
15
|
+
paramMappings?: ParamMapping[];
|
|
16
|
+
requiresReduction?: boolean;
|
|
17
|
+
includeSpec?: Record<string, any>;
|
|
18
|
+
supportsStreaming?: boolean;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
keys: string[];
|
|
24
|
-
aliases: string[];
|
|
25
|
-
};
|
|
26
|
-
declare function buildBatchCountSql(queries: BatchCountQuery[], modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult;
|
|
27
|
-
declare function parseBatchCountResults(row: Record<string, unknown>, count: number): number[];
|
|
28
|
-
declare function parseBatchResults(row: Record<string, unknown>, keys: string[], queries: Record<string, BatchQuery>, aliases?: string[], modelMap?: Map<string, Model>): Record<string, unknown>;
|
|
29
|
-
|
|
30
|
-
interface Field {
|
|
31
|
-
name: string;
|
|
32
|
-
dbName: string;
|
|
33
|
-
type: string;
|
|
34
|
-
isRequired: boolean;
|
|
35
|
-
isRelation: boolean;
|
|
36
|
-
isId?: boolean;
|
|
37
|
-
relatedModel?: string;
|
|
38
|
-
relationName?: string;
|
|
39
|
-
foreignKey?: string | string[];
|
|
40
|
-
references?: string | string[];
|
|
41
|
-
isForeignKeyLocal?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface Model {
|
|
44
|
-
name: string;
|
|
45
|
-
tableName: string;
|
|
46
|
-
fields: Field[];
|
|
47
|
-
}
|
|
48
|
-
type PrismaMethod = 'findMany' | 'findFirst' | 'findUnique' | 'count' | 'aggregate' | 'groupBy';
|
|
20
|
+
type PrismaMethod = 'findUnique' | 'findFirst' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'count' | 'aggregate' | 'groupBy';
|
|
49
21
|
interface PrismaSQLConfig<TClient> {
|
|
50
22
|
client: TClient;
|
|
51
23
|
models?: Model[];
|
|
52
|
-
dmmf?:
|
|
53
|
-
dialect:
|
|
24
|
+
dmmf?: any;
|
|
25
|
+
dialect: 'postgres' | 'sqlite';
|
|
54
26
|
execute: (client: TClient, sql: string, params: unknown[]) => Promise<unknown[]>;
|
|
55
27
|
}
|
|
56
|
-
interface SqlResult {
|
|
57
|
-
sql: string;
|
|
58
|
-
params: readonly unknown[];
|
|
59
|
-
paramMappings?: readonly ParamMap[];
|
|
60
|
-
requiresReduction?: boolean;
|
|
61
|
-
includeSpec?: Record<string, any>;
|
|
62
|
-
}
|
|
63
28
|
interface PrismaSQLResult<TClient> {
|
|
64
29
|
toSQL: (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|
|
65
30
|
query: <T = unknown[]>(model: string, method: PrismaMethod, args?: Record<string, unknown>) => Promise<T>;
|
|
66
|
-
batchSql: (queries: Record<string,
|
|
31
|
+
batchSql: (queries: Record<string, any>) => SqlResult;
|
|
67
32
|
client: TClient;
|
|
68
33
|
}
|
|
69
34
|
|
|
@@ -79,6 +44,30 @@ interface SQLDirective {
|
|
|
79
44
|
originalDirective: DirectiveProps;
|
|
80
45
|
}
|
|
81
46
|
|
|
47
|
+
interface BatchQuery {
|
|
48
|
+
model: string;
|
|
49
|
+
method: PrismaMethod;
|
|
50
|
+
args?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
interface BatchCountQuery {
|
|
53
|
+
model: string;
|
|
54
|
+
method: 'count';
|
|
55
|
+
args?: {
|
|
56
|
+
where?: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface BatchResult {
|
|
60
|
+
sql: string;
|
|
61
|
+
params: unknown[];
|
|
62
|
+
}
|
|
63
|
+
declare function buildBatchSql(queries: Record<string, BatchQuery>, modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult & {
|
|
64
|
+
keys: string[];
|
|
65
|
+
aliases: string[];
|
|
66
|
+
};
|
|
67
|
+
declare function buildBatchCountSql(queries: BatchCountQuery[], modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult;
|
|
68
|
+
declare function parseBatchCountResults(row: Record<string, unknown>, count: number): number[];
|
|
69
|
+
declare function parseBatchResults(row: Record<string, unknown>, keys: string[], queries: Record<string, BatchQuery>, aliases?: string[], modelMap?: Map<string, Model>): Record<string, unknown>;
|
|
70
|
+
|
|
82
71
|
interface TransactionQuery {
|
|
83
72
|
model: string;
|
|
84
73
|
method: PrismaMethod;
|
|
@@ -99,7 +88,49 @@ declare function createTransactionExecutor(deps: {
|
|
|
99
88
|
postgresClient?: any;
|
|
100
89
|
}): TransactionExecutor;
|
|
101
90
|
|
|
102
|
-
declare function transformQueryResults(method:
|
|
91
|
+
declare function transformQueryResults(method: string, results: unknown): unknown;
|
|
92
|
+
|
|
93
|
+
type RelStats = {
|
|
94
|
+
avg: number;
|
|
95
|
+
p95: number;
|
|
96
|
+
p99: number;
|
|
97
|
+
max: number;
|
|
98
|
+
coverage: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
interface WhereInSegment {
|
|
102
|
+
relationName: string;
|
|
103
|
+
relArgs: unknown;
|
|
104
|
+
childModelName: string;
|
|
105
|
+
fkFieldName: string;
|
|
106
|
+
parentKeyFieldName: string;
|
|
107
|
+
isList: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface QueryPlan {
|
|
110
|
+
filteredArgs: any;
|
|
111
|
+
whereInSegments: WhereInSegment[];
|
|
112
|
+
}
|
|
113
|
+
type RelationStatsLike = Record<string, Record<string, RelStats>>;
|
|
114
|
+
declare function planQueryStrategy(params: {
|
|
115
|
+
model: Model;
|
|
116
|
+
method: string;
|
|
117
|
+
args: any;
|
|
118
|
+
allModels: readonly Model[];
|
|
119
|
+
relationStats?: RelationStatsLike;
|
|
120
|
+
dialect: 'postgres' | 'sqlite';
|
|
121
|
+
}): QueryPlan;
|
|
122
|
+
|
|
123
|
+
interface ExecuteWhereInParams {
|
|
124
|
+
segments: WhereInSegment[];
|
|
125
|
+
parentRows: any[];
|
|
126
|
+
parentModel: Model;
|
|
127
|
+
allModels: readonly Model[];
|
|
128
|
+
modelMap: Map<string, Model>;
|
|
129
|
+
dialect: 'postgres' | 'sqlite';
|
|
130
|
+
execute: (sql: string, params: unknown[]) => Promise<any[]>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
declare function executeWhereInSegments(params: ExecuteWhereInParams): Promise<void>;
|
|
103
134
|
|
|
104
135
|
interface ReducerConfig {
|
|
105
136
|
parentModel: Model;
|
|
@@ -128,6 +159,39 @@ declare function reduceFlatRows(rows: any[], config: ReducerConfig): any[];
|
|
|
128
159
|
|
|
129
160
|
declare function normalizeValue(value: unknown, seen?: WeakSet<object>, depth?: number): unknown;
|
|
130
161
|
|
|
162
|
+
declare function createStreamingReducer(config: ReducerConfig): {
|
|
163
|
+
processRow(row: any): void;
|
|
164
|
+
getResults(): any[];
|
|
165
|
+
getParentMap(): Map<string, any>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
interface ProgressiveReducer {
|
|
169
|
+
processRow(row: any): void;
|
|
170
|
+
getCurrentParentKey(row: any): string | null;
|
|
171
|
+
getCompletedParent(parentKey: string): any | null;
|
|
172
|
+
getRemainingParents(): any[];
|
|
173
|
+
}
|
|
174
|
+
declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
|
|
175
|
+
|
|
176
|
+
interface StreamingWhereInParams extends ExecuteWhereInParams {
|
|
177
|
+
parentSql: string;
|
|
178
|
+
parentParams: unknown[];
|
|
179
|
+
batchSize?: number;
|
|
180
|
+
maxConcurrency?: number;
|
|
181
|
+
}
|
|
182
|
+
declare function executeWhereInSegmentsStreaming(params: StreamingWhereInParams): Promise<any[]>;
|
|
183
|
+
|
|
184
|
+
declare function transformAggregateRow(row: any): any;
|
|
185
|
+
declare function extractCountValue(row: any): number | bigint;
|
|
186
|
+
declare function getRowTransformer(method: string): ((row: any) => any) | null;
|
|
187
|
+
|
|
188
|
+
declare function getOrPrepareStatement(client: any, sql: string): any;
|
|
189
|
+
declare function shouldSqliteUseGet(method: string): boolean;
|
|
190
|
+
declare function normalizeParams(params: unknown[]): unknown[];
|
|
191
|
+
declare function executePostgresQuery(client: any, sql: string, params: unknown[], method: string, requiresReduction: boolean, includeSpec: Record<string, any> | undefined, model: any | undefined, allModels: readonly any[]): Promise<unknown[]>;
|
|
192
|
+
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string, requiresReduction: boolean, includeSpec: Record<string, any> | undefined, model: any | undefined, allModels: readonly any[]): unknown[];
|
|
193
|
+
declare function executeRaw(client: any, sql: string, params: unknown[] | undefined, dialect: string): Promise<unknown[]>;
|
|
194
|
+
|
|
131
195
|
declare function buildSQL(model: Model, models: Model[], method: PrismaMethod, args: Record<string, unknown>, dialect: SqlDialect): SqlResult;
|
|
132
196
|
declare function createToSQL(modelsOrDmmf: Model[] | DMMF.Document, dialect: SqlDialect): (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|
|
133
197
|
declare function createPrismaSQL<TClient>(config: PrismaSQLConfig<TClient>): PrismaSQLResult<TClient>;
|
|
@@ -135,4 +199,4 @@ declare function generateSQL(directive: DirectiveProps): SQLDirective;
|
|
|
135
199
|
declare function generateAllSQL(directives: DirectiveProps[]): SQLDirective[];
|
|
136
200
|
declare function generateSQLByModel(directives: DirectiveProps[]): Map<string, SQLDirective[]>;
|
|
137
201
|
|
|
138
|
-
export { type BatchCountQuery, type BatchQuery, type Model, type PrismaMethod, type PrismaSQLConfig, type PrismaSQLResult, type ReducerConfig, type SqlResult, type TransactionOptions, type TransactionQuery, buildBatchCountSql, buildBatchSql, buildReducerConfig, buildSQL, createPrismaSQL, createToSQL, createTransactionExecutor, generateAllSQL, generateSQL, generateSQLByModel, normalizeValue, parseBatchCountResults, parseBatchResults, reduceFlatRows, transformQueryResults };
|
|
202
|
+
export { type BatchCountQuery, type BatchQuery, type Model, type PrismaMethod, type PrismaSQLConfig, type PrismaSQLResult, type ReducerConfig, type SqlResult, type TransactionOptions, type TransactionQuery, buildBatchCountSql, buildBatchSql, buildReducerConfig, buildSQL, createPrismaSQL, createProgressiveReducer, createStreamingReducer, createToSQL, createTransactionExecutor, executePostgresQuery, executeRaw, executeSqliteQuery, executeWhereInSegments, executeWhereInSegmentsStreaming, extractCountValue, generateAllSQL, generateSQL, generateSQLByModel, getOrPrepareStatement, getRowTransformer, normalizeParams, normalizeValue, parseBatchCountResults, parseBatchResults, planQueryStrategy, reduceFlatRows, shouldSqliteUseGet, transformAggregateRow, transformQueryResults };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,69 +1,34 @@
|
|
|
1
|
-
import { ParamMap, DirectiveProps } from '@dee-wan/schema-parser';
|
|
1
|
+
import { Model as Model$1, ParamMap, DirectiveProps } from '@dee-wan/schema-parser';
|
|
2
2
|
import { DMMF } from '@prisma/generator-helper';
|
|
3
3
|
|
|
4
4
|
type SqlDialect = 'postgres' | 'sqlite';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Model = Model$1;
|
|
7
|
+
interface ParamMapping {
|
|
8
|
+
index: number;
|
|
9
|
+
dynamicName?: string;
|
|
10
|
+
value?: unknown;
|
|
10
11
|
}
|
|
11
|
-
interface
|
|
12
|
-
model: string;
|
|
13
|
-
method: 'count';
|
|
14
|
-
args?: {
|
|
15
|
-
where?: Record<string, unknown>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
interface BatchResult {
|
|
12
|
+
interface SqlResult {
|
|
19
13
|
sql: string;
|
|
20
14
|
params: unknown[];
|
|
15
|
+
paramMappings?: ParamMapping[];
|
|
16
|
+
requiresReduction?: boolean;
|
|
17
|
+
includeSpec?: Record<string, any>;
|
|
18
|
+
supportsStreaming?: boolean;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
keys: string[];
|
|
24
|
-
aliases: string[];
|
|
25
|
-
};
|
|
26
|
-
declare function buildBatchCountSql(queries: BatchCountQuery[], modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult;
|
|
27
|
-
declare function parseBatchCountResults(row: Record<string, unknown>, count: number): number[];
|
|
28
|
-
declare function parseBatchResults(row: Record<string, unknown>, keys: string[], queries: Record<string, BatchQuery>, aliases?: string[], modelMap?: Map<string, Model>): Record<string, unknown>;
|
|
29
|
-
|
|
30
|
-
interface Field {
|
|
31
|
-
name: string;
|
|
32
|
-
dbName: string;
|
|
33
|
-
type: string;
|
|
34
|
-
isRequired: boolean;
|
|
35
|
-
isRelation: boolean;
|
|
36
|
-
isId?: boolean;
|
|
37
|
-
relatedModel?: string;
|
|
38
|
-
relationName?: string;
|
|
39
|
-
foreignKey?: string | string[];
|
|
40
|
-
references?: string | string[];
|
|
41
|
-
isForeignKeyLocal?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface Model {
|
|
44
|
-
name: string;
|
|
45
|
-
tableName: string;
|
|
46
|
-
fields: Field[];
|
|
47
|
-
}
|
|
48
|
-
type PrismaMethod = 'findMany' | 'findFirst' | 'findUnique' | 'count' | 'aggregate' | 'groupBy';
|
|
20
|
+
type PrismaMethod = 'findUnique' | 'findFirst' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'count' | 'aggregate' | 'groupBy';
|
|
49
21
|
interface PrismaSQLConfig<TClient> {
|
|
50
22
|
client: TClient;
|
|
51
23
|
models?: Model[];
|
|
52
|
-
dmmf?:
|
|
53
|
-
dialect:
|
|
24
|
+
dmmf?: any;
|
|
25
|
+
dialect: 'postgres' | 'sqlite';
|
|
54
26
|
execute: (client: TClient, sql: string, params: unknown[]) => Promise<unknown[]>;
|
|
55
27
|
}
|
|
56
|
-
interface SqlResult {
|
|
57
|
-
sql: string;
|
|
58
|
-
params: readonly unknown[];
|
|
59
|
-
paramMappings?: readonly ParamMap[];
|
|
60
|
-
requiresReduction?: boolean;
|
|
61
|
-
includeSpec?: Record<string, any>;
|
|
62
|
-
}
|
|
63
28
|
interface PrismaSQLResult<TClient> {
|
|
64
29
|
toSQL: (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|
|
65
30
|
query: <T = unknown[]>(model: string, method: PrismaMethod, args?: Record<string, unknown>) => Promise<T>;
|
|
66
|
-
batchSql: (queries: Record<string,
|
|
31
|
+
batchSql: (queries: Record<string, any>) => SqlResult;
|
|
67
32
|
client: TClient;
|
|
68
33
|
}
|
|
69
34
|
|
|
@@ -79,6 +44,30 @@ interface SQLDirective {
|
|
|
79
44
|
originalDirective: DirectiveProps;
|
|
80
45
|
}
|
|
81
46
|
|
|
47
|
+
interface BatchQuery {
|
|
48
|
+
model: string;
|
|
49
|
+
method: PrismaMethod;
|
|
50
|
+
args?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
interface BatchCountQuery {
|
|
53
|
+
model: string;
|
|
54
|
+
method: 'count';
|
|
55
|
+
args?: {
|
|
56
|
+
where?: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface BatchResult {
|
|
60
|
+
sql: string;
|
|
61
|
+
params: unknown[];
|
|
62
|
+
}
|
|
63
|
+
declare function buildBatchSql(queries: Record<string, BatchQuery>, modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult & {
|
|
64
|
+
keys: string[];
|
|
65
|
+
aliases: string[];
|
|
66
|
+
};
|
|
67
|
+
declare function buildBatchCountSql(queries: BatchCountQuery[], modelMap: Map<string, Model>, models: Model[], dialect: SqlDialect): BatchResult;
|
|
68
|
+
declare function parseBatchCountResults(row: Record<string, unknown>, count: number): number[];
|
|
69
|
+
declare function parseBatchResults(row: Record<string, unknown>, keys: string[], queries: Record<string, BatchQuery>, aliases?: string[], modelMap?: Map<string, Model>): Record<string, unknown>;
|
|
70
|
+
|
|
82
71
|
interface TransactionQuery {
|
|
83
72
|
model: string;
|
|
84
73
|
method: PrismaMethod;
|
|
@@ -99,7 +88,49 @@ declare function createTransactionExecutor(deps: {
|
|
|
99
88
|
postgresClient?: any;
|
|
100
89
|
}): TransactionExecutor;
|
|
101
90
|
|
|
102
|
-
declare function transformQueryResults(method:
|
|
91
|
+
declare function transformQueryResults(method: string, results: unknown): unknown;
|
|
92
|
+
|
|
93
|
+
type RelStats = {
|
|
94
|
+
avg: number;
|
|
95
|
+
p95: number;
|
|
96
|
+
p99: number;
|
|
97
|
+
max: number;
|
|
98
|
+
coverage: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
interface WhereInSegment {
|
|
102
|
+
relationName: string;
|
|
103
|
+
relArgs: unknown;
|
|
104
|
+
childModelName: string;
|
|
105
|
+
fkFieldName: string;
|
|
106
|
+
parentKeyFieldName: string;
|
|
107
|
+
isList: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface QueryPlan {
|
|
110
|
+
filteredArgs: any;
|
|
111
|
+
whereInSegments: WhereInSegment[];
|
|
112
|
+
}
|
|
113
|
+
type RelationStatsLike = Record<string, Record<string, RelStats>>;
|
|
114
|
+
declare function planQueryStrategy(params: {
|
|
115
|
+
model: Model;
|
|
116
|
+
method: string;
|
|
117
|
+
args: any;
|
|
118
|
+
allModels: readonly Model[];
|
|
119
|
+
relationStats?: RelationStatsLike;
|
|
120
|
+
dialect: 'postgres' | 'sqlite';
|
|
121
|
+
}): QueryPlan;
|
|
122
|
+
|
|
123
|
+
interface ExecuteWhereInParams {
|
|
124
|
+
segments: WhereInSegment[];
|
|
125
|
+
parentRows: any[];
|
|
126
|
+
parentModel: Model;
|
|
127
|
+
allModels: readonly Model[];
|
|
128
|
+
modelMap: Map<string, Model>;
|
|
129
|
+
dialect: 'postgres' | 'sqlite';
|
|
130
|
+
execute: (sql: string, params: unknown[]) => Promise<any[]>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
declare function executeWhereInSegments(params: ExecuteWhereInParams): Promise<void>;
|
|
103
134
|
|
|
104
135
|
interface ReducerConfig {
|
|
105
136
|
parentModel: Model;
|
|
@@ -128,6 +159,39 @@ declare function reduceFlatRows(rows: any[], config: ReducerConfig): any[];
|
|
|
128
159
|
|
|
129
160
|
declare function normalizeValue(value: unknown, seen?: WeakSet<object>, depth?: number): unknown;
|
|
130
161
|
|
|
162
|
+
declare function createStreamingReducer(config: ReducerConfig): {
|
|
163
|
+
processRow(row: any): void;
|
|
164
|
+
getResults(): any[];
|
|
165
|
+
getParentMap(): Map<string, any>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
interface ProgressiveReducer {
|
|
169
|
+
processRow(row: any): void;
|
|
170
|
+
getCurrentParentKey(row: any): string | null;
|
|
171
|
+
getCompletedParent(parentKey: string): any | null;
|
|
172
|
+
getRemainingParents(): any[];
|
|
173
|
+
}
|
|
174
|
+
declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
|
|
175
|
+
|
|
176
|
+
interface StreamingWhereInParams extends ExecuteWhereInParams {
|
|
177
|
+
parentSql: string;
|
|
178
|
+
parentParams: unknown[];
|
|
179
|
+
batchSize?: number;
|
|
180
|
+
maxConcurrency?: number;
|
|
181
|
+
}
|
|
182
|
+
declare function executeWhereInSegmentsStreaming(params: StreamingWhereInParams): Promise<any[]>;
|
|
183
|
+
|
|
184
|
+
declare function transformAggregateRow(row: any): any;
|
|
185
|
+
declare function extractCountValue(row: any): number | bigint;
|
|
186
|
+
declare function getRowTransformer(method: string): ((row: any) => any) | null;
|
|
187
|
+
|
|
188
|
+
declare function getOrPrepareStatement(client: any, sql: string): any;
|
|
189
|
+
declare function shouldSqliteUseGet(method: string): boolean;
|
|
190
|
+
declare function normalizeParams(params: unknown[]): unknown[];
|
|
191
|
+
declare function executePostgresQuery(client: any, sql: string, params: unknown[], method: string, requiresReduction: boolean, includeSpec: Record<string, any> | undefined, model: any | undefined, allModels: readonly any[]): Promise<unknown[]>;
|
|
192
|
+
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string, requiresReduction: boolean, includeSpec: Record<string, any> | undefined, model: any | undefined, allModels: readonly any[]): unknown[];
|
|
193
|
+
declare function executeRaw(client: any, sql: string, params: unknown[] | undefined, dialect: string): Promise<unknown[]>;
|
|
194
|
+
|
|
131
195
|
declare function buildSQL(model: Model, models: Model[], method: PrismaMethod, args: Record<string, unknown>, dialect: SqlDialect): SqlResult;
|
|
132
196
|
declare function createToSQL(modelsOrDmmf: Model[] | DMMF.Document, dialect: SqlDialect): (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|
|
133
197
|
declare function createPrismaSQL<TClient>(config: PrismaSQLConfig<TClient>): PrismaSQLResult<TClient>;
|
|
@@ -135,4 +199,4 @@ declare function generateSQL(directive: DirectiveProps): SQLDirective;
|
|
|
135
199
|
declare function generateAllSQL(directives: DirectiveProps[]): SQLDirective[];
|
|
136
200
|
declare function generateSQLByModel(directives: DirectiveProps[]): Map<string, SQLDirective[]>;
|
|
137
201
|
|
|
138
|
-
export { type BatchCountQuery, type BatchQuery, type Model, type PrismaMethod, type PrismaSQLConfig, type PrismaSQLResult, type ReducerConfig, type SqlResult, type TransactionOptions, type TransactionQuery, buildBatchCountSql, buildBatchSql, buildReducerConfig, buildSQL, createPrismaSQL, createToSQL, createTransactionExecutor, generateAllSQL, generateSQL, generateSQLByModel, normalizeValue, parseBatchCountResults, parseBatchResults, reduceFlatRows, transformQueryResults };
|
|
202
|
+
export { type BatchCountQuery, type BatchQuery, type Model, type PrismaMethod, type PrismaSQLConfig, type PrismaSQLResult, type ReducerConfig, type SqlResult, type TransactionOptions, type TransactionQuery, buildBatchCountSql, buildBatchSql, buildReducerConfig, buildSQL, createPrismaSQL, createProgressiveReducer, createStreamingReducer, createToSQL, createTransactionExecutor, executePostgresQuery, executeRaw, executeSqliteQuery, executeWhereInSegments, executeWhereInSegmentsStreaming, extractCountValue, generateAllSQL, generateSQL, generateSQLByModel, getOrPrepareStatement, getRowTransformer, normalizeParams, normalizeValue, parseBatchCountResults, parseBatchResults, planQueryStrategy, reduceFlatRows, shouldSqliteUseGet, transformAggregateRow, transformQueryResults };
|