prisma-sql 1.66.0 → 1.66.1

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/index.d.mts CHANGED
@@ -173,9 +173,15 @@ interface ProgressiveReducer {
173
173
  }
174
174
  declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
175
175
 
176
- interface StreamingWhereInParams extends ExecuteWhereInParams {
176
+ interface StreamingWhereInParams {
177
+ segments: WhereInSegment[];
177
178
  parentSql: string;
178
179
  parentParams: unknown[];
180
+ parentModel: Model;
181
+ allModels: readonly Model[];
182
+ modelMap: Map<string, Model>;
183
+ dialect: 'postgres' | 'sqlite';
184
+ execute: (sql: string, params: unknown[]) => Promise<any[]>;
179
185
  batchSize?: number;
180
186
  maxConcurrency?: number;
181
187
  }
package/dist/index.d.ts CHANGED
@@ -173,9 +173,15 @@ interface ProgressiveReducer {
173
173
  }
174
174
  declare function createProgressiveReducer(config: ReducerConfig): ProgressiveReducer;
175
175
 
176
- interface StreamingWhereInParams extends ExecuteWhereInParams {
176
+ interface StreamingWhereInParams {
177
+ segments: WhereInSegment[];
177
178
  parentSql: string;
178
179
  parentParams: unknown[];
180
+ parentModel: Model;
181
+ allModels: readonly Model[];
182
+ modelMap: Map<string, Model>;
183
+ dialect: 'postgres' | 'sqlite';
184
+ execute: (sql: string, params: unknown[]) => Promise<any[]>;
179
185
  batchSize?: number;
180
186
  maxConcurrency?: number;
181
187
  }
package/dist/index.js CHANGED
@@ -8556,7 +8556,7 @@ function fetchAndAttachChildren(segment, parentIds, parentMap, allModels, modelM
8556
8556
  return __async(this, null, function* () {
8557
8557
  const childModel = modelMap.get(segment.childModelName);
8558
8558
  if (!childModel) return;
8559
- const childArgs = buildChildArgs(
8559
+ const childArgs = buildChildArgs2(
8560
8560
  segment.relArgs,
8561
8561
  segment.fkFieldName,
8562
8562
  parentIds
@@ -8588,10 +8588,16 @@ function fetchAndAttachChildren(segment, parentIds, parentMap, allModels, modelM
8588
8588
  }
8589
8589
  });
8590
8590
  }
8591
+ function buildChildArgs2(relArgs, fkFieldName, parentIds) {
8592
+ const base = relArgs === true || typeof relArgs !== "object" || relArgs === null ? {} : __spreadValues({}, relArgs);
8593
+ const existingWhere = base.where;
8594
+ const inCondition = { [fkFieldName]: { in: parentIds } };
8595
+ base.where = existingWhere ? { AND: [existingWhere, inCondition] } : inCondition;
8596
+ return base;
8597
+ }
8591
8598
  var init_streaming_where_in_executor = __esm({
8592
8599
  "src/builder/select/streaming-where-in-executor.ts"() {
8593
8600
  init_primary_key_utils();
8594
- init_where_in_executor_base();
8595
8601
  init_src();
8596
8602
  init_reducer();
8597
8603
  }