prisma-sql 1.76.0 → 1.76.2
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 +2624 -2392
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +2624 -2392
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +3562 -3177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +23 -7
- package/dist/index.d.ts +23 -7
- package/dist/index.js +3562 -3177
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/readme.md +606 -899
package/dist/index.d.mts
CHANGED
|
@@ -79,8 +79,23 @@ declare function createTransactionExecutor(deps: {
|
|
|
79
79
|
postgresClient?: any;
|
|
80
80
|
}): TransactionExecutor;
|
|
81
81
|
|
|
82
|
-
declare function transformQueryResults(method: string, results: unknown): unknown;
|
|
82
|
+
declare function transformQueryResults(method: string, results: unknown, model?: Model): unknown;
|
|
83
83
|
|
|
84
|
+
interface PrerenderedWhereIn {
|
|
85
|
+
sql: string;
|
|
86
|
+
paramMappings: readonly {
|
|
87
|
+
index: number;
|
|
88
|
+
value?: unknown;
|
|
89
|
+
dynamicName?: string;
|
|
90
|
+
}[];
|
|
91
|
+
dynamicInName: string;
|
|
92
|
+
needsStripFk: boolean;
|
|
93
|
+
requiresReduction: boolean;
|
|
94
|
+
includeSpec: Record<string, any> | null;
|
|
95
|
+
reducerConfig: any | null;
|
|
96
|
+
nestedSegments: WhereInSegment[];
|
|
97
|
+
injectedParentKeys: string[];
|
|
98
|
+
}
|
|
84
99
|
interface WhereInSegment {
|
|
85
100
|
relationName: string;
|
|
86
101
|
relArgs: unknown;
|
|
@@ -90,6 +105,7 @@ interface WhereInSegment {
|
|
|
90
105
|
isList: boolean;
|
|
91
106
|
perParentTake?: number;
|
|
92
107
|
perParentSkip?: number;
|
|
108
|
+
prerendered?: PrerenderedWhereIn;
|
|
93
109
|
}
|
|
94
110
|
interface QueryPlan {
|
|
95
111
|
filteredArgs: any;
|
|
@@ -223,9 +239,9 @@ interface ProgressiveReducer {
|
|
|
223
239
|
}
|
|
224
240
|
declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
|
|
225
241
|
|
|
226
|
-
declare function transformAggregateRow(row: any): any;
|
|
242
|
+
declare function transformAggregateRow(row: any, model?: Model): any;
|
|
227
243
|
declare function extractCountValue(row: any): number | bigint;
|
|
228
|
-
declare function getRowTransformer(method: string): ((row: any) => any) | null;
|
|
244
|
+
declare function getRowTransformer(method: string, model?: Model): ((row: any) => any) | null;
|
|
229
245
|
|
|
230
246
|
declare function getOrPrepareStatement(client: any, sql: string): any;
|
|
231
247
|
declare function shouldSqliteUseGet(method: string): boolean;
|
|
@@ -237,13 +253,13 @@ interface PostgresQueryOptions {
|
|
|
237
253
|
method: string;
|
|
238
254
|
requiresReduction: boolean;
|
|
239
255
|
includeSpec?: Record<string, any>;
|
|
240
|
-
model:
|
|
241
|
-
allModels: readonly
|
|
256
|
+
model: Model;
|
|
257
|
+
allModels: readonly Model[];
|
|
242
258
|
isLateral?: boolean;
|
|
243
259
|
lateralMeta?: LateralRelationMeta[];
|
|
244
260
|
}
|
|
245
261
|
declare function executePostgresQuery(opts: PostgresQueryOptions): Promise<unknown[]>;
|
|
246
|
-
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string): unknown[];
|
|
262
|
+
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string, model?: Model): unknown[];
|
|
247
263
|
declare function executeRaw(client: any, sql: string, params: unknown[] | undefined, dialect: string): Promise<unknown[]>;
|
|
248
264
|
|
|
249
265
|
type RelStats = {
|
|
@@ -258,7 +274,7 @@ declare function setRoundtripRowEquivalent(value: number): void;
|
|
|
258
274
|
declare function setJsonRowFactor(value: number): void;
|
|
259
275
|
declare function setRelationStats(stats: RelationStatsMap): void;
|
|
260
276
|
declare function getRelationStats(): RelationStatsMap | undefined;
|
|
261
|
-
declare function countIncludeDepth(includeSpec: Record<string, any>, model: Model, schemas: readonly Model[], depth?: number): number;
|
|
277
|
+
declare function countIncludeDepth(includeSpec: Record<string, any>, model: Model, schemas: readonly Model[], depth?: number, modelMap?: Map<string, Model>): number;
|
|
262
278
|
|
|
263
279
|
declare function buildSQL(model: Model, models: Model[], method: PrismaMethod, args: Record<string, unknown>, dialect: SqlDialect): SqlResult;
|
|
264
280
|
declare function createToSQL(modelsOrDmmf: Model[] | DMMF.Document, dialect: SqlDialect): (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -79,8 +79,23 @@ declare function createTransactionExecutor(deps: {
|
|
|
79
79
|
postgresClient?: any;
|
|
80
80
|
}): TransactionExecutor;
|
|
81
81
|
|
|
82
|
-
declare function transformQueryResults(method: string, results: unknown): unknown;
|
|
82
|
+
declare function transformQueryResults(method: string, results: unknown, model?: Model): unknown;
|
|
83
83
|
|
|
84
|
+
interface PrerenderedWhereIn {
|
|
85
|
+
sql: string;
|
|
86
|
+
paramMappings: readonly {
|
|
87
|
+
index: number;
|
|
88
|
+
value?: unknown;
|
|
89
|
+
dynamicName?: string;
|
|
90
|
+
}[];
|
|
91
|
+
dynamicInName: string;
|
|
92
|
+
needsStripFk: boolean;
|
|
93
|
+
requiresReduction: boolean;
|
|
94
|
+
includeSpec: Record<string, any> | null;
|
|
95
|
+
reducerConfig: any | null;
|
|
96
|
+
nestedSegments: WhereInSegment[];
|
|
97
|
+
injectedParentKeys: string[];
|
|
98
|
+
}
|
|
84
99
|
interface WhereInSegment {
|
|
85
100
|
relationName: string;
|
|
86
101
|
relArgs: unknown;
|
|
@@ -90,6 +105,7 @@ interface WhereInSegment {
|
|
|
90
105
|
isList: boolean;
|
|
91
106
|
perParentTake?: number;
|
|
92
107
|
perParentSkip?: number;
|
|
108
|
+
prerendered?: PrerenderedWhereIn;
|
|
93
109
|
}
|
|
94
110
|
interface QueryPlan {
|
|
95
111
|
filteredArgs: any;
|
|
@@ -223,9 +239,9 @@ interface ProgressiveReducer {
|
|
|
223
239
|
}
|
|
224
240
|
declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
|
|
225
241
|
|
|
226
|
-
declare function transformAggregateRow(row: any): any;
|
|
242
|
+
declare function transformAggregateRow(row: any, model?: Model): any;
|
|
227
243
|
declare function extractCountValue(row: any): number | bigint;
|
|
228
|
-
declare function getRowTransformer(method: string): ((row: any) => any) | null;
|
|
244
|
+
declare function getRowTransformer(method: string, model?: Model): ((row: any) => any) | null;
|
|
229
245
|
|
|
230
246
|
declare function getOrPrepareStatement(client: any, sql: string): any;
|
|
231
247
|
declare function shouldSqliteUseGet(method: string): boolean;
|
|
@@ -237,13 +253,13 @@ interface PostgresQueryOptions {
|
|
|
237
253
|
method: string;
|
|
238
254
|
requiresReduction: boolean;
|
|
239
255
|
includeSpec?: Record<string, any>;
|
|
240
|
-
model:
|
|
241
|
-
allModels: readonly
|
|
256
|
+
model: Model;
|
|
257
|
+
allModels: readonly Model[];
|
|
242
258
|
isLateral?: boolean;
|
|
243
259
|
lateralMeta?: LateralRelationMeta[];
|
|
244
260
|
}
|
|
245
261
|
declare function executePostgresQuery(opts: PostgresQueryOptions): Promise<unknown[]>;
|
|
246
|
-
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string): unknown[];
|
|
262
|
+
declare function executeSqliteQuery(client: any, sql: string, params: unknown[], method: string, model?: Model): unknown[];
|
|
247
263
|
declare function executeRaw(client: any, sql: string, params: unknown[] | undefined, dialect: string): Promise<unknown[]>;
|
|
248
264
|
|
|
249
265
|
type RelStats = {
|
|
@@ -258,7 +274,7 @@ declare function setRoundtripRowEquivalent(value: number): void;
|
|
|
258
274
|
declare function setJsonRowFactor(value: number): void;
|
|
259
275
|
declare function setRelationStats(stats: RelationStatsMap): void;
|
|
260
276
|
declare function getRelationStats(): RelationStatsMap | undefined;
|
|
261
|
-
declare function countIncludeDepth(includeSpec: Record<string, any>, model: Model, schemas: readonly Model[], depth?: number): number;
|
|
277
|
+
declare function countIncludeDepth(includeSpec: Record<string, any>, model: Model, schemas: readonly Model[], depth?: number, modelMap?: Map<string, Model>): number;
|
|
262
278
|
|
|
263
279
|
declare function buildSQL(model: Model, models: Model[], method: PrismaMethod, args: Record<string, unknown>, dialect: SqlDialect): SqlResult;
|
|
264
280
|
declare function createToSQL(modelsOrDmmf: Model[] | DMMF.Document, dialect: SqlDialect): (model: string, method: PrismaMethod, args?: Record<string, unknown>) => SqlResult;
|