@routier/core 0.3.0 → 0.5.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.
Files changed (35) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +549 -462
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +554 -462
  6. package/dist/index.js.map +1 -1
  7. package/dist/plugins/TelemetryDbPlugin.d.ts +43 -0
  8. package/dist/plugins/index.cjs +538 -24
  9. package/dist/plugins/index.cjs.map +1 -1
  10. package/dist/plugins/index.d.ts +1 -0
  11. package/dist/plugins/index.js +544 -22
  12. package/dist/plugins/index.js.map +1 -1
  13. package/dist/plugins/query/QueryOptionsCollection.d.ts +13 -0
  14. package/dist/plugins/query/explain.d.ts +82 -0
  15. package/dist/plugins/query/formatExplanation.d.ts +9 -0
  16. package/dist/plugins/query/index.d.ts +2 -0
  17. package/dist/plugins/query/types.d.ts +11 -0
  18. package/dist/plugins/types.d.ts +43 -1
  19. package/dist/plugins/wire/types.d.ts +17 -1
  20. package/dist/utilities/index.cjs +43 -12
  21. package/dist/utilities/index.cjs.map +1 -1
  22. package/dist/utilities/index.js +43 -12
  23. package/dist/utilities/index.js.map +1 -1
  24. package/package.json +6 -10
  25. package/dist/capabilities/Capability.d.ts +0 -11
  26. package/dist/capabilities/PerformanceCapability.d.ts +0 -13
  27. package/dist/capabilities/TracingCapability.d.ts +0 -11
  28. package/dist/capabilities/index.cjs +0 -820
  29. package/dist/capabilities/index.cjs.map +0 -1
  30. package/dist/capabilities/index.d.ts +0 -4
  31. package/dist/capabilities/index.js +0 -808
  32. package/dist/capabilities/index.js.map +0 -1
  33. package/dist/capabilities/performance/PerformanceTracker.d.ts +0 -11
  34. package/dist/capabilities/tracing/CallTraceManager.d.ts +0 -12
  35. package/dist/capabilities/types.d.ts +0 -17
package/dist/index.js CHANGED
@@ -99,436 +99,6 @@ function isObjectWithType(value) {
99
99
  }
100
100
 
101
101
 
102
- },
103
- 599(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
104
-
105
- // EXPORTS
106
- __webpack_require__.d(__webpack_exports__, {
107
- nS: () => (/* reexport */ Capability),
108
- VP: () => (/* reexport */ PerformanceCapability),
109
- XO: () => (/* reexport */ TracingCapability)
110
- });
111
-
112
- ;// CONCATENATED MODULE: ./src/capabilities/Capability.ts
113
- class Capability {
114
- excludedNames = new Set([
115
- "Array",
116
- "Set",
117
- "Map",
118
- "AbortController",
119
- "AbortSignal",
120
- "SchemaString",
121
- "SchemaNumber",
122
- "SchemaArray",
123
- "SchemaBoolean",
124
- "SchemaDate",
125
- "SchemaObject",
126
- "SchemaDefault",
127
- "SchemaDeserialize",
128
- "SchemaDistinct",
129
- "SchemaSearchable",
130
- "SchemaFrom",
131
- "SchemaIdentity",
132
- "SchemaIndex",
133
- "SchemaKey",
134
- "SchemaNullable",
135
- "SchemaOptional",
136
- "SchemaReadonly",
137
- "SchemaSerialize",
138
- "SchemaTracked",
139
- "SchemaComputed",
140
- "SchemaFunction",
141
- "SchemaBase",
142
- "SchemaDefinition"
143
- ]);
144
- isValidObject(obj) {
145
- return typeof obj === "object" && obj !== null;
146
- }
147
- isCallableMethod(descriptor, key) {
148
- return descriptor?.value && typeof descriptor.value === 'function' && key !== 'constructor' && key !== 'undefined';
149
- }
150
- canExplore(descriptor) {
151
- if (typeof descriptor.value !== "object") {
152
- return false;
153
- }
154
- if (descriptor.value == null) {
155
- return false;
156
- }
157
- const name = this.getName(descriptor.value);
158
- if (name == null) {
159
- return true;
160
- }
161
- return this.excludedNames.has(name) === false;
162
- }
163
- getName(value) {
164
- if (value.constructor != null) {
165
- return value.constructor.name;
166
- }
167
- return null;
168
- }
169
- getPath(info, propertyName) {
170
- let parent = info.parent;
171
- const path = [
172
- info.propertyName,
173
- propertyName
174
- ];
175
- while(parent != null){
176
- path.unshift(parent.propertyName);
177
- parent = parent.parent;
178
- }
179
- return path.join(".");
180
- }
181
- explore(instance, onDiscover) {
182
- if (!this.isValidObject(instance)) {
183
- return;
184
- }
185
- const explore = [
186
- {
187
- instance,
188
- propertyName: this.getName(instance)
189
- }
190
- ];
191
- const visited = new Set();
192
- for(let i = 0; i < explore.length; i++){
193
- const info = explore[i];
194
- const item = info.instance;
195
- if (visited.has(item)) {
196
- continue;
197
- }
198
- const allKeys = [
199
- ...Object.getOwnPropertyNames(item),
200
- ...Object.getOwnPropertySymbols(item)
201
- ];
202
- for (const key of allKeys){
203
- const descriptor = Object.getOwnPropertyDescriptor(item, key);
204
- const isCallable = this.isCallableMethod(descriptor, key);
205
- onDiscover(info, {
206
- name: key,
207
- isCallable
208
- });
209
- if (this.canExplore(descriptor) === false) {
210
- continue;
211
- }
212
- const path = this.getPath(info, key);
213
- explore.push({
214
- instance: descriptor.value,
215
- parent: info,
216
- propertyName: key,
217
- path
218
- });
219
- }
220
- visited.add(item);
221
- }
222
- }
223
- }
224
-
225
- // EXTERNAL MODULE: ./src/utilities/strings.ts
226
- var strings = __webpack_require__(615);
227
- ;// CONCATENATED MODULE: ./src/capabilities/performance/PerformanceTracker.ts
228
- class PerformanceTracker {
229
- methodTimings = new Map();
230
- operationStartTimes = new Map();
231
- startMethodTiming(operationId, methodPath) {
232
- const startTime = performance.now();
233
- const key = `${operationId}:${methodPath}`;
234
- // Track operation start time for delta calculations
235
- if (!this.operationStartTimes.has(operationId)) {
236
- this.operationStartTimes.set(operationId, startTime);
237
- }
238
- this.methodTimings.set(key, {
239
- startTime
240
- });
241
- return startTime;
242
- }
243
- recordNextMethodStart(operationId, methodPath) {
244
- const key = `${operationId}:${methodPath}`;
245
- const timing = this.methodTimings.get(key);
246
- if (timing) {
247
- timing.nextMethodStartTime = performance.now();
248
- }
249
- }
250
- endMethodTiming(operationId, methodPath) {
251
- const endTime = performance.now();
252
- const key = `${operationId}:${methodPath}`;
253
- const timing = this.methodTimings.get(key);
254
- if (!timing) {
255
- return {
256
- startTime: endTime
257
- };
258
- }
259
- const duration = endTime - timing.startTime;
260
- const timeToNextCall = timing.nextMethodStartTime ? timing.nextMethodStartTime - timing.startTime : undefined;
261
- // Clean up
262
- this.methodTimings.delete(key);
263
- return {
264
- startTime: timing.startTime,
265
- endTime,
266
- duration,
267
- nextMethodStartTime: timing.nextMethodStartTime,
268
- timeToNextCall
269
- };
270
- }
271
- formatDuration(milliseconds) {
272
- if (milliseconds < 1) {
273
- return `${(milliseconds * 1000).toFixed(1)}μs`;
274
- } else if (milliseconds < 1000) {
275
- return `${milliseconds.toFixed(2)}ms`;
276
- } else {
277
- return `${(milliseconds / 1000).toFixed(2)}s`;
278
- }
279
- }
280
- getDeltaFromOperationStart(operationId, currentTime) {
281
- const operationStartTime = this.operationStartTimes.get(operationId);
282
- return operationStartTime ? currentTime - operationStartTime : 0;
283
- }
284
- cleanupOperation(operationId) {
285
- this.operationStartTimes.delete(operationId);
286
- }
287
- }
288
-
289
- // EXTERNAL MODULE: ./src/utilities/uuid.ts
290
- var uuid = __webpack_require__(618);
291
- ;// CONCATENATED MODULE: ./src/capabilities/tracing/CallTraceManager.ts
292
-
293
- class CallTraceManager {
294
- activeOperationId = null;
295
- activeCallStack = [];
296
- startNewOperation() {
297
- const operationId = (0,uuid/* .uuid */.u)(8);
298
- this.activeOperationId = operationId;
299
- this.activeCallStack = [];
300
- return operationId;
301
- }
302
- isNewOperation() {
303
- return this.activeOperationId === null;
304
- }
305
- getActiveOperationId() {
306
- if (!this.activeOperationId) {
307
- throw new Error('No active operation context');
308
- }
309
- return this.activeOperationId;
310
- }
311
- addMethodToTrace(methodPath) {
312
- if (this.isNewOperation()) {
313
- this.activeCallStack = [
314
- methodPath
315
- ];
316
- } else {
317
- this.activeCallStack.push(methodPath);
318
- }
319
- return [
320
- ...this.activeCallStack
321
- ];
322
- }
323
- removeMethodFromTrace() {
324
- if (!this.isNewOperation()) {
325
- this.activeCallStack.pop();
326
- }
327
- }
328
- endOperation() {
329
- this.activeOperationId = null;
330
- this.activeCallStack = [];
331
- }
332
- formatMethodPaths(methodPaths) {
333
- return methodPaths.map((path)=>path.replace(/ → /g, '.'));
334
- }
335
- getCurrentTrace() {
336
- return [
337
- ...this.activeCallStack
338
- ];
339
- }
340
- }
341
-
342
- // EXTERNAL MODULE: ./src/utilities/logger.ts
343
- var logger = __webpack_require__(581);
344
- ;// CONCATENATED MODULE: ./src/capabilities/PerformanceCapability.ts
345
-
346
-
347
-
348
-
349
-
350
- class PerformanceCapability extends Capability {
351
- callTraceManager;
352
- performanceTracker;
353
- filter;
354
- childDurations = new Map();
355
- constructor(options){
356
- super();
357
- this.filter = options?.filter ?? (()=>true);
358
- this.callTraceManager = new CallTraceManager();
359
- this.performanceTracker = new PerformanceTracker();
360
- }
361
- apply(instance) {
362
- this.explore(instance, (meta, info)=>{
363
- if (info.isCallable) {
364
- const originalMethod = meta.instance[info.name].bind(meta.instance);
365
- meta.instance[info.name] = (...args)=>{
366
- const path = `${meta.path}.${String(info.name)}()`;
367
- if (this.filter(path, info, meta) === false) {
368
- return originalMethod(...args);
369
- }
370
- const isNewOperation = this.callTraceManager.isNewOperation();
371
- let operationId;
372
- let callTrace;
373
- let depth;
374
- if (isNewOperation) {
375
- operationId = this.callTraceManager.startNewOperation();
376
- this.childDurations.set(operationId, []);
377
- callTrace = this.callTraceManager.addMethodToTrace(path);
378
- depth = callTrace.length - 1;
379
- const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
380
- this.performanceTracker.startMethodTiming(operationId, path);
381
- logger/* .logger.log */.vF.log(`\n${'═'.repeat(60)}`);
382
- logger/* .logger.log */.vF.log(`▶ ORIGIN [${operationId}] ${path}`);
383
- if (args.length > 0) {
384
- logger/* .logger.log */.vF.log(` Args:`, (0,strings/* .stringifyObject */.Zm)(args, 4, 0));
385
- }
386
- logger/* .logger.log */.vF.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
387
- } else {
388
- operationId = this.callTraceManager.getActiveOperationId();
389
- callTrace = this.callTraceManager.addMethodToTrace(path);
390
- depth = callTrace.length - 1;
391
- const indent = ' '.repeat(Math.min(depth, 4));
392
- // Track children for this child method too
393
- const childMethodKey = `${operationId}:${path}`;
394
- this.childDurations.set(childMethodKey, []);
395
- this.performanceTracker.startMethodTiming(operationId, path);
396
- logger/* .logger.log */.vF.log(`${indent}└─ CHILD [${operationId}] ${path}`);
397
- if (args.length > 0) {
398
- logger/* .logger.log */.vF.log(`${indent} Args:`, (0,strings/* .stringifyObject */.Zm)(args, 4, 0));
399
- }
400
- }
401
- try {
402
- return originalMethod(...args);
403
- } finally{
404
- const metrics = this.performanceTracker.endMethodTiming(operationId, path);
405
- const duration = metrics.duration ?? 0;
406
- const formattedDuration = this.performanceTracker.formatDuration(duration);
407
- if (isNewOperation) {
408
- const childDurations = this.childDurations.get(operationId) ?? [];
409
- const totalChildTime = childDurations.reduce((sum, d)=>sum + d, 0);
410
- const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
411
- const overhead = duration - totalChildTime;
412
- const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
413
- logger/* .logger.log */.vF.log(`\n${'═'.repeat(60)}`);
414
- logger/* .logger.log */.vF.log(`◀ COMPLETE [${operationId}] ${path}`);
415
- logger/* .logger.log */.vF.log(` Total Duration: ${formattedDuration}`);
416
- if (childDurations.length > 0) {
417
- logger/* .logger.log */.vF.log(` Children Duration: ${formattedTotalChildTime} (${childDurations.length} calls)`);
418
- logger/* .logger.log */.vF.log(` Overhead: ${formattedOverhead}`);
419
- }
420
- logger/* .logger.log */.vF.log(`${'═'.repeat(60)}\n`);
421
- this.childDurations.delete(operationId);
422
- this.performanceTracker.cleanupOperation(operationId);
423
- this.callTraceManager.endOperation();
424
- } else {
425
- const indent = ' '.repeat(Math.min(depth, 4));
426
- const childMethodKey = `${operationId}:${path}`;
427
- const childDurations = this.childDurations.get(childMethodKey) ?? [];
428
- const totalChildTime = childDurations.reduce((sum, d)=>sum + d, 0);
429
- const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
430
- const overhead = duration - totalChildTime;
431
- const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
432
- logger/* .logger.log */.vF.log(`${indent} ✓ ${formattedDuration}`);
433
- if (childDurations.length > 0) {
434
- logger/* .logger.log */.vF.log(`${indent} Children: ${formattedTotalChildTime} (${childDurations.length} calls), Overhead: ${formattedOverhead}`);
435
- }
436
- // Clean up child method tracking
437
- this.childDurations.delete(childMethodKey);
438
- // Find the parent method and add this duration to its children list
439
- // The parent is the method one level up in the call trace
440
- const currentTrace = this.callTraceManager.getCurrentTrace();
441
- if (currentTrace.length > 1) {
442
- // Parent is the second-to-last item in the trace (before we remove current)
443
- const parentPath = currentTrace[currentTrace.length - 2];
444
- // Check if parent is the root operation (trace length 2 means root + this child)
445
- if (currentTrace.length === 2) {
446
- // Direct child of root - add to root's children list
447
- const rootChildDurations = this.childDurations.get(operationId);
448
- if (rootChildDurations) {
449
- rootChildDurations.push(duration);
450
- }
451
- } else {
452
- // Nested child - add to parent method's children list
453
- const parentMethodKey = `${operationId}:${parentPath}`;
454
- const parentChildDurations = this.childDurations.get(parentMethodKey);
455
- if (parentChildDurations) {
456
- parentChildDurations.push(duration);
457
- }
458
- }
459
- }
460
- }
461
- this.callTraceManager.removeMethodFromTrace();
462
- }
463
- };
464
- }
465
- });
466
- }
467
- }
468
-
469
- ;// CONCATENATED MODULE: ./src/capabilities/TracingCapability.ts
470
-
471
-
472
-
473
- class TracingCapability extends Capability {
474
- callTraceManager;
475
- filter;
476
- constructor(options){
477
- super();
478
- this.filter = options?.filter ?? (()=>true);
479
- this.callTraceManager = new CallTraceManager();
480
- }
481
- apply(instance) {
482
- this.explore(instance, (meta, info)=>{
483
- if (info.isCallable) {
484
- const originalMethod = meta.instance[info.name].bind(meta.instance);
485
- meta.instance[info.name] = (...args)=>{
486
- const path = `${meta.path}.${String(info.name)}()`;
487
- if (this.filter(path, info, meta) === false) {
488
- return originalMethod(...args);
489
- }
490
- const isNewOperation = this.callTraceManager.isNewOperation();
491
- let operationId;
492
- if (isNewOperation) {
493
- operationId = this.callTraceManager.startNewOperation();
494
- const callTrace = this.callTraceManager.addMethodToTrace(path);
495
- const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
496
- console.log(`\n${'═'.repeat(60)}`);
497
- console.log(`▶ ORIGIN [${operationId}] ${path}`);
498
- if (args.length > 0) {
499
- console.log(` Args:`, (0,strings/* .stringifyObject */.Zm)(args, 4, 0));
500
- }
501
- console.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
502
- } else {
503
- operationId = this.callTraceManager.getActiveOperationId();
504
- const callTrace = this.callTraceManager.addMethodToTrace(path);
505
- const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));
506
- console.log(`${indent}└─ CHILD [${operationId}] ${path}`);
507
- if (args.length > 0) {
508
- console.log(`${indent} Args:`, (0,strings/* .stringifyObject */.Zm)(args, 4, 0));
509
- }
510
- }
511
- try {
512
- return originalMethod(...args);
513
- } finally{
514
- this.callTraceManager.removeMethodFromTrace();
515
- if (isNewOperation) {
516
- this.callTraceManager.endOperation();
517
- }
518
- }
519
- };
520
- }
521
- });
522
- }
523
- }
524
-
525
- ;// CONCATENATED MODULE: ./src/capabilities/index.ts
526
-
527
-
528
-
529
-
530
-
531
-
532
102
  },
533
103
  980(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
534
104
  __webpack_require__.d(__webpack_exports__, {
@@ -3685,12 +3255,14 @@ var TrampolinePipeline = __webpack_require__(416);
3685
3255
 
3686
3256
 
3687
3257
  },
3688
- 771(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
3258
+ 454(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
3689
3259
 
3690
3260
  // EXPORTS
3691
3261
  __webpack_require__.d(__webpack_exports__, {
3262
+ jO: () => (/* reexport */ TupleTranslator),
3692
3263
  Mr: () => (/* reexport */ deserializeBulkPersist),
3693
3264
  bX: () => (/* reexport */ ConcurrencyDbPlugin),
3265
+ ae: () => (/* reexport */ explainQuery),
3694
3266
  _b: () => (/* reexport */ DEFAULT_SEMI_JOIN_KEY_THRESHOLD),
3695
3267
  pt: () => (/* reexport */ types_QueryOrdering),
3696
3268
  Ib: () => (/* reexport */ TranslatedSingleValue),
@@ -3704,26 +3276,32 @@ __webpack_require__.d(__webpack_exports__, {
3704
3276
  d0: () => (/* reexport */ JsonTranslator),
3705
3277
  PP: () => (/* reexport */ splitSendableOptions),
3706
3278
  f2: () => (/* reexport */ TranslatedGroupValue),
3707
- __: () => (/* reexport */ toEntityShape),
3279
+ wN: () => (/* reexport */ collectingSink),
3708
3280
  QB: () => (/* reexport */ RetryDbPlugin),
3709
3281
  m6: () => (/* reexport */ executeJoin),
3282
+ __: () => (/* reexport */ toEntityShape),
3710
3283
  VW: () => (/* reexport */ applyInnerOptions),
3711
3284
  Jd: () => (/* reexport */ EphemeralDataPlugin),
3712
3285
  Pl: () => (/* reexport */ deserializePersistResult),
3713
3286
  JF: () => (/* reexport */ DataTranslator),
3714
3287
  HM: () => (/* reexport */ QueryOptionsCollection/* .QueryOptionsCollection */.H),
3715
3288
  KB: () => (/* reexport */ createRequestHandler),
3716
- n: () => (/* reexport */ serializeBulkPersist),
3289
+ vZ: () => (/* reexport */ formatExplanation),
3717
3290
  II: () => (/* reexport */ deserializeQueryOptions),
3291
+ n: () => (/* reexport */ serializeBulkPersist),
3718
3292
  as: () => (/* reexport */ loadJoinInnerSide),
3719
3293
  lA: () => (/* reexport */ semiJoinFilter),
3720
3294
  kX: () => (/* reexport */ BatchingDbPlugin),
3721
3295
  DF: () => (/* reexport */ SqlTranslator),
3296
+ qj: () => (/* reexport */ loggerSink),
3297
+ gH: () => (/* reexport */ MEMORY_EXECUTION_EXPLANATIONS),
3722
3298
  BL: () => (/* reexport */ serializeQueryOptions),
3299
+ Kg: () => (/* reexport */ withExecutedQueries),
3723
3300
  xw: () => (/* reexport */ TranslatedArrayValue),
3724
3301
  zH: () => (/* reexport */ joinInPlugin),
3302
+ Pr: () => (/* reexport */ TelemetryDbPlugin),
3725
3303
  XK: () => (/* reexport */ Query),
3726
- jO: () => (/* reexport */ TupleTranslator)
3304
+ jE: () => (/* reexport */ EXECUTED_QUERIES_UNSUPPORTED)
3727
3305
  });
3728
3306
 
3729
3307
  ;// CONCATENATED MODULE: ./src/plugins/translators/TranslatedArrayValue.ts
@@ -4258,7 +3836,11 @@ class Query {
4258
3836
  id: `${event.id}-inner`,
4259
3837
  source: event.source,
4260
3838
  action: "query",
4261
- reason: "join inner side"
3839
+ reason: "join inner side",
3840
+ explain: event.explain,
3841
+ // The same array the outer read pushes into, so a join reports BOTH reads in execution
3842
+ // order. Built fresh rather than spread, so this has to be carried explicitly.
3843
+ executedQueries: event.executedQueries
4262
3844
  };
4263
3845
  query(innerEvent, (result)=>{
4264
3846
  if (result.ok === Result/* .PluginEventResult.ERROR */.D.ERROR) {
@@ -4958,6 +4540,386 @@ class SqlTranslator extends DataTranslator {
4958
4540
 
4959
4541
 
4960
4542
 
4543
+ ;// CONCATENATED MODULE: ./src/plugins/query/explain.ts
4544
+
4545
+ /**
4546
+ * One sentence per reason code, written for someone meeting pushdown for the first time.
4547
+ *
4548
+ * Beside the codes rather than in the formatter, so console output, a failing test and the
4549
+ * docs all say the same thing.
4550
+ */ const MEMORY_EXECUTION_EXPLANATIONS = {
4551
+ "not-parsable": "A filter could not be parsed into an expression tree, so it and every option after it run in memory.",
4552
+ "unmapped-property": "The property is not stored in the database, so it can only be read after deserialization.",
4553
+ "renamed-property": "The property is stored under a different name, and selectors use the in-memory name, so it can only be read after deserialization.",
4554
+ "map-rename": "A map renames or drops properties, so every option after it refers to names the database does not have.",
4555
+ "after-nearest": "A similarity search orders and limits rows, and the plugin cannot report whether it performed the search, so every option after it runs in memory.",
4556
+ "after-join": "A join produces [outer, inner] tuples rather than entities, and the plugin cannot report how it joined, so every option after it runs in memory.",
4557
+ "cross-plugin-join": "The two sides of this join live on different plugins, so neither can read the other's rows and the join runs in the datastore."
4558
+ };
4559
+ const EXECUTED_QUERIES_UNSUPPORTED = "This plugin did not report what it executed. It may not support explain.";
4560
+ const DATABASE_STEP_DESCRIPTION = "These options are sent to the plugin.";
4561
+ const MEMORY_STEP_DESCRIPTION = "Routier runs these over the rows the database returned, after deserializing them.";
4562
+ const UNNARROWED_READ_DESCRIPTION = "No option could be pushed down, so the plugin reads the whole collection.";
4563
+ /**
4564
+ * The reportable shape of one option's value.
4565
+ *
4566
+ * Serializable facts only, never the live selector functions — an explanation is a document a
4567
+ * caller may log, diff in a test, or send to a server, and a closure survives none of that.
4568
+ */ const detailOf = (option)=>{
4569
+ if (option.name === "filter") {
4570
+ const value = option.value;
4571
+ if (value.expression == null) {
4572
+ return undefined;
4573
+ }
4574
+ try {
4575
+ return {
4576
+ expression: types/* .Expression.toJson */.r4.toJson(value.expression)
4577
+ };
4578
+ } catch {
4579
+ // `valueToJson` rejects a value no wire can carry. Reporting the rest of the
4580
+ // explanation beats taking the diagnostic down with the query it describes.
4581
+ return {
4582
+ expressionUnavailable: "This filter holds a value that cannot be serialized."
4583
+ };
4584
+ }
4585
+ }
4586
+ if (option.name === "sort") {
4587
+ const value = option.value;
4588
+ return {
4589
+ propertyName: value.propertyName,
4590
+ direction: value.direction
4591
+ };
4592
+ }
4593
+ if (option.name === "skip" || option.name === "take") {
4594
+ return {
4595
+ value: option.value
4596
+ };
4597
+ }
4598
+ if (option.name === "nearest") {
4599
+ const value = option.value;
4600
+ return {
4601
+ propertyName: value.propertyName,
4602
+ dimensions: value.vector.length,
4603
+ count: value.count
4604
+ };
4605
+ }
4606
+ if (option.name === "join") {
4607
+ const value = option.value;
4608
+ return {
4609
+ kind: value.kind,
4610
+ outerKey: value.outerKey.propertyName,
4611
+ innerKey: value.innerKey.propertyName,
4612
+ crossPlugin: value.crossPlugin,
4613
+ innerOptions: explainedOptionsOf(value.innerOptions)
4614
+ };
4615
+ }
4616
+ if (option.name === "map" || option.name === "group") {
4617
+ const value = option.value;
4618
+ return {
4619
+ fields: value.fields.map((x)=>({
4620
+ from: x.sourceName,
4621
+ to: x.destinationName
4622
+ }))
4623
+ };
4624
+ }
4625
+ return undefined;
4626
+ };
4627
+ const explainedOptionOf = (option, index)=>{
4628
+ const detail = detailOf(option);
4629
+ return {
4630
+ index,
4631
+ name: option.name,
4632
+ ...detail == null ? {} : {
4633
+ detail
4634
+ }
4635
+ };
4636
+ };
4637
+ const explainedOptionsOf = (options)=>{
4638
+ const explained = [];
4639
+ let index = 0;
4640
+ options.forEach((option)=>explained.push(explainedOptionOf(option, index++)));
4641
+ return explained;
4642
+ };
4643
+ const summarize = (steps)=>{
4644
+ const reasons = [];
4645
+ let database = 0;
4646
+ let memory = 0;
4647
+ for (const step of steps){
4648
+ if (step.executedIn === "database") {
4649
+ database += step.options.length;
4650
+ continue;
4651
+ }
4652
+ memory += step.options.length;
4653
+ if (step.reason != null && reasons.includes(step.reason) === false) {
4654
+ reasons.push(step.reason);
4655
+ }
4656
+ }
4657
+ const counts = `${database} ${database === 1 ? "option ran" : "options ran"} in the database, ${memory} ran in memory.`;
4658
+ const causes = reasons.map((reason)=>MEMORY_EXECUTION_EXPLANATIONS[reason]).join(" ");
4659
+ return {
4660
+ database,
4661
+ memory,
4662
+ reasons,
4663
+ explanation: causes.length === 0 ? counts : `${counts} ${causes}`
4664
+ };
4665
+ };
4666
+ /**
4667
+ * Groups options into consecutive runs that execute in the same place.
4668
+ *
4669
+ * A step boundary is where execution moves, and a reader has to see the statement as step 1 OF
4670
+ * 2 to understand it is not the whole query. Cutting over to memory is a ratchet, so the
4671
+ * database options are always a prefix and there are at most two steps.
4672
+ *
4673
+ * A database step is emitted even when NO option pushed down, because the plugin is dispatched
4674
+ * either way — `createQueryPayload` always builds a database event. Without it, the worst case
4675
+ * the feature exists to expose reports "0 in the database" while the backend reads the whole
4676
+ * table, which is the opposite of the truth.
4677
+ */ const toExecutionSteps = (options)=>{
4678
+ const steps = [];
4679
+ let index = 0;
4680
+ options.forEach((option)=>{
4681
+ const explained = explainedOptionOf(option, index++);
4682
+ const current = steps[steps.length - 1];
4683
+ if (current != null && current.executedIn === option.target) {
4684
+ current.options.push(explained);
4685
+ return;
4686
+ }
4687
+ steps.push({
4688
+ step: steps.length + 1,
4689
+ of: 0,
4690
+ executedIn: option.target,
4691
+ description: option.target === "database" ? DATABASE_STEP_DESCRIPTION : MEMORY_STEP_DESCRIPTION,
4692
+ options: [
4693
+ explained
4694
+ ],
4695
+ ...option.reason == null ? {} : {
4696
+ reason: option.reason,
4697
+ explanation: MEMORY_EXECUTION_EXPLANATIONS[option.reason]
4698
+ }
4699
+ });
4700
+ });
4701
+ if (steps[0]?.executedIn !== "database") {
4702
+ steps.unshift({
4703
+ step: 0,
4704
+ of: 0,
4705
+ executedIn: "database",
4706
+ description: UNNARROWED_READ_DESCRIPTION,
4707
+ options: []
4708
+ });
4709
+ }
4710
+ for(let i = 0; i < steps.length; i++){
4711
+ steps[i].step = i + 1;
4712
+ steps[i].of = steps.length;
4713
+ }
4714
+ return steps;
4715
+ };
4716
+ /**
4717
+ * Builds the explanation from the resolved options, with no plugin involvement.
4718
+ *
4719
+ * Takes the collection BEFORE `split()`, and throws otherwise. Splitting re-adds each half
4720
+ * into a fresh collection, which re-derives targets without the options that caused them — a
4721
+ * post-join filter alone in the memory half derives back to `"database"`, and the document
4722
+ * would report memory work as having run in the database.
4723
+ */ const explainQuery = (options, context)=>{
4724
+ if (options.isDerived === true) {
4725
+ throw new Error("explainQuery was given a collection produced by split() or splitAt(). Those re-derive " + "execution targets without the options that caused them, so the explanation would report " + "memory work as having run in the database. Pass the collection as it was resolved, " + "before splitting.");
4726
+ }
4727
+ const executionSteps = toExecutionSteps(options);
4728
+ return {
4729
+ collection: context.collection,
4730
+ database: context.database,
4731
+ summary: summarize(executionSteps),
4732
+ executionSteps,
4733
+ plugin: {
4734
+ kind: context.pluginKind
4735
+ }
4736
+ };
4737
+ };
4738
+ /**
4739
+ * Attaches what the backend reported to the step that was sent to it.
4740
+ *
4741
+ * Reporting is optional for a plugin, so an empty report is not an error: the step is marked
4742
+ * `executedQueriesUnsupported` instead, and the rest of the explanation stands — the pushdown
4743
+ * analysis comes from the options and is correct with or without the plugin's statements.
4744
+ *
4745
+ * Copies the steps rather than writing into them, so the explanation a caller already holds
4746
+ * does not gain statements after the fact. Options and their details are shared with the
4747
+ * original — nothing mutates them, and copying deeper would only look safer than it is.
4748
+ */ const withExecutedQueries = (explanation, executedQueries)=>{
4749
+ let attached = false;
4750
+ const executionSteps = explanation.executionSteps.map((step)=>{
4751
+ // Only the first database step: a plugin reports what IT ran, and everything it ran
4752
+ // was sent as one dispatch. Stamping the same statements onto a second database step
4753
+ // would claim they ran twice.
4754
+ if (step.executedIn !== "database" || attached === true) {
4755
+ return {
4756
+ ...step,
4757
+ options: [
4758
+ ...step.options
4759
+ ]
4760
+ };
4761
+ }
4762
+ attached = true;
4763
+ if (executedQueries.length === 0) {
4764
+ return {
4765
+ ...step,
4766
+ options: [
4767
+ ...step.options
4768
+ ],
4769
+ executedQueriesUnsupported: EXECUTED_QUERIES_UNSUPPORTED
4770
+ };
4771
+ }
4772
+ return {
4773
+ ...step,
4774
+ options: [
4775
+ ...step.options
4776
+ ],
4777
+ executedQueries: [
4778
+ ...executedQueries
4779
+ ]
4780
+ };
4781
+ });
4782
+ return {
4783
+ ...explanation,
4784
+ executionSteps
4785
+ };
4786
+ };
4787
+
4788
+ ;// CONCATENATED MODULE: ./src/plugins/query/formatExplanation.ts
4789
+ const OPTION_LABEL_WIDTH = 8;
4790
+ const WRAP_WIDTH = 68;
4791
+ /** Wraps `text` to `WRAP_WIDTH`, prefixing every line with `indent`. */ const wrap = (text, indent)=>{
4792
+ const lines = [];
4793
+ let line = "";
4794
+ for (const word of text.split(" ")){
4795
+ if (line.length > 0 && line.length + word.length + 1 > WRAP_WIDTH) {
4796
+ lines.push(indent + line);
4797
+ line = word;
4798
+ continue;
4799
+ }
4800
+ line = line.length === 0 ? word : `${line} ${word}`;
4801
+ }
4802
+ if (line.length > 0) {
4803
+ lines.push(indent + line);
4804
+ }
4805
+ return lines;
4806
+ };
4807
+ const COMPARATOR_SYMBOLS = {
4808
+ "equals": "===",
4809
+ "greater-than": ">",
4810
+ "greater-than-equals": ">=",
4811
+ "less-than": "<",
4812
+ "less-than-equals": "<="
4813
+ };
4814
+ const describeValue = (value)=>{
4815
+ if (value == null) {
4816
+ return "?";
4817
+ }
4818
+ if (value.k === "raw") {
4819
+ return typeof value.v === "string" ? `"${value.v}"` : String(value.v);
4820
+ }
4821
+ if (value.k === "date") {
4822
+ return value.v;
4823
+ }
4824
+ if (value.k === "array") {
4825
+ return `[${value.v.map(describeValue).join(", ")}]`;
4826
+ }
4827
+ return value.k === "undefined" ? "undefined" : String(value.v);
4828
+ };
4829
+ /** Renders a serialized expression back to something close to the source predicate. */ const describeExpression = (expression)=>{
4830
+ if (expression == null) {
4831
+ return "?";
4832
+ }
4833
+ if (expression.t === "operator") {
4834
+ return `${describeExpression(expression.left)} ${expression.operator} ${describeExpression(expression.right)}`;
4835
+ }
4836
+ if (expression.t === "comparator") {
4837
+ const left = describeExpression(expression.left);
4838
+ const right = describeExpression(expression.right);
4839
+ const symbol = COMPARATOR_SYMBOLS[expression.comparator];
4840
+ if (symbol == null) {
4841
+ return `${left}.${expression.comparator}(${right})${expression.negated === true ? " === false" : ""}`;
4842
+ }
4843
+ return `${left} ${expression.negated === true ? "!==" : symbol} ${right}`;
4844
+ }
4845
+ if (expression.t === "property") {
4846
+ return expression.path;
4847
+ }
4848
+ if (expression.t === "value") {
4849
+ return describeValue(expression.value);
4850
+ }
4851
+ return expression.t === "empty" ? "(no filter)" : "(not parsable)";
4852
+ };
4853
+ const describeOption = (option)=>{
4854
+ const detail = option.detail;
4855
+ if (detail == null) {
4856
+ return "";
4857
+ }
4858
+ if (option.name === "filter") {
4859
+ return detail.expression == null ? String(detail.expressionUnavailable ?? "") : describeExpression(detail.expression);
4860
+ }
4861
+ if (option.name === "sort") {
4862
+ return `${detail.propertyName} ${detail.direction}`;
4863
+ }
4864
+ if (option.name === "skip" || option.name === "take") {
4865
+ return String(detail.value);
4866
+ }
4867
+ if (option.name === "join") {
4868
+ return `${detail.kind} → ${detail.outerKey} = ${detail.innerKey}`;
4869
+ }
4870
+ if (option.name === "nearest") {
4871
+ return `${detail.propertyName}, ${detail.count} nearest`;
4872
+ }
4873
+ if (option.name === "map" || option.name === "group") {
4874
+ const fields = detail.fields;
4875
+ return fields.map((x)=>x.from === x.to ? x.from : `${x.from} → ${x.to}`).join(", ");
4876
+ }
4877
+ return "";
4878
+ };
4879
+ const formatStep = (step, lines)=>{
4880
+ const reason = step.reason == null ? "" : ` [${step.reason}]`;
4881
+ lines.push(` STEP ${step.step} of ${step.of} — ${step.executedIn}${reason}`);
4882
+ lines.push(...wrap(step.description, " "));
4883
+ if (step.explanation != null) {
4884
+ lines.push(...wrap(step.explanation, " "));
4885
+ }
4886
+ lines.push("");
4887
+ for (const option of step.options){
4888
+ lines.push(` ${option.name.padEnd(OPTION_LABEL_WIDTH)} ${describeOption(option)}`.trimEnd());
4889
+ }
4890
+ for (const executed of step.executedQueries ?? []){
4891
+ lines.push("");
4892
+ lines.push(...executed.text.split("\n").map((line)=>` ${line}`));
4893
+ if (executed.parameters != null && executed.parameters.length > 0) {
4894
+ lines.push(` parameters: ${JSON.stringify(executed.parameters)}`);
4895
+ }
4896
+ }
4897
+ if (step.executedQueriesUnsupported != null) {
4898
+ lines.push("");
4899
+ lines.push(...wrap(step.executedQueriesUnsupported, " "));
4900
+ }
4901
+ lines.push("");
4902
+ };
4903
+ /**
4904
+ * Renders an explanation for a terminal.
4905
+ *
4906
+ * The STEP headers carry the whole lesson: a reader who has never heard of pushdown still sees
4907
+ * that the statement in step 1 is not the entire query. Nobody should have to notice a missing
4908
+ * ORDER BY to work that out.
4909
+ */ const formatExplanation = (explanation)=>{
4910
+ const { collection, database, summary, executionSteps } = explanation;
4911
+ const stepCount = `${executionSteps.length} ${executionSteps.length === 1 ? "step" : "steps"}`;
4912
+ const lines = [
4913
+ `${collection} · ${database} · ${stepCount}`,
4914
+ ""
4915
+ ];
4916
+ for (const step of executionSteps){
4917
+ formatStep(step, lines);
4918
+ }
4919
+ lines.push(...wrap(summary.explanation, " "));
4920
+ return lines.join("\n");
4921
+ };
4922
+
4961
4923
  ;// CONCATENATED MODULE: ./src/plugins/query/types.ts
4962
4924
  var types_QueryOrdering = /*#__PURE__*/ function(QueryOrdering) {
4963
4925
  QueryOrdering["Descending"] = "desc";
@@ -4972,6 +4934,8 @@ var types_QueryOrdering = /*#__PURE__*/ function(QueryOrdering) {
4972
4934
 
4973
4935
 
4974
4936
 
4937
+
4938
+
4975
4939
  // EXTERNAL MODULE: ./src/expressions/evaluate.ts
4976
4940
  var evaluate = __webpack_require__(379);
4977
4941
  ;// CONCATENATED MODULE: ./src/plugins/wire/query.ts
@@ -5443,6 +5407,7 @@ const createRequestHandler = (options)=>{
5443
5407
  const queryOptions = deserializeQueryOptions(request.options, schema, resolveSchema, // Applied to the outer collection AND to every collection a join reaches, so a
5444
5408
  // join cannot be used to read around a scope
5445
5409
  (target)=>scopeExpressionFor(target, context, "query"));
5410
+ const executedQueries = [];
5446
5411
  return await new Promise((resolve)=>{
5447
5412
  plugin.query({
5448
5413
  // `false`: nothing here attaches to a change tracker — the tracker lives on
@@ -5451,7 +5416,9 @@ const createRequestHandler = (options)=>{
5451
5416
  schemas: schemas,
5452
5417
  id: (0,uuid/* .uuid */.u)(8),
5453
5418
  source: "RequestHandler",
5454
- action: "query"
5419
+ action: "query",
5420
+ explain: request.explain,
5421
+ executedQueries
5455
5422
  }, (result)=>{
5456
5423
  if (result.ok === Result/* .PluginEventResult.ERROR */.D.ERROR) {
5457
5424
  resolve(failed(result.error));
@@ -5460,7 +5427,13 @@ const createRequestHandler = (options)=>{
5460
5427
  resolve({
5461
5428
  ok: true,
5462
5429
  kind: "query",
5463
- value: result.data.value
5430
+ value: result.data.value,
5431
+ // Only when asked, and only what the plugin reported. A plugin
5432
+ // that reported nothing sends nothing, and the caller marks the
5433
+ // remote step as not reported.
5434
+ ...request.explain === true && executedQueries.length > 0 ? {
5435
+ executedQueries
5436
+ } : {}
5464
5437
  });
5465
5438
  });
5466
5439
  });
@@ -6109,6 +6082,10 @@ class EphemeralDataPlugin {
6109
6082
  }
6110
6083
  innerRows.push(cloneRecord(record));
6111
6084
  }
6085
+ const narrowing = outerKeys == null ? "full scan" : `narrowed by ${outerKeys.size} outer ${outerKeys.size === 1 ? "key" : "keys"}`;
6086
+ event.executedQueries.push({
6087
+ text: `${innerSchema.collectionName}: scanned ${innerRows.length} in-memory ${innerRows.length === 1 ? "record" : "records"} for join inner side (${narrowing})`
6088
+ });
6112
6089
  done({
6113
6090
  ok: "success",
6114
6091
  innerSide: {
@@ -6218,7 +6195,13 @@ class EphemeralDataPlugin {
6218
6195
  * collection to pair it with three rows.
6219
6196
  *
6220
6197
  * `cloned` is in storage shape, so the keys are read by resolved column name.
6221
- */ const joinOption = operation.options.getLast("join");
6198
+ */ // No statement to quote — an ephemeral store walks its own records. Said
6199
+ // plainly so `.explain()` does not leave a reader wondering whether the
6200
+ // plugin simply failed to report. Before the inner side, to match execution order.
6201
+ event.executedQueries.push({
6202
+ text: `${operation.schema.collectionName}: scanned ${cloned.length} in-memory ${cloned.length === 1 ? "record" : "records"}`
6203
+ });
6204
+ const joinOption = operation.options.getLast("join");
6222
6205
  const outerKeys = joinOption == null ? null : distinctJoinKeys(cloned, joinOption.value.outerKey, joinOption.value.semiJoinKeyThreshold, {
6223
6206
  storageShape: true
6224
6207
  });
@@ -6302,6 +6285,69 @@ class RetryDbPlugin {
6302
6285
  }
6303
6286
  }
6304
6287
 
6288
+ ;// CONCATENATED MODULE: ./src/plugins/TelemetryDbPlugin.ts
6289
+
6290
+ /** Default sink: writes through the levelled logger, so ROUTIER_LOG_LEVEL governs it. */ const loggerSink = ()=>(e)=>{
6291
+ const line = `[routier] ${e.operation} ${e.schemas.join(",")} ${e.durationMs.toFixed(1)}ms`;
6292
+ if (e.ok === "error") {
6293
+ logger/* .logger.error */.vF.error(line, e.error);
6294
+ return;
6295
+ }
6296
+ logger/* .logger.info */.vF.info(line);
6297
+ };
6298
+ /** Pushes every event into `into`. For tests and custom buffering. */ const collectingSink = (into)=>(e)=>{
6299
+ into.push(e);
6300
+ };
6301
+ class TelemetryDbPlugin {
6302
+ plugin;
6303
+ onEvent;
6304
+ constructor(plugin, options = {}){
6305
+ this.plugin = plugin;
6306
+ this.onEvent = options.onEvent ?? loggerSink();
6307
+ }
6308
+ get databaseName() {
6309
+ return this.plugin.databaseName;
6310
+ }
6311
+ query(event, done) {
6312
+ const start = performance.now();
6313
+ this.plugin.query(event, (result)=>{
6314
+ this.emit("query", event, result, start);
6315
+ done(result);
6316
+ });
6317
+ }
6318
+ bulkPersist(event, done) {
6319
+ const start = performance.now();
6320
+ this.plugin.bulkPersist(event, (result)=>{
6321
+ this.emit("bulkPersist", event, result, start);
6322
+ done(result);
6323
+ });
6324
+ }
6325
+ destroy(event, done) {
6326
+ const start = performance.now();
6327
+ this.plugin.destroy(event, (result)=>{
6328
+ this.emit("destroy", event, result, start);
6329
+ done(result);
6330
+ });
6331
+ }
6332
+ emit(operation, event, result, start) {
6333
+ try {
6334
+ this.onEvent({
6335
+ operation,
6336
+ eventId: event.id,
6337
+ source: event.source,
6338
+ schemas: [
6339
+ ...event.schemas.values()
6340
+ ].map((s)=>s.collectionName),
6341
+ durationMs: performance.now() - start,
6342
+ ok: result.ok,
6343
+ error: result.ok === "success" ? undefined : result.error
6344
+ });
6345
+ } catch {
6346
+ // A broken sink must never fail the data operation.
6347
+ }
6348
+ }
6349
+ }
6350
+
6305
6351
  ;// CONCATENATED MODULE: ./src/plugins/CacheDbPlugin.ts
6306
6352
 
6307
6353
  /**
@@ -6311,7 +6357,7 @@ class RetryDbPlugin {
6311
6357
  * `PropertyInfo` objects carrying functions and would not survive `JSON.stringify`. A filter is
6312
6358
  * identified by its source text plus its params, which is what the expression is derived from
6313
6359
  * anyway — two queries with the same source and params are the same query.
6314
- */ const describeOption = (option)=>{
6360
+ */ const CacheDbPlugin_describeOption = (option)=>{
6315
6361
  const value = option.value;
6316
6362
  switch(option.name){
6317
6363
  case "filter":
@@ -6345,7 +6391,7 @@ class CacheDbPlugin {
6345
6391
  /** `schemaId` first, so invalidating a schema is a prefix match. */ keyFor(event) {
6346
6392
  const parts = [];
6347
6393
  event.operation.options.forEach((option)=>{
6348
- parts.push(`${option.name}:${describeOption(option)}`);
6394
+ parts.push(`${option.name}:${CacheDbPlugin_describeOption(option)}`);
6349
6395
  });
6350
6396
  return `${String(event.operation.schema.id)}\u0000${parts.join("\u0001")}`;
6351
6397
  }
@@ -6375,6 +6421,12 @@ class CacheDbPlugin {
6375
6421
  // Re-set to move it to the end of the insertion order: most recently used.
6376
6422
  this.entries.delete(key);
6377
6423
  this.entries.set(key, cached);
6424
+ // Said rather than left blank. A hit means no database was touched, which is a fact
6425
+ // worth reporting — and an empty report would otherwise read as a plugin that failed
6426
+ // to say what it ran.
6427
+ event.executedQueries.push({
6428
+ text: "cache hit — no query was executed"
6429
+ });
6378
6430
  done(Result/* .PluginEventResult.success */.D.success(event.id, this.rebuild(cached)));
6379
6431
  return;
6380
6432
  }
@@ -6760,6 +6812,7 @@ const DEFAULT_MAX_BATCH_SIZE = 100;
6760
6812
 
6761
6813
 
6762
6814
 
6815
+
6763
6816
  },
6764
6817
  198(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
6765
6818
  __webpack_require__.d(__webpack_exports__, {
@@ -6772,8 +6825,26 @@ __webpack_require__.d(__webpack_exports__, {
6772
6825
  class QueryOptionsCollection {
6773
6826
  options = new Map();
6774
6827
  nextExecutionTarget = "database";
6828
+ nextExecutionReason = null;
6775
6829
  nextIndex = 0;
6776
6830
  enumeratedItems = [];
6831
+ /** Cuts over to memory execution, keeping the first cause. See `MemoryExecutionReason`. */ cutOverToMemory(reason) {
6832
+ this.nextExecutionTarget = "memory";
6833
+ if (this.nextExecutionReason == null) {
6834
+ this.nextExecutionReason = reason;
6835
+ }
6836
+ }
6837
+ /**
6838
+ * True when `split()` or `splitAt()` produced this collection.
6839
+ *
6840
+ * Those rebuild each half by re-adding its options, which re-derives execution targets
6841
+ * without the options that caused them — a post-join filter alone in the memory half
6842
+ * derives back to `"database"`. Anything reading `target` as a report of where work runs
6843
+ * has to reject a derived collection; see `explainQuery`.
6844
+ */ derived = false;
6845
+ get isDerived() {
6846
+ return this.derived;
6847
+ }
6777
6848
  get items() {
6778
6849
  return this.options;
6779
6850
  }
@@ -6794,7 +6865,7 @@ class QueryOptionsCollection {
6794
6865
  if (mapValue.fields.some((x)=>x.isRename === true) || mapValue.fields.some((x)=>x.property?.isUnmapped === true)) {
6795
6866
  // Cut over to memory execution since we are renaming a property with .map
6796
6867
  // We do not want to figure out how the new name flows through the entire query
6797
- this.nextExecutionTarget = "memory";
6868
+ this.cutOverToMemory("map-rename");
6798
6869
  }
6799
6870
  }
6800
6871
  if (name === "filter") {
@@ -6806,13 +6877,13 @@ class QueryOptionsCollection {
6806
6877
  return;
6807
6878
  }
6808
6879
  if (filterValue.expression.type === "not-parsable") {
6809
- this.nextExecutionTarget = "memory";
6880
+ this.cutOverToMemory("not-parsable");
6810
6881
  } else {
6811
6882
  (0,_expressions_utils__rspack_import_0/* .forEach */.j)(filterValue.expression, (expression)=>{
6812
6883
  if ((0,_assertions__rspack_import_1/* .isPropertyExpression */.e3)(expression) && expression.property.isUnmapped) {
6813
6884
  // Cut over to memory execution, unmapped properties are not in the database and
6814
6885
  // cannot be queried
6815
- this.nextExecutionTarget = "memory";
6886
+ this.cutOverToMemory("unmapped-property");
6816
6887
  return false;
6817
6888
  }
6818
6889
  if ((0,_assertions__rspack_import_1/* .isPropertyExpression */.e3)(expression) && expression.property.hasRenamedSegments) {
@@ -6820,7 +6891,7 @@ class QueryOptionsCollection {
6820
6891
  // `from` (storage) names, but filter selectors reference the
6821
6892
  // in-memory names. Memory execution runs after deserialization,
6822
6893
  // where the in-memory names exist
6823
- this.nextExecutionTarget = "memory";
6894
+ this.cutOverToMemory("renamed-property");
6824
6895
  return false;
6825
6896
  }
6826
6897
  return true;
@@ -6831,8 +6902,10 @@ class QueryOptionsCollection {
6831
6902
  const sortValue = value;
6832
6903
  // Same rule as filters: sort selectors reference in-memory names, which
6833
6904
  // only exist after deserialization when the property is renamed or unmapped
6834
- if (sortValue.property != null && (sortValue.property.isUnmapped || sortValue.property.hasRenamedSegments)) {
6835
- this.nextExecutionTarget = "memory";
6905
+ if (sortValue.property != null && sortValue.property.isUnmapped) {
6906
+ this.cutOverToMemory("unmapped-property");
6907
+ } else if (sortValue.property != null && sortValue.property.hasRenamedSegments) {
6908
+ this.cutOverToMemory("renamed-property");
6836
6909
  }
6837
6910
  }
6838
6911
  if (name === "nearest") {
@@ -6843,8 +6916,10 @@ class QueryOptionsCollection {
6843
6916
  //
6844
6917
  // This is also what lets every translator's in-memory fallback read the column by
6845
6918
  // its resolved name — anything whose storage name differs never reaches them.
6846
- if (nearestValue.property != null && (nearestValue.property.isUnmapped || nearestValue.property.hasRenamedSegments)) {
6847
- this.nextExecutionTarget = "memory";
6919
+ if (nearestValue.property != null && nearestValue.property.isUnmapped) {
6920
+ this.cutOverToMemory("unmapped-property");
6921
+ } else if (nearestValue.property != null && nearestValue.property.hasRenamedSegments) {
6922
+ this.cutOverToMemory("renamed-property");
6848
6923
  }
6849
6924
  }
6850
6925
  if (name === "join") {
@@ -6856,7 +6931,7 @@ class QueryOptionsCollection {
6856
6931
  // Set BEFORE the item is created, unlike `nearest`'s ratchet below, because this
6857
6932
  // moves the join option itself rather than everything after it.
6858
6933
  if (joinValue.crossPlugin === true) {
6859
- this.nextExecutionTarget = "memory";
6934
+ this.cutOverToMemory("cross-plugin-join");
6860
6935
  }
6861
6936
  }
6862
6937
  const item = {
@@ -6864,7 +6939,10 @@ class QueryOptionsCollection {
6864
6939
  option: {
6865
6940
  name,
6866
6941
  target: this.nextExecutionTarget,
6867
- value
6942
+ value,
6943
+ ...this.nextExecutionReason == null ? {} : {
6944
+ reason: this.nextExecutionReason
6945
+ }
6868
6946
  }
6869
6947
  };
6870
6948
  this.nextIndex++;
@@ -6887,7 +6965,7 @@ class QueryOptionsCollection {
6887
6965
  //
6888
6966
  // A plugin that DID push the search down loses nothing but the chance to also
6889
6967
  // push down what follows it, which is a limit over ten rows.
6890
- this.nextExecutionTarget = "memory";
6968
+ this.cutOverToMemory("after-nearest");
6891
6969
  }
6892
6970
  if (name === "join") {
6893
6971
  // Everything AFTER a join runs in memory, for the same reason as `nearest`: this
@@ -6898,7 +6976,7 @@ class QueryOptionsCollection {
6898
6976
  // OUTER rows read, not the pairs produced — a plausible-looking result with the
6899
6977
  // wrong number of rows in it. Conjuncts that can safely run earlier are split off
6900
6978
  // by the query builder BEFORE dispatch, which is the only exception.
6901
- this.nextExecutionTarget = "memory";
6979
+ this.cutOverToMemory("after-join");
6902
6980
  }
6903
6981
  }
6904
6982
  /**
@@ -6912,6 +6990,8 @@ class QueryOptionsCollection {
6912
6990
  const sortedItems = this.enumeratedItems.toSorted((a, b)=>a.index - b.index);
6913
6991
  const before = new QueryOptionsCollection();
6914
6992
  const after = new QueryOptionsCollection();
6993
+ before.derived = true;
6994
+ after.derived = true;
6915
6995
  let at = null;
6916
6996
  for(let i = 0, length = sortedItems.length; i < length; i++){
6917
6997
  const { option } = sortedItems[i];
@@ -6945,10 +7025,12 @@ class QueryOptionsCollection {
6945
7025
  ]
6946
7026
  ]));
6947
7027
  const nextExecutionTarget = this.nextExecutionTarget;
7028
+ const nextExecutionReason = this.nextExecutionReason;
6948
7029
  const nextIndex = this.nextIndex;
6949
7030
  return ()=>{
6950
7031
  this.options = new Map(options);
6951
7032
  this.nextExecutionTarget = nextExecutionTarget;
7033
+ this.nextExecutionReason = nextExecutionReason;
6952
7034
  this.nextIndex = nextIndex;
6953
7035
  this.enumeratedItems = [];
6954
7036
  };
@@ -6958,6 +7040,8 @@ class QueryOptionsCollection {
6958
7040
  const sortedItems = this.enumeratedItems.toSorted((a, b)=>a.index - b.index);
6959
7041
  const memoryQueryOptionsCollection = new QueryOptionsCollection();
6960
7042
  const databaseQueryOptionsCollection = new QueryOptionsCollection();
7043
+ memoryQueryOptionsCollection.derived = true;
7044
+ databaseQueryOptionsCollection.derived = true;
6961
7045
  for(let i = 0, length = sortedItems.length; i < length; i++){
6962
7046
  const sortedItem = sortedItems[i];
6963
7047
  if (sortedItem.option.target === "database") {
@@ -13744,6 +13828,7 @@ __webpack_require__.d(__webpack_exports__, {
13744
13828
  Jd: () => (/* reexport safe */ _plugins__rspack_import_7.Jd),
13745
13829
  KB: () => (/* reexport safe */ _plugins__rspack_import_7.KB),
13746
13830
  KC: () => (/* reexport safe */ _schema__rspack_import_9.KC),
13831
+ Kg: () => (/* reexport safe */ _plugins__rspack_import_7.Kg),
13747
13832
  Ko: () => (/* reexport safe */ _expressions__rspack_import_4.Ko),
13748
13833
  Kp: () => (/* reexport safe */ _collections__rspack_import_2.r4),
13749
13834
  L$: () => (/* reexport safe */ _schema__rspack_import_9.L$),
@@ -13761,6 +13846,7 @@ __webpack_require__.d(__webpack_exports__, {
13761
13846
  PG: () => (/* reexport safe */ _schema__rspack_import_9.PG),
13762
13847
  PP: () => (/* reexport safe */ _plugins__rspack_import_7.PP),
13763
13848
  Pl: () => (/* reexport safe */ _plugins__rspack_import_7.Pl),
13849
+ Pr: () => (/* reexport safe */ _plugins__rspack_import_7.Pr),
13764
13850
  Q7: () => (/* reexport safe */ _results__rspack_import_8.Q7),
13765
13851
  QB: () => (/* reexport safe */ _plugins__rspack_import_7.QB),
13766
13852
  Qc: () => (/* reexport safe */ _schema__rspack_import_9.Qc),
@@ -13775,14 +13861,12 @@ __webpack_require__.d(__webpack_exports__, {
13775
13861
  UQ: () => (/* reexport safe */ _pipeline__rspack_import_6.UQ),
13776
13862
  UX: () => (/* reexport safe */ _schema__rspack_import_9.UX),
13777
13863
  VG: () => (/* reexport safe */ _schema__rspack_import_9.VG),
13778
- VP: () => (/* reexport safe */ _capabilities__rspack_import_11.VP),
13779
13864
  VT: () => (/* reexport safe */ _errors__rspack_import_3.VT),
13780
13865
  VW: () => (/* reexport safe */ _plugins__rspack_import_7.VW),
13781
13866
  Vg: () => (/* reexport safe */ _utilities__rspack_import_10.Vg),
13782
13867
  Vu: () => (/* reexport safe */ _expressions__rspack_import_4.Vu),
13783
13868
  XK: () => (/* reexport safe */ _plugins__rspack_import_7.XK),
13784
13869
  XM: () => (/* reexport safe */ _schema__rspack_import_9.XM),
13785
- XO: () => (/* reexport safe */ _capabilities__rspack_import_11.XO),
13786
13870
  Ye: () => (/* reexport safe */ _assertions__rspack_import_0.Ye),
13787
13871
  Zm: () => (/* reexport safe */ _codegen__rspack_import_1.Zm),
13788
13872
  _3: () => (/* reexport safe */ _expressions__rspack_import_4._3),
@@ -13791,6 +13875,7 @@ __webpack_require__.d(__webpack_exports__, {
13791
13875
  _h: () => (/* reexport safe */ _schema__rspack_import_9._h),
13792
13876
  _t: () => (/* reexport safe */ _schema__rspack_import_9._t),
13793
13877
  _v: () => (/* reexport safe */ _collections__rspack_import_2._v),
13878
+ ae: () => (/* reexport safe */ _plugins__rspack_import_7.ae),
13794
13879
  ap: () => (/* reexport safe */ _utilities__rspack_import_10.ap),
13795
13880
  as: () => (/* reexport safe */ _plugins__rspack_import_7.as),
13796
13881
  av: () => (/* reexport safe */ _utilities__rspack_import_10.av),
@@ -13807,6 +13892,7 @@ __webpack_require__.d(__webpack_exports__, {
13807
13892
  fe: () => (/* reexport safe */ _codegen__rspack_import_1.fe),
13808
13893
  fw: () => (/* reexport safe */ _expressions__rspack_import_4.fw),
13809
13894
  g5: () => (/* reexport safe */ _collections__rspack_import_2.g5),
13895
+ gH: () => (/* reexport safe */ _plugins__rspack_import_7.gH),
13810
13896
  gZ: () => (/* reexport safe */ _utilities__rspack_import_10.gZ),
13811
13897
  g_: () => (/* reexport safe */ _schema__rspack_import_9.g_),
13812
13898
  ge: () => (/* reexport safe */ _schema__rspack_import_9.ge),
@@ -13818,6 +13904,7 @@ __webpack_require__.d(__webpack_exports__, {
13818
13904
  iG: () => (/* reexport safe */ _plugins__rspack_import_7.iG),
13819
13905
  ix: () => (/* reexport safe */ _schema__rspack_import_9.ix),
13820
13906
  j7: () => (/* reexport safe */ _codegen__rspack_import_1.j7),
13907
+ jE: () => (/* reexport safe */ _plugins__rspack_import_7.jE),
13821
13908
  jJ: () => (/* reexport safe */ _expressions__rspack_import_4.jJ),
13822
13909
  jO: () => (/* reexport safe */ _plugins__rspack_import_7.jO),
13823
13910
  jV: () => (/* reexport safe */ _utilities__rspack_import_10.Cg),
@@ -13832,7 +13919,6 @@ __webpack_require__.d(__webpack_exports__, {
13832
13919
  ly: () => (/* reexport safe */ _schema__rspack_import_9.ly),
13833
13920
  m6: () => (/* reexport safe */ _plugins__rspack_import_7.m6),
13834
13921
  n: () => (/* reexport safe */ _plugins__rspack_import_7.n),
13835
- nS: () => (/* reexport safe */ _capabilities__rspack_import_11.nS),
13836
13922
  nn: () => (/* reexport safe */ _assertions__rspack_import_0.nn),
13837
13923
  o8: () => (/* reexport safe */ _utilities__rspack_import_10.o8),
13838
13924
  oH: () => (/* reexport safe */ _expressions__rspack_import_4.oH),
@@ -13847,6 +13933,7 @@ __webpack_require__.d(__webpack_exports__, {
13847
13933
  qK: () => (/* reexport safe */ _utilities__rspack_import_10.Zm),
13848
13934
  qQ: () => (/* reexport safe */ _schema__rspack_import_9.qQ),
13849
13935
  qY: () => (/* reexport safe */ _codegen__rspack_import_1.qY),
13936
+ qj: () => (/* reexport safe */ _plugins__rspack_import_7.qj),
13850
13937
  qk: () => (/* reexport safe */ _collections__rspack_import_2.qk),
13851
13938
  qy: () => (/* reexport safe */ _plugins__rspack_import_7.qy),
13852
13939
  r4: () => (/* reexport safe */ _expressions__rspack_import_4.r4),
@@ -13859,9 +13946,11 @@ __webpack_require__.d(__webpack_exports__, {
13859
13946
  tX: () => (/* reexport safe */ _utilities__rspack_import_10.tX),
13860
13947
  uR: () => (/* reexport safe */ _utilities__rspack_import_10.uR),
13861
13948
  vF: () => (/* reexport safe */ _utilities__rspack_import_10.vF),
13949
+ vZ: () => (/* reexport safe */ _plugins__rspack_import_7.vZ),
13862
13950
  vg: () => (/* reexport safe */ _assertions__rspack_import_0.vg),
13863
13951
  wL: () => (/* reexport safe */ _assertions__rspack_import_0.wL),
13864
13952
  wM: () => (/* reexport safe */ _collections__rspack_import_2.wM),
13953
+ wN: () => (/* reexport safe */ _plugins__rspack_import_7.wN),
13865
13954
  wS: () => (/* reexport safe */ _expressions__rspack_import_4.wS),
13866
13955
  w_: () => (/* reexport safe */ _schema__rspack_import_9.w_),
13867
13956
  wg: () => (/* reexport safe */ _utilities__rspack_import_10.wg),
@@ -13885,12 +13974,10 @@ __webpack_require__.d(__webpack_exports__, {
13885
13974
  /* import */ var _expressions__rspack_import_4 = __webpack_require__(138);
13886
13975
  /* import */ var _performance__rspack_import_5 = __webpack_require__(971);
13887
13976
  /* import */ var _pipeline__rspack_import_6 = __webpack_require__(314);
13888
- /* import */ var _plugins__rspack_import_7 = __webpack_require__(771);
13977
+ /* import */ var _plugins__rspack_import_7 = __webpack_require__(454);
13889
13978
  /* import */ var _results__rspack_import_8 = __webpack_require__(264);
13890
13979
  /* import */ var _schema__rspack_import_9 = __webpack_require__(755);
13891
13980
  /* import */ var _utilities__rspack_import_10 = __webpack_require__(222);
13892
- /* import */ var _capabilities__rspack_import_11 = __webpack_require__(599);
13893
-
13894
13981
 
13895
13982
 
13896
13983
 
@@ -13914,13 +14001,13 @@ var __webpack_exports__Block = __webpack_exports__.eB;
13914
14001
  var __webpack_exports__BulkPersistChanges = __webpack_exports__.qk;
13915
14002
  var __webpack_exports__BulkPersistResult = __webpack_exports__.om;
13916
14003
  var __webpack_exports__CacheDbPlugin = __webpack_exports__.y4;
13917
- var __webpack_exports__Capability = __webpack_exports__.nS;
13918
14004
  var __webpack_exports__CodeBuilder = __webpack_exports__.Nl;
13919
14005
  var __webpack_exports__ComparatorExpression = __webpack_exports__.bQ;
13920
14006
  var __webpack_exports__ConcurrencyDbPlugin = __webpack_exports__.bX;
13921
14007
  var __webpack_exports__ContainerBlock = __webpack_exports__.j7;
13922
14008
  var __webpack_exports__DEFAULT_SEMI_JOIN_KEY_THRESHOLD = __webpack_exports__._b;
13923
14009
  var __webpack_exports__DataTranslator = __webpack_exports__.JF;
14010
+ var __webpack_exports__EXECUTED_QUERIES_UNSUPPORTED = __webpack_exports__.jE;
13924
14011
  var __webpack_exports__EXPRESSION_TYPES = __webpack_exports__.tA;
13925
14012
  var __webpack_exports__EmptyExpression = __webpack_exports__.Sm;
13926
14013
  var __webpack_exports__EphemeralDataPlugin = __webpack_exports__.Jd;
@@ -13932,12 +14019,12 @@ var __webpack_exports__IdSet = __webpack_exports__.wp;
13932
14019
  var __webpack_exports__IfBuilder = __webpack_exports__.Zm;
13933
14020
  var __webpack_exports__JsonTranslator = __webpack_exports__.d0;
13934
14021
  var __webpack_exports__LOG_LEVELS = __webpack_exports__.p_;
14022
+ var __webpack_exports__MEMORY_EXECUTION_EXPLANATIONS = __webpack_exports__.gH;
13935
14023
  var __webpack_exports__MemoryDataCollection = __webpack_exports__._v;
13936
14024
  var __webpack_exports__NotParsableExpression = __webpack_exports__.SC;
13937
14025
  var __webpack_exports__ObjectBuilder = __webpack_exports__.Tl;
13938
14026
  var __webpack_exports__OperatorExpression = __webpack_exports__.fw;
13939
14027
  var __webpack_exports__OptimisticConcurrencyError = __webpack_exports__.VT;
13940
- var __webpack_exports__PerformanceCapability = __webpack_exports__.VP;
13941
14028
  var __webpack_exports__PluginDestroyedError = __webpack_exports__.fL;
13942
14029
  var __webpack_exports__PluginEventResult = __webpack_exports__.Dq;
13943
14030
  var __webpack_exports__PropertyExpression = __webpack_exports__.ep;
@@ -13987,7 +14074,7 @@ var __webpack_exports__SqlTranslator = __webpack_exports__.DF;
13987
14074
  var __webpack_exports__StringBuilder = __webpack_exports__.fe;
13988
14075
  var __webpack_exports__SyncronousQueue = __webpack_exports__.hq;
13989
14076
  var __webpack_exports__TagCollection = __webpack_exports__.Kp;
13990
- var __webpack_exports__TracingCapability = __webpack_exports__.XO;
14077
+ var __webpack_exports__TelemetryDbPlugin = __webpack_exports__.Pr;
13991
14078
  var __webpack_exports__TrampolinePipeline = __webpack_exports__.Tz;
13992
14079
  var __webpack_exports__TranslatedArrayValue = __webpack_exports__.xw;
13993
14080
  var __webpack_exports__TranslatedGroupValue = __webpack_exports__.f2;
@@ -14005,6 +14092,7 @@ var __webpack_exports__assertIsNumber = __webpack_exports__.Ye;
14005
14092
  var __webpack_exports__assertString = __webpack_exports__.Cv;
14006
14093
  var __webpack_exports__cast = __webpack_exports__.wg;
14007
14094
  var __webpack_exports__clone = __webpack_exports__.o8;
14095
+ var __webpack_exports__collectingSink = __webpack_exports__.wN;
14008
14096
  var __webpack_exports__combineExpressions = __webpack_exports__.pg;
14009
14097
  var __webpack_exports__combineQueryOptionsCollections = __webpack_exports__.N8;
14010
14098
  var __webpack_exports__compiledSchemaToJsonSchema = __webpack_exports__.VG;
@@ -14017,9 +14105,11 @@ var __webpack_exports__deserializeQueryOptions = __webpack_exports__.II;
14017
14105
  var __webpack_exports__distinctJoinKeys = __webpack_exports__.RK;
14018
14106
  var __webpack_exports__evaluate = __webpack_exports__._3;
14019
14107
  var __webpack_exports__executeJoin = __webpack_exports__.m6;
14108
+ var __webpack_exports__explainQuery = __webpack_exports__.ae;
14020
14109
  var __webpack_exports__extractTypeInfo = __webpack_exports__.Od;
14021
14110
  var __webpack_exports__fastHash = __webpack_exports__.Nr;
14022
14111
  var __webpack_exports__forEach = __webpack_exports__.jJ;
14112
+ var __webpack_exports__formatExplanation = __webpack_exports__.vZ;
14023
14113
  var __webpack_exports__getLogLevel = __webpack_exports__.o_;
14024
14114
  var __webpack_exports__getProperties = __webpack_exports__.oY;
14025
14115
  var __webpack_exports__hasPrimitiveElements = __webpack_exports__.LL;
@@ -14039,6 +14129,7 @@ var __webpack_exports__isValueExpression = __webpack_exports__.S6;
14039
14129
  var __webpack_exports__joinInPlugin = __webpack_exports__.zH;
14040
14130
  var __webpack_exports__loadJoinInnerSide = __webpack_exports__.as;
14041
14131
  var __webpack_exports__logger = __webpack_exports__.vF;
14132
+ var __webpack_exports__loggerSink = __webpack_exports__.qj;
14042
14133
  var __webpack_exports__measure = __webpack_exports__.xP;
14043
14134
  var __webpack_exports__nearestBy = __webpack_exports__.iG;
14044
14135
  var __webpack_exports__noop = __webpack_exports__.lQ;
@@ -14068,6 +14159,7 @@ var __webpack_exports__toStrictPredicate = __webpack_exports__.wS;
14068
14159
  var __webpack_exports__unsafeCast = __webpack_exports__.sz;
14069
14160
  var __webpack_exports__uuid = __webpack_exports__.uR;
14070
14161
  var __webpack_exports__uuidv4 = __webpack_exports__.gZ;
14071
- export { __webpack_exports__AndBuilder as AndBuilder, __webpack_exports__ArrayBuilder as ArrayBuilder, __webpack_exports__AssignmentBuilder as AssignmentBuilder, __webpack_exports__BatchingDbPlugin as BatchingDbPlugin, __webpack_exports__Block as Block, __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__CacheDbPlugin as CacheDbPlugin, __webpack_exports__Capability as Capability, __webpack_exports__CodeBuilder as CodeBuilder, __webpack_exports__ComparatorExpression as ComparatorExpression, __webpack_exports__ConcurrencyDbPlugin as ConcurrencyDbPlugin, __webpack_exports__ContainerBlock as ContainerBlock, __webpack_exports__DEFAULT_SEMI_JOIN_KEY_THRESHOLD as DEFAULT_SEMI_JOIN_KEY_THRESHOLD, __webpack_exports__DataTranslator as DataTranslator, __webpack_exports__EXPRESSION_TYPES as EXPRESSION_TYPES, __webpack_exports__EmptyExpression as EmptyExpression, __webpack_exports__EphemeralDataPlugin as EphemeralDataPlugin, __webpack_exports__Expression as Expression, __webpack_exports__FunctionBuilder as FunctionBuilder, __webpack_exports__FunctionFactoryBuilder as FunctionFactoryBuilder, __webpack_exports__HashType as HashType, __webpack_exports__IdSet as IdSet, __webpack_exports__IfBuilder as IfBuilder, __webpack_exports__JsonTranslator as JsonTranslator, __webpack_exports__LOG_LEVELS as LOG_LEVELS, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__NotParsableExpression as NotParsableExpression, __webpack_exports__ObjectBuilder as ObjectBuilder, __webpack_exports__OperatorExpression as OperatorExpression, __webpack_exports__OptimisticConcurrencyError as OptimisticConcurrencyError, __webpack_exports__PerformanceCapability as PerformanceCapability, __webpack_exports__PluginDestroyedError as PluginDestroyedError, __webpack_exports__PluginEventResult as PluginEventResult, __webpack_exports__PropertyExpression as PropertyExpression, __webpack_exports__PropertyInfo as PropertyInfo, __webpack_exports__Query as Query, __webpack_exports__QueryOptionsCollection as QueryOptionsCollection, __webpack_exports__QueryOrdering as QueryOrdering, __webpack_exports__RawBuilder as RawBuilder, __webpack_exports__ReadonlySchemaCollection as ReadonlySchemaCollection, __webpack_exports__Result as Result, __webpack_exports__RetryDbPlugin as RetryDbPlugin, __webpack_exports__SchemaArray as SchemaArray, __webpack_exports__SchemaBase as SchemaBase, __webpack_exports__SchemaBoolean as SchemaBoolean, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaComputed as SchemaComputed, __webpack_exports__SchemaDate as SchemaDate, __webpack_exports__SchemaDefault as SchemaDefault, __webpack_exports__SchemaDefinition as SchemaDefinition, __webpack_exports__SchemaDeserialize as SchemaDeserialize, __webpack_exports__SchemaDistinct as SchemaDistinct, __webpack_exports__SchemaError as SchemaError, __webpack_exports__SchemaFile as SchemaFile, __webpack_exports__SchemaForeignKey as SchemaForeignKey, __webpack_exports__SchemaFrom as SchemaFrom, __webpack_exports__SchemaFunction as SchemaFunction, __webpack_exports__SchemaIdentity as SchemaIdentity, __webpack_exports__SchemaIndex as SchemaIndex, __webpack_exports__SchemaKey as SchemaKey, __webpack_exports__SchemaNullable as SchemaNullable, __webpack_exports__SchemaNumber as SchemaNumber, __webpack_exports__SchemaObject as SchemaObject, __webpack_exports__SchemaOptional as SchemaOptional, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__SchemaReadonly as SchemaReadonly, __webpack_exports__SchemaSearchable as SchemaSearchable, __webpack_exports__SchemaSerialize as SchemaSerialize, __webpack_exports__SchemaString as SchemaString, __webpack_exports__SchemaTag as SchemaTag, __webpack_exports__SchemaTracked as SchemaTracked, __webpack_exports__SchemaTransform as SchemaTransform, __webpack_exports__SchemaTypes as SchemaTypes, __webpack_exports__SchemaVector as SchemaVector, __webpack_exports__SlotBlock as SlotBlock, __webpack_exports__SqlTranslator as SqlTranslator, __webpack_exports__StringBuilder as StringBuilder, __webpack_exports__SyncronousQueue as SyncronousQueue, __webpack_exports__TagCollection as TagCollection, __webpack_exports__TracingCapability as TracingCapability, __webpack_exports__TrampolinePipeline as TrampolinePipeline, __webpack_exports__TranslatedArrayValue as TranslatedArrayValue, __webpack_exports__TranslatedGroupValue as TranslatedGroupValue, __webpack_exports__TranslatedSingleValue as TranslatedSingleValue, __webpack_exports__TupleTranslator as TupleTranslator, __webpack_exports__ValueExpression as ValueExpression, __webpack_exports__VariableBuilder as VariableBuilder, __webpack_exports__WorkPipeline as WorkPipeline, __webpack_exports__applyInnerOptions as applyInnerOptions, __webpack_exports__assertDate as assertDate, __webpack_exports__assertInstanceOf as assertInstanceOf, __webpack_exports__assertIsArray as assertIsArray, __webpack_exports__assertIsNotNull as assertIsNotNull, __webpack_exports__assertIsNumber as assertIsNumber, __webpack_exports__assertString as assertString, __webpack_exports__cast as cast, __webpack_exports__clone as clone, __webpack_exports__combineExpressions as combineExpressions, __webpack_exports__combineQueryOptionsCollections as combineQueryOptionsCollections, __webpack_exports__compiledSchemaToJsonSchema as compiledSchemaToJsonSchema, __webpack_exports__cosineDistance as cosineDistance, __webpack_exports__createRequestHandler as createRequestHandler, __webpack_exports__createStandardJsonSchemaProps as createStandardJsonSchemaProps, __webpack_exports__deserializeBulkPersist as deserializeBulkPersist, __webpack_exports__deserializePersistResult as deserializePersistResult, __webpack_exports__deserializeQueryOptions as deserializeQueryOptions, __webpack_exports__distinctJoinKeys as distinctJoinKeys, __webpack_exports__evaluate as evaluate, __webpack_exports__executeJoin as executeJoin, __webpack_exports__extractTypeInfo as extractTypeInfo, __webpack_exports__fastHash as fastHash, __webpack_exports__forEach as forEach, __webpack_exports__getLogLevel as getLogLevel, __webpack_exports__getProperties as getProperties, __webpack_exports__hasPrimitiveElements as hasPrimitiveElements, __webpack_exports__hash as hash, __webpack_exports__hashJoin as hashJoin, __webpack_exports__isArrayValued as isArrayValued, __webpack_exports__isComparatorExpression as isComparatorExpression, __webpack_exports__isDate as isDate, __webpack_exports__isEmptyExpression as isEmptyExpression, __webpack_exports__isExpression as isExpression, __webpack_exports__isLogLevelEnabled as isLogLevelEnabled, __webpack_exports__isNodeRuntime as isNodeRuntime, __webpack_exports__isNotParsableExpression as isNotParsableExpression, __webpack_exports__isOperatorExpression as isOperatorExpression, __webpack_exports__isPropertyExpression as isPropertyExpression, __webpack_exports__isValueExpression as isValueExpression, __webpack_exports__joinInPlugin as joinInPlugin, __webpack_exports__loadJoinInnerSide as loadJoinInnerSide, __webpack_exports__logger as logger, __webpack_exports__measure as measure, __webpack_exports__nearestBy as nearestBy, __webpack_exports__noop as noop, __webpack_exports__now as now, __webpack_exports__parseFragment as parseFragment, __webpack_exports__propertyInfoToJsonSchema as propertyInfoToJsonSchema, __webpack_exports__readJoinKey as readJoinKey, __webpack_exports__rehydrateSchemaFromJsonSchema as rehydrateSchemaFromJsonSchema, __webpack_exports__rehydrateSchemaFromJsonString as rehydrateSchemaFromJsonString, __webpack_exports__resetLogLevel as resetLogLevel, __webpack_exports__resolveBulkPersistChanges as resolveBulkPersistChanges, __webpack_exports__s as s, __webpack_exports__semiJoinFilter as semiJoinFilter, __webpack_exports__serializeBulkPersist as serializeBulkPersist, __webpack_exports__serializePersistResult as serializePersistResult, __webpack_exports__serializeQueryOptions as serializeQueryOptions, __webpack_exports__setLogLevel as setLogLevel, __webpack_exports__splitSendableOptions as splitSendableOptions, __webpack_exports__stringifyObject as stringifyObject, __webpack_exports__toEntityShape as toEntityShape, __webpack_exports__toEventArray as toEventArray, __webpack_exports__toExpression as toExpression, __webpack_exports__toMap as toMap, __webpack_exports__toPredicate as toPredicate, __webpack_exports__toPromise as toPromise, __webpack_exports__toStrictPredicate as toStrictPredicate, __webpack_exports__unsafeCast as unsafeCast, __webpack_exports__uuid as uuid, __webpack_exports__uuidv4 as uuidv4 };
14162
+ var __webpack_exports__withExecutedQueries = __webpack_exports__.Kg;
14163
+ export { __webpack_exports__AndBuilder as AndBuilder, __webpack_exports__ArrayBuilder as ArrayBuilder, __webpack_exports__AssignmentBuilder as AssignmentBuilder, __webpack_exports__BatchingDbPlugin as BatchingDbPlugin, __webpack_exports__Block as Block, __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__CacheDbPlugin as CacheDbPlugin, __webpack_exports__CodeBuilder as CodeBuilder, __webpack_exports__ComparatorExpression as ComparatorExpression, __webpack_exports__ConcurrencyDbPlugin as ConcurrencyDbPlugin, __webpack_exports__ContainerBlock as ContainerBlock, __webpack_exports__DEFAULT_SEMI_JOIN_KEY_THRESHOLD as DEFAULT_SEMI_JOIN_KEY_THRESHOLD, __webpack_exports__DataTranslator as DataTranslator, __webpack_exports__EXECUTED_QUERIES_UNSUPPORTED as EXECUTED_QUERIES_UNSUPPORTED, __webpack_exports__EXPRESSION_TYPES as EXPRESSION_TYPES, __webpack_exports__EmptyExpression as EmptyExpression, __webpack_exports__EphemeralDataPlugin as EphemeralDataPlugin, __webpack_exports__Expression as Expression, __webpack_exports__FunctionBuilder as FunctionBuilder, __webpack_exports__FunctionFactoryBuilder as FunctionFactoryBuilder, __webpack_exports__HashType as HashType, __webpack_exports__IdSet as IdSet, __webpack_exports__IfBuilder as IfBuilder, __webpack_exports__JsonTranslator as JsonTranslator, __webpack_exports__LOG_LEVELS as LOG_LEVELS, __webpack_exports__MEMORY_EXECUTION_EXPLANATIONS as MEMORY_EXECUTION_EXPLANATIONS, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__NotParsableExpression as NotParsableExpression, __webpack_exports__ObjectBuilder as ObjectBuilder, __webpack_exports__OperatorExpression as OperatorExpression, __webpack_exports__OptimisticConcurrencyError as OptimisticConcurrencyError, __webpack_exports__PluginDestroyedError as PluginDestroyedError, __webpack_exports__PluginEventResult as PluginEventResult, __webpack_exports__PropertyExpression as PropertyExpression, __webpack_exports__PropertyInfo as PropertyInfo, __webpack_exports__Query as Query, __webpack_exports__QueryOptionsCollection as QueryOptionsCollection, __webpack_exports__QueryOrdering as QueryOrdering, __webpack_exports__RawBuilder as RawBuilder, __webpack_exports__ReadonlySchemaCollection as ReadonlySchemaCollection, __webpack_exports__Result as Result, __webpack_exports__RetryDbPlugin as RetryDbPlugin, __webpack_exports__SchemaArray as SchemaArray, __webpack_exports__SchemaBase as SchemaBase, __webpack_exports__SchemaBoolean as SchemaBoolean, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaComputed as SchemaComputed, __webpack_exports__SchemaDate as SchemaDate, __webpack_exports__SchemaDefault as SchemaDefault, __webpack_exports__SchemaDefinition as SchemaDefinition, __webpack_exports__SchemaDeserialize as SchemaDeserialize, __webpack_exports__SchemaDistinct as SchemaDistinct, __webpack_exports__SchemaError as SchemaError, __webpack_exports__SchemaFile as SchemaFile, __webpack_exports__SchemaForeignKey as SchemaForeignKey, __webpack_exports__SchemaFrom as SchemaFrom, __webpack_exports__SchemaFunction as SchemaFunction, __webpack_exports__SchemaIdentity as SchemaIdentity, __webpack_exports__SchemaIndex as SchemaIndex, __webpack_exports__SchemaKey as SchemaKey, __webpack_exports__SchemaNullable as SchemaNullable, __webpack_exports__SchemaNumber as SchemaNumber, __webpack_exports__SchemaObject as SchemaObject, __webpack_exports__SchemaOptional as SchemaOptional, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__SchemaReadonly as SchemaReadonly, __webpack_exports__SchemaSearchable as SchemaSearchable, __webpack_exports__SchemaSerialize as SchemaSerialize, __webpack_exports__SchemaString as SchemaString, __webpack_exports__SchemaTag as SchemaTag, __webpack_exports__SchemaTracked as SchemaTracked, __webpack_exports__SchemaTransform as SchemaTransform, __webpack_exports__SchemaTypes as SchemaTypes, __webpack_exports__SchemaVector as SchemaVector, __webpack_exports__SlotBlock as SlotBlock, __webpack_exports__SqlTranslator as SqlTranslator, __webpack_exports__StringBuilder as StringBuilder, __webpack_exports__SyncronousQueue as SyncronousQueue, __webpack_exports__TagCollection as TagCollection, __webpack_exports__TelemetryDbPlugin as TelemetryDbPlugin, __webpack_exports__TrampolinePipeline as TrampolinePipeline, __webpack_exports__TranslatedArrayValue as TranslatedArrayValue, __webpack_exports__TranslatedGroupValue as TranslatedGroupValue, __webpack_exports__TranslatedSingleValue as TranslatedSingleValue, __webpack_exports__TupleTranslator as TupleTranslator, __webpack_exports__ValueExpression as ValueExpression, __webpack_exports__VariableBuilder as VariableBuilder, __webpack_exports__WorkPipeline as WorkPipeline, __webpack_exports__applyInnerOptions as applyInnerOptions, __webpack_exports__assertDate as assertDate, __webpack_exports__assertInstanceOf as assertInstanceOf, __webpack_exports__assertIsArray as assertIsArray, __webpack_exports__assertIsNotNull as assertIsNotNull, __webpack_exports__assertIsNumber as assertIsNumber, __webpack_exports__assertString as assertString, __webpack_exports__cast as cast, __webpack_exports__clone as clone, __webpack_exports__collectingSink as collectingSink, __webpack_exports__combineExpressions as combineExpressions, __webpack_exports__combineQueryOptionsCollections as combineQueryOptionsCollections, __webpack_exports__compiledSchemaToJsonSchema as compiledSchemaToJsonSchema, __webpack_exports__cosineDistance as cosineDistance, __webpack_exports__createRequestHandler as createRequestHandler, __webpack_exports__createStandardJsonSchemaProps as createStandardJsonSchemaProps, __webpack_exports__deserializeBulkPersist as deserializeBulkPersist, __webpack_exports__deserializePersistResult as deserializePersistResult, __webpack_exports__deserializeQueryOptions as deserializeQueryOptions, __webpack_exports__distinctJoinKeys as distinctJoinKeys, __webpack_exports__evaluate as evaluate, __webpack_exports__executeJoin as executeJoin, __webpack_exports__explainQuery as explainQuery, __webpack_exports__extractTypeInfo as extractTypeInfo, __webpack_exports__fastHash as fastHash, __webpack_exports__forEach as forEach, __webpack_exports__formatExplanation as formatExplanation, __webpack_exports__getLogLevel as getLogLevel, __webpack_exports__getProperties as getProperties, __webpack_exports__hasPrimitiveElements as hasPrimitiveElements, __webpack_exports__hash as hash, __webpack_exports__hashJoin as hashJoin, __webpack_exports__isArrayValued as isArrayValued, __webpack_exports__isComparatorExpression as isComparatorExpression, __webpack_exports__isDate as isDate, __webpack_exports__isEmptyExpression as isEmptyExpression, __webpack_exports__isExpression as isExpression, __webpack_exports__isLogLevelEnabled as isLogLevelEnabled, __webpack_exports__isNodeRuntime as isNodeRuntime, __webpack_exports__isNotParsableExpression as isNotParsableExpression, __webpack_exports__isOperatorExpression as isOperatorExpression, __webpack_exports__isPropertyExpression as isPropertyExpression, __webpack_exports__isValueExpression as isValueExpression, __webpack_exports__joinInPlugin as joinInPlugin, __webpack_exports__loadJoinInnerSide as loadJoinInnerSide, __webpack_exports__logger as logger, __webpack_exports__loggerSink as loggerSink, __webpack_exports__measure as measure, __webpack_exports__nearestBy as nearestBy, __webpack_exports__noop as noop, __webpack_exports__now as now, __webpack_exports__parseFragment as parseFragment, __webpack_exports__propertyInfoToJsonSchema as propertyInfoToJsonSchema, __webpack_exports__readJoinKey as readJoinKey, __webpack_exports__rehydrateSchemaFromJsonSchema as rehydrateSchemaFromJsonSchema, __webpack_exports__rehydrateSchemaFromJsonString as rehydrateSchemaFromJsonString, __webpack_exports__resetLogLevel as resetLogLevel, __webpack_exports__resolveBulkPersistChanges as resolveBulkPersistChanges, __webpack_exports__s as s, __webpack_exports__semiJoinFilter as semiJoinFilter, __webpack_exports__serializeBulkPersist as serializeBulkPersist, __webpack_exports__serializePersistResult as serializePersistResult, __webpack_exports__serializeQueryOptions as serializeQueryOptions, __webpack_exports__setLogLevel as setLogLevel, __webpack_exports__splitSendableOptions as splitSendableOptions, __webpack_exports__stringifyObject as stringifyObject, __webpack_exports__toEntityShape as toEntityShape, __webpack_exports__toEventArray as toEventArray, __webpack_exports__toExpression as toExpression, __webpack_exports__toMap as toMap, __webpack_exports__toPredicate as toPredicate, __webpack_exports__toPromise as toPromise, __webpack_exports__toStrictPredicate as toStrictPredicate, __webpack_exports__unsafeCast as unsafeCast, __webpack_exports__uuid as uuid, __webpack_exports__uuidv4 as uuidv4, __webpack_exports__withExecutedQueries as withExecutedQueries };
14072
14164
 
14073
14165
  //# sourceMappingURL=index.js.map