@atscript/db 0.1.147 → 0.1.149

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 (55) hide show
  1. package/dist/{agg-CV7y8nC6.d.cts → agg-42CSpGDR.d.cts} +2 -2
  2. package/dist/{agg-D5DHsAby.d.mts → agg-Wo-smrYV.d.mts} +3 -3
  3. package/dist/agg.cjs +1 -1
  4. package/dist/agg.d.cts +2 -2
  5. package/dist/agg.d.mts +2 -2
  6. package/dist/agg.mjs +1 -1
  7. package/dist/{aggregate-fns-CtsRbZn9.cjs → aggregate-fns-C-UJRobm.cjs} +46 -7
  8. package/dist/{aggregate-fns-C0BymEqa.mjs → aggregate-fns-CyaZyb9I.mjs} +35 -8
  9. package/dist/aggregate-rules-D_bsCpUI.cjs +26 -0
  10. package/dist/aggregate-rules-jdPrxqWa.mjs +15 -0
  11. package/dist/{buckets-DYopfd2Y.d.mts → buckets-CNdTOnei.d.mts} +312 -18
  12. package/dist/{buckets-CjdPipCC.d.cts → buckets-DJiYlMXc.d.cts} +312 -18
  13. package/dist/{column-diff-Dt7EDJsA.cjs → column-diff-CUU4GvYg.cjs} +681 -87
  14. package/dist/{column-diff-CO06iQvI.mjs → column-diff-Cp6ZoyRE.mjs} +678 -96
  15. package/dist/{db-error-D5uilS_A.mjs → db-error-Az85UhTX.mjs} +32 -1
  16. package/dist/{db-error-DTkkeu5b.cjs → db-error-DRQH4sLY.cjs} +55 -0
  17. package/dist/{fk-diff-BtOmL4OW.d.mts → fk-diff-BQ4krij8.d.cts} +1 -1
  18. package/dist/{fk-diff-DLqwVkKG.d.cts → fk-diff-DsaIijVX.d.mts} +1 -1
  19. package/dist/index.cjs +70 -5
  20. package/dist/index.d.cts +58 -13
  21. package/dist/index.d.mts +58 -13
  22. package/dist/index.mjs +64 -6
  23. package/dist/{nested-writer-SqtYJHF0.cjs → nested-writer-BUQvk6QT.cjs} +68 -2
  24. package/dist/{nested-writer-D35UsDBT.mjs → nested-writer-CUBoq1ZO.mjs} +57 -3
  25. package/dist/numeric-operand-B1jKH7x5.mjs +21 -0
  26. package/dist/numeric-operand-DKfiRLYp.cjs +26 -0
  27. package/dist/ops.cjs +1 -1
  28. package/dist/ops.mjs +1 -1
  29. package/dist/plugin.cjs +36 -9
  30. package/dist/plugin.mjs +36 -9
  31. package/dist/rel.cjs +2 -2
  32. package/dist/rel.d.cts +2 -2
  33. package/dist/rel.d.mts +2 -2
  34. package/dist/rel.mjs +2 -2
  35. package/dist/{relation-helpers-C2bLtE-t.d.mts → relation-helpers-Ba0v49sn.d.mts} +1 -1
  36. package/dist/{relation-helpers-DH3LvwLV.d.cts → relation-helpers-kX7jjgME.d.cts} +1 -1
  37. package/dist/{relation-loader-C0qE8xgR.mjs → relation-loader-ByY1Byrl.mjs} +1 -1
  38. package/dist/{relation-loader-BFhVuJ-B.cjs → relation-loader-D8OrdH-r.cjs} +1 -1
  39. package/dist/shared.cjs +3 -0
  40. package/dist/shared.d.cts +12 -1
  41. package/dist/shared.d.mts +12 -1
  42. package/dist/shared.mjs +2 -1
  43. package/dist/sync.cjs +2 -2
  44. package/dist/sync.d.cts +2 -2
  45. package/dist/sync.d.mts +2 -2
  46. package/dist/sync.mjs +2 -2
  47. package/dist/{validator-Clu2q_7z.mjs → validator-BTiIOTKP.mjs} +9 -3
  48. package/dist/{validator-CVS-onRg.cjs → validator-UcuJxHNT.cjs} +8 -2
  49. package/dist/{validator-CMnTI6r7.d.cts → validator-tBNvM1qc.d.cts} +23 -2
  50. package/dist/{validator-CMnTI6r7.d.mts → validator-tBNvM1qc.d.mts} +23 -2
  51. package/dist/validator.cjs +2 -2
  52. package/dist/validator.d.cts +1 -1
  53. package/dist/validator.d.mts +1 -1
  54. package/dist/validator.mjs +2 -2
  55. package/package.json +8 -8
@@ -10,6 +10,25 @@ var DbError = class extends Error {
10
10
  this.stack = void 0;
11
11
  }
12
12
  };
13
+ /** Whether `error` is a `DbError` with code `CONFLICT` (unique / primary-key violation). */
14
+ function isConflict(error) {
15
+ return error instanceof DbError && error.code === "CONFLICT";
16
+ }
17
+ /** @internal The error every handle of a closed `DbSpace` throws. */
18
+ function spaceClosedError() {
19
+ return new DbError("SPACE_CLOSED", [{
20
+ path: "",
21
+ message: "The DbSpace is closed; table and view handles can no longer be used"
22
+ }]);
23
+ }
24
+ /**
25
+ * Collapses the failures of a multi-step shutdown into one `AggregateError`
26
+ * (message lists every failure).
27
+ * @internal
28
+ */
29
+ function aggregateFailure(label, errors) {
30
+ return new AggregateError(errors, `${label}: ${errors.map((e) => e instanceof Error ? e.message : String(e)).join("; ")}`);
31
+ }
13
32
  /**
14
33
  * Thrown when a write payload nests deeper than the table's
15
34
  * declared `@db.depth.limit N`. Surfaced as HTTP 400 in moost-db.
@@ -83,5 +102,17 @@ function bucketTimeZoneUnavailable(message) {
83
102
  message
84
103
  }]);
85
104
  }
105
+ /**
106
+ * The adapter's `supportsAggregateExpressions()` is false (or its SQL dialect
107
+ * cannot cast to a double) and the query uses arithmetic in an aggregate
108
+ * `$select` (`AGG_EXPR_NOT_SUPPORTED`, `path` `$select`; moost-db: 400).
109
+ * @since 0.1.148
110
+ */
111
+ function aggregateExpressionsNotSupported() {
112
+ return new DbError("AGG_EXPR_NOT_SUPPORTED", [{
113
+ path: "$select",
114
+ message: "Aggregate expressions are not supported by this adapter"
115
+ }]);
116
+ }
86
117
  //#endregion
87
- export { bucketTimeZoneUnavailable as a, DepthLimitExceededError as i, CasMismatchError as n, DbError as r, CasExhaustedError as t };
118
+ export { aggregateExpressionsNotSupported as a, isConflict as c, DepthLimitExceededError as i, spaceClosedError as l, CasMismatchError as n, aggregateFailure as o, DbError as r, bucketTimeZoneUnavailable as s, CasExhaustedError as t };
@@ -10,6 +10,25 @@ var DbError = class extends Error {
10
10
  this.stack = void 0;
11
11
  }
12
12
  };
13
+ /** Whether `error` is a `DbError` with code `CONFLICT` (unique / primary-key violation). */
14
+ function isConflict(error) {
15
+ return error instanceof DbError && error.code === "CONFLICT";
16
+ }
17
+ /** @internal The error every handle of a closed `DbSpace` throws. */
18
+ function spaceClosedError() {
19
+ return new DbError("SPACE_CLOSED", [{
20
+ path: "",
21
+ message: "The DbSpace is closed; table and view handles can no longer be used"
22
+ }]);
23
+ }
24
+ /**
25
+ * Collapses the failures of a multi-step shutdown into one `AggregateError`
26
+ * (message lists every failure).
27
+ * @internal
28
+ */
29
+ function aggregateFailure(label, errors) {
30
+ return new AggregateError(errors, `${label}: ${errors.map((e) => e instanceof Error ? e.message : String(e)).join("; ")}`);
31
+ }
13
32
  /**
14
33
  * Thrown when a write payload nests deeper than the table's
15
34
  * declared `@db.depth.limit N`. Surfaced as HTTP 400 in moost-db.
@@ -83,6 +102,18 @@ function bucketTimeZoneUnavailable(message) {
83
102
  message
84
103
  }]);
85
104
  }
105
+ /**
106
+ * The adapter's `supportsAggregateExpressions()` is false (or its SQL dialect
107
+ * cannot cast to a double) and the query uses arithmetic in an aggregate
108
+ * `$select` (`AGG_EXPR_NOT_SUPPORTED`, `path` `$select`; moost-db: 400).
109
+ * @since 0.1.148
110
+ */
111
+ function aggregateExpressionsNotSupported() {
112
+ return new DbError("AGG_EXPR_NOT_SUPPORTED", [{
113
+ path: "$select",
114
+ message: "Aggregate expressions are not supported by this adapter"
115
+ }]);
116
+ }
86
117
  //#endregion
87
118
  Object.defineProperty(exports, "CasExhaustedError", {
88
119
  enumerable: true,
@@ -108,9 +139,33 @@ Object.defineProperty(exports, "DepthLimitExceededError", {
108
139
  return DepthLimitExceededError;
109
140
  }
110
141
  });
142
+ Object.defineProperty(exports, "aggregateExpressionsNotSupported", {
143
+ enumerable: true,
144
+ get: function() {
145
+ return aggregateExpressionsNotSupported;
146
+ }
147
+ });
148
+ Object.defineProperty(exports, "aggregateFailure", {
149
+ enumerable: true,
150
+ get: function() {
151
+ return aggregateFailure;
152
+ }
153
+ });
111
154
  Object.defineProperty(exports, "bucketTimeZoneUnavailable", {
112
155
  enumerable: true,
113
156
  get: function() {
114
157
  return bucketTimeZoneUnavailable;
115
158
  }
116
159
  });
160
+ Object.defineProperty(exports, "isConflict", {
161
+ enumerable: true,
162
+ get: function() {
163
+ return isConflict;
164
+ }
165
+ });
166
+ Object.defineProperty(exports, "spaceClosedError", {
167
+ enumerable: true,
168
+ get: function() {
169
+ return spaceClosedError;
170
+ }
171
+ });
@@ -1,4 +1,4 @@
1
- import { $ as TDbStorageType, H as TDbForeignKey, Jt as AtscriptDbView, O as TColumnDiff, V as TDbFieldMeta, ct as TDerivedColumn, ft as TExistingTableOption, nn as AtscriptQueryFieldRef, pn as AtscriptDbReadable, rn as AtscriptQueryNode, ut as TExistingColumn, z as TDbDefaultValue } from "./buckets-DYopfd2Y.mjs";
1
+ import { $t as AtscriptDbView, B as TDbDefaultValue, H as TDbFieldMeta, U as TDbForeignKey, cn as AtscriptQueryNode, ft as TDerivedColumn, gt as TExistingTableOption, k as TColumnDiff, mt as TExistingColumn, rt as TDbStorageType, sn as AtscriptQueryFieldRef, yn as AtscriptDbReadable } from "./buckets-DJiYlMXc.cjs";
2
2
 
3
3
  //#region src/schema/schema-hash.d.ts
4
4
  interface TFieldSnapshot {
@@ -1,4 +1,4 @@
1
- import { $ as TDbStorageType, H as TDbForeignKey, Jt as AtscriptDbView, O as TColumnDiff, V as TDbFieldMeta, ct as TDerivedColumn, ft as TExistingTableOption, nn as AtscriptQueryFieldRef, pn as AtscriptDbReadable, rn as AtscriptQueryNode, ut as TExistingColumn, z as TDbDefaultValue } from "./buckets-CjdPipCC.cjs";
1
+ import { $t as AtscriptDbView, B as TDbDefaultValue, H as TDbFieldMeta, U as TDbForeignKey, cn as AtscriptQueryNode, ft as TDerivedColumn, gt as TExistingTableOption, k as TColumnDiff, mt as TExistingColumn, rt as TDbStorageType, sn as AtscriptQueryFieldRef, yn as AtscriptDbReadable } from "./buckets-CNdTOnei.mjs";
2
2
 
3
3
  //#region src/schema/schema-hash.d.ts
4
4
  interface TFieldSnapshot {
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_error = require("./db-error-DTkkeu5b.cjs");
3
- const require_column_diff = require("./column-diff-Dt7EDJsA.cjs");
4
- const require_aggregate_fns = require("./aggregate-fns-CtsRbZn9.cjs");
5
- const require_nested_writer = require("./nested-writer-SqtYJHF0.cjs");
2
+ const require_db_error = require("./db-error-DRQH4sLY.cjs");
3
+ const require_column_diff = require("./column-diff-CUU4GvYg.cjs");
4
+ const require_aggregate_fns = require("./aggregate-fns-C-UJRobm.cjs");
5
+ const require_nested_writer = require("./nested-writer-BUQvk6QT.cjs");
6
6
  const require_derived_rules = require("./derived-rules-YstgIxG-.cjs");
7
7
  const require_object = require("./object-Djg28csK.cjs");
8
8
  const require_consts = require("./consts-BzRfCcH2.cjs");
9
9
  const require_ops = require("./ops.cjs");
10
- const require_validator = require("./validator-CVS-onRg.cjs");
10
+ const require_validator = require("./validator-UcuJxHNT.cjs");
11
11
  let _atscript_typescript_utils = require("@atscript/typescript/utils");
12
12
  let _uniqu_core = require("@uniqu/core");
13
13
  let node_crypto = require("node:crypto");
@@ -236,8 +236,14 @@ var DbSpace = class {
236
236
  _readables = /* @__PURE__ */ new WeakMap();
237
237
  /** All tables created in this space — used for reverse FK lookup during cascade. */
238
238
  _allTables = /* @__PURE__ */ new Set();
239
+ /** Every table / view handle the space created — flagged closed on {@link close}. */
240
+ _handles = /* @__PURE__ */ new Set();
239
241
  /** Lazily created adapter for administrative ops (drop table/view) that don't need a registered readable. */
240
242
  _adminAdapter;
243
+ /** Every adapter this space created (tables, views, admin) — disposed on close. */
244
+ _adapters = /* @__PURE__ */ new Set();
245
+ _onClose;
246
+ _closing;
241
247
  logger;
242
248
  /** Encryption service for `@db.encrypted` fields — validated eagerly at construction. */
243
249
  _encryption;
@@ -252,6 +258,7 @@ var DbSpace = class {
252
258
  else {
253
259
  const options = loggerOrOptions ?? {};
254
260
  this.logger = options.logger ?? require_column_diff.NoopLogger;
261
+ this._onClose = options.onClose;
255
262
  if (options.encryption) this._encryption = new DbEncryption(options.encryption);
256
263
  }
257
264
  }
@@ -260,6 +267,7 @@ var DbSpace = class {
260
267
  * appropriate instance. Uses `@db.view` or `@db.view.for` presence to distinguish.
261
268
  */
262
269
  get(type, logger) {
270
+ this._assertOpen();
263
271
  if (require_column_diff.isViewType(type)) return this.getView(type, logger);
264
272
  return this.getTable(type, logger);
265
273
  }
@@ -268,6 +276,7 @@ var DbSpace = class {
268
276
  * Creates the table + adapter on first access, caches for subsequent calls.
269
277
  */
270
278
  getTable(type, logger) {
279
+ this._assertOpen();
271
280
  let readable = this._readables.get(type);
272
281
  if (!readable) {
273
282
  assertNotAlias(type);
@@ -280,6 +289,7 @@ var DbSpace = class {
280
289
  readable.setFkLookupResolver((tableName) => this._getFkLookupTarget(tableName));
281
290
  readable.setEncryption(this._encryption);
282
291
  this._readables.set(type, readable);
292
+ this._handles.add(readable);
283
293
  }
284
294
  return readable;
285
295
  }
@@ -288,12 +298,14 @@ var DbSpace = class {
288
298
  * Creates the view + adapter on first access, caches for subsequent calls.
289
299
  */
290
300
  getView(type, logger) {
301
+ this._assertOpen();
291
302
  let readable = this._readables.get(type);
292
303
  if (!readable) {
293
304
  assertNotAlias(type);
294
305
  readable = new require_column_diff.AtscriptDbView(type, this._createAdapter(), logger || this.logger, (t) => this.get(t));
295
306
  readable.setEncryption(this._encryption);
296
307
  this._readables.set(type, readable);
308
+ this._handles.add(readable);
297
309
  }
298
310
  return readable;
299
311
  }
@@ -302,6 +314,7 @@ var DbSpace = class {
302
314
  * Creates the table/view + adapter on first access if needed.
303
315
  */
304
316
  getAdapter(type) {
317
+ this._assertOpen();
305
318
  return this.get(type).dbAdapter;
306
319
  }
307
320
  /**
@@ -309,6 +322,7 @@ var DbSpace = class {
309
322
  * See `BaseDbAdapter.dropTableByName` for an adapter that does not support it.
310
323
  */
311
324
  async dropTableByName(tableName) {
325
+ this._assertOpen();
312
326
  await this._getAdminAdapter().dropTableByName(tableName);
313
327
  }
314
328
  /**
@@ -316,6 +330,7 @@ var DbSpace = class {
316
330
  * See `BaseDbAdapter.dropViewByName` for an adapter that does not support it.
317
331
  */
318
332
  async dropViewByName(viewName) {
333
+ this._assertOpen();
319
334
  await this._getAdminAdapter().dropViewByName(viewName);
320
335
  }
321
336
  /**
@@ -324,6 +339,7 @@ var DbSpace = class {
324
339
  * @since 0.1.128
325
340
  */
326
341
  async dropTablesByName(tableNames) {
342
+ this._assertOpen();
327
343
  await this._getAdminAdapter().dropTablesByName(tableNames);
328
344
  }
329
345
  /**
@@ -333,6 +349,7 @@ var DbSpace = class {
333
349
  * @since 0.1.128
334
350
  */
335
351
  async getReferencingForeignKeys(tableName) {
352
+ this._assertOpen();
336
353
  return this._getAdminAdapter().getReferencingForeignKeys?.(tableName);
337
354
  }
338
355
  /**
@@ -351,8 +368,46 @@ var DbSpace = class {
351
368
  _createAdapter() {
352
369
  const adapter = this.adapterFactory();
353
370
  adapter.registerSpace?.(this);
371
+ this._adapters.add(adapter);
354
372
  return adapter;
355
373
  }
374
+ /** `true` once {@link close} was called. @since 0.1.148 */
375
+ get closed() {
376
+ return this._closing !== void 0;
377
+ }
378
+ /** Throws `SPACE_CLOSED` once the space is closed. */
379
+ _assertOpen() {
380
+ if (this._closing) throw require_db_error.spaceClosedError();
381
+ }
382
+ /**
383
+ * Closes the space: marks it closed, disposes every adapter it created, then
384
+ * runs the `onClose` hook (the `createAdapter` helpers close their driver
385
+ * there). Idempotent — every call returns the first call's promise. Every
386
+ * step is attempted; failures are collected into an `AggregateError`.
387
+ *
388
+ * It does not cancel or drain in-flight queries: call it after the server
389
+ * stopped accepting requests. After close, `get*` and operations on existing
390
+ * table/view handles throw `DbError("SPACE_CLOSED")`.
391
+ * @since 0.1.148
392
+ */
393
+ close() {
394
+ return this._closing ??= this._doClose();
395
+ }
396
+ async _doClose() {
397
+ for (const readable of this._handles) readable._spaceClosed = true;
398
+ const errors = [];
399
+ for (const adapter of this._adapters) try {
400
+ await adapter.dispose?.();
401
+ } catch (error) {
402
+ errors.push(error);
403
+ }
404
+ try {
405
+ await this._onClose?.();
406
+ } catch (error) {
407
+ errors.push(error);
408
+ }
409
+ if (errors.length > 0) throw require_db_error.aggregateFailure("DbSpace close failed", errors);
410
+ }
356
411
  /**
357
412
  * Finds all child tables with FKs pointing to the given parent table name.
358
413
  * Accesses `table.foreignKeys` which triggers `_flatten()` if needed.
@@ -376,6 +431,9 @@ var DbSpace = class {
376
431
  for (const table of this._allTables) if (table.tableName === tableName) return { count: (filter) => table.count({ filter }) };
377
432
  }
378
433
  };
434
+ if (typeof Symbol.asyncDispose === "symbol") DbSpace.prototype[Symbol.asyncDispose] = function() {
435
+ return this.close();
436
+ };
379
437
  //#endregion
380
438
  //#region src/table/db-entity.ts
381
439
  /**
@@ -438,6 +496,8 @@ exports.ResolvedRelationFilter = require_nested_writer.ResolvedRelationFilter;
438
496
  exports.TableMetadata = require_column_diff.TableMetadata;
439
497
  exports.UniquSelect = require_column_diff.UniquSelect;
440
498
  exports.acceptedOperatorsHint = require_column_diff.acceptedOperatorsHint;
499
+ exports.aggregateExpressionsNotSupported = require_db_error.aggregateExpressionsNotSupported;
500
+ exports.aggregateFailure = require_db_error.aggregateFailure;
441
501
  exports.aliasTargetOf = require_column_diff.aliasTargetOf;
442
502
  exports.andFilters = require_nested_writer.andFilters;
443
503
  exports.assertGeoPoint = require_column_diff.assertGeoPoint;
@@ -461,6 +521,7 @@ exports.createDbValidatorPlugin = require_validator.createDbValidatorPlugin;
461
521
  exports.createFailureCollector = require_column_diff.createFailureCollector;
462
522
  exports.decomposePatch = require_column_diff.decomposePatch;
463
523
  exports.deletePath = require_object.deletePath;
524
+ exports.evaluateExpr = require_nested_writer.evaluateExpr;
464
525
  exports.findAncestorInSet = require_object.findAncestorInSet;
465
526
  exports.fkColumns = require_column_diff.fkColumns;
466
527
  exports.forEachResolvedRelation = require_nested_writer.forEachResolvedRelation;
@@ -469,6 +530,7 @@ exports.geoIndexNotFoundMessage = require_column_diff.geoIndexNotFoundMessage;
469
530
  exports.getDbFieldOp = require_ops.getDbFieldOp;
470
531
  exports.getKeyProps = require_validator.getKeyProps;
471
532
  exports.getPath = require_object.getPath;
533
+ exports.groupSourceVerdict = require_column_diff.groupSourceVerdict;
472
534
  exports.guardAggregate = require_column_diff.guardAggregate;
473
535
  exports.guardFilter = require_column_diff.guardFilter;
474
536
  exports.guardPath = require_column_diff.guardPath;
@@ -478,6 +540,7 @@ exports.hasRelationOp = require_nested_writer.hasRelationOp;
478
540
  exports.isAtscriptDbView = require_column_diff.isAtscriptDbView;
479
541
  exports.isBucketableField = require_column_diff.isBucketableField;
480
542
  exports.isColumnTypeChanged = require_column_diff.isColumnTypeChanged;
543
+ exports.isConflict = require_db_error.isConflict;
481
544
  exports.isDbEntityType = isDbEntityType;
482
545
  exports.isDbFieldOp = require_ops.isDbFieldOp;
483
546
  exports.isEmptyObject = require_object.isEmptyObject;
@@ -504,6 +567,7 @@ exports.isViewType = require_column_diff.isViewType;
504
567
  exports.jsonValueAncestor = require_column_diff.jsonValueAncestor;
505
568
  exports.narrowerFilterOps = require_column_diff.narrowerFilterOps;
506
569
  exports.normalizeComputedSelect = require_column_diff.normalizeComputedSelect;
570
+ exports.numericOperandProblem = require_column_diff.numericOperandProblem;
507
571
  exports.reconcileCas = require_ops.reconcileCas;
508
572
  exports.relationStaticFilter = require_nested_writer.relationStaticFilter;
509
573
  exports.resolveCalendarBuckets = require_column_diff.resolveCalendarBuckets;
@@ -515,6 +579,7 @@ exports.separateFieldOps = require_ops.separateFieldOps;
515
579
  exports.sortFieldNames = require_column_diff.sortFieldNames;
516
580
  exports.tableNameOf = require_nested_writer.tableNameOf;
517
581
  exports.translateQueryTree = require_nested_writer.translateQueryTree;
582
+ exports.uniqueKeyTuple = require_nested_writer.uniqueKeyTuple;
518
583
  exports.unsupportedOperatorMessage = require_column_diff.unsupportedOperatorMessage;
519
584
  exports.vectorIndexNotFoundMessage = require_column_diff.vectorIndexNotFoundMessage;
520
585
  Object.defineProperty(exports, "walkFilter", {
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { $ as TDbStorageType, $t as AtscriptExprNode, A as TCrudPermissions, An as TDbEncryptionOptions, At as TValueFormatterPair, B as TDbDeleteResult, Bt as isGeoPointType, C as NullableOptional, Cn as andFilters, Ct as TRelationInfo, D as TCascadeTarget, Dn as isResolvedRelationFilter, Dt as TTableOptionDiff, E as TCascadeResolver, En as hasRelationOp, Et as TSyncColumnResult, F as TDbActionTargetSummary, Fn as TGenericLogger, Ft as Uniquery, G as TDbIndexType, Gt as DbSpace, H as TDbForeignKey, Ht as ALL_VIEW_CAPABILITIES, I as TDbAvailableActions, In as UniquSelect, It as UniqueryControls, J as TDbObjectKind, Jt as AtscriptDbView, K as TDbInsertManyResult, Kt as TAdapterFactory, L as TDbCollation, Lt as WithRelation, M as TDbActionIntent, Mn as FieldMappingStrategy, Mt as TWriteOptions, N as TDbActionLevel, Nn as TReadControls, Nt as TWriteTableResolver, O as TColumnDiff, On as relationStaticFilter, Ot as TTableResolver, P as TDbActionProcessor, Pn as NoopLogger, Pt as TypedWithRelation, Q as TDbRemoveGuardContext, Qt as aliasTargetOf, R as TDbDefaultFn, Rt as TableMetadata, S as NavPropsOf, Sn as TRelationStaticFilter, St as TReferencingForeignKey, T as PrimaryKeyOf, Tn as forEachResolvedRelation, Tt as TSearchIndexInfo, U as TDbIndex, Ut as BaseDbAdapter, V as TDbFieldMeta, Vt as ALL_BUCKET_UNITS, W as TDbIndexField, Wt as TViewCapability, X as TDbRelation, Xt as isAtscriptDbView, Y as TDbReferentialAction, Yt as TViewColumnMapping, Z as TDbRemoveGuard, Zt as isViewType, _ as DbQuery, _n as REL_FILTER_MAX_NODES, _t as TIdResolveOptions, a as jsonValueAncestor, an as TViewJoin, at as TDbWriteGuardContext, b as FilterExpr, bn as TRelationFilterJunction, bt as TMetadataOverrides, c as AggregateControls, cn as translateQueryTree, ct as TDerivedColumn, d as AggregateQuery, dn as NativeIntegrity, dt as TExistingForeignKey, en as AtscriptOrderItem, et as TDbUpdateResult, f as AggregateResult, fn as TCascadePin, ft as TExistingTableOption, g as DbPatch, gn as REL_FILTER_MAX_DEPTH, gt as TIdDescriptor, h as DbControls, hn as resolveDesignType, ht as TFkLookupTarget, i as isJsonValueField, in as AtscriptRef, it as TDbWriteGuard, j as TDbActionInfo, jn as DocumentFieldMapper, jt as TViewJsonType, k as TCrudOp, kn as DbEncryption, kt as TTouchManyOptions, l as AggregateExpr, ln as AtscriptDbTable, lt as TEnsureTableOptions, m as AtscriptDbWritable, mn as DbResponse, mt as TFkLookupResolver, n as TResolvedBucket, nn as AtscriptQueryFieldRef, nt as TDbWriteCheck, o as normalizeComputedSelect, on as TViewPlan, ot as TDeleteOptions, pn as AtscriptDbReadable, pt as TFieldMeta, q as TDbInsertResult, qt as TDbSpaceOptions, r as isBucketableField, rn as AtscriptQueryNode, rt as TDbWriteCheckContext, s as resolveCalendarBuckets, sn as isFieldRef, st as TDerivedChangeReason, t as TBucketFieldSource, tn as AtscriptQueryComparison, tt as TDbWriteAction, u as AggregateFn, un as IntegrityStrategy, ut as TExistingColumn, v as DbRow, vn as ResolvedRelationFilter, vt as TIdentification, w as OwnPropsOf, wn as containsRelationFilter, wt as TRowResolveOptions, x as FlatOf, xn as TRelationFilterTable, xt as TPrimaryKeyChange, y as FieldOpsFor, yn as TRelGuardState, yt as TMetaResponse, z as TDbDefaultValue, zt as isGeoIndexableType } from "./buckets-CjdPipCC.cjs";
1
+ import { $ as TDbReferentialAction, $t as AtscriptDbView, A as TCrudOp, An as containsRelationFilter, At as TSearchIndexInfo, B as TDbDefaultValue, Bn as NoopLogger, Bt as Uniquery, C as NavPropsOf, Cn as REL_FILTER_MAX_NODES, Ct as TInsertOptions, D as TCascadeResolver, Dn as TRelationFilterTable, Dt as TReferencingForeignKey, E as PrimaryKeyOf, En as TRelationFilterJunction, Et as TPrimaryKeyChange, F as TDbActionProcessor, Fn as DbEncryption, Ft as TValueFormatterPair, G as TDbIndexField, Gn as UniquSelect, Gt as isGeoPointType, H as TDbFieldMeta, Hn as TExprAggregate, Ht as WithRelation, I as TDbActionTargetSummary, In as TDbEncryptionOptions, It as TViewJsonType, J as TDbInsertIgnoreSlot, Jt as BaseDbAdapter, K as TDbIndexType, Kt as ALL_BUCKET_UNITS, L as TDbAvailableActions, Ln as DocumentFieldMapper, Lt as TWriteOptions, M as TDbActionInfo, Mn as hasRelationOp, Mt as TTableOptionDiff, N as TDbActionIntent, Nn as isResolvedRelationFilter, Nt as TTableResolver, O as TCascadeTarget, On as TRelationStaticFilter, Ot as TRelationInfo, P as TDbActionLevel, Pn as relationStaticFilter, Pt as TTouchManyOptions, Q as TDbObjectKind, Qt as TDbSpaceOptions, R as TDbCollation, Rn as FieldMappingStrategy, Rt as TWriteTableResolver, S as FlatOf, Sn as REL_FILTER_MAX_DEPTH, St as TIdentification, T as OwnPropsOf, Tn as TRelGuardState, Tt as TMetadataOverrides, U as TDbForeignKey, Un as TFirstLast, Ut as TableMetadata, V as TDbDeleteResult, Vn as TGenericLogger, Vt as UniqueryControls, W as TDbIndex, Wn as TRowOrderKey, Wt as isGeoIndexableType, X as TDbInsertManyResult, Xt as DbSpace, Y as TDbInsertManyIgnoreResult, Yt as TViewCapability, Z as TDbInsertResult, Zt as TAdapterFactory, _ as DbPatch, _n as NativeIntegrity, _t as TFieldMeta, a as isJsonValueField, an as AtscriptOrderItem, at as TDbWriteAction, b as FieldOpsFor, bn as DbResponse, bt as TIdDescriptor, c as resolveCalendarBuckets, cn as AtscriptQueryNode, ct as TDbWriteGuard, d as AggregateFn, dn as TViewPlan, dt as TDerivedChangeReason, en as TViewColumnMapping, et as TDbRelation, f as AggregateQuery, fn as evaluateExpr, ft as TDerivedColumn, g as DbControls, gn as IntegrityStrategy, gt as TExistingTableOption, h as AtscriptDbWritable, hn as AtscriptDbTable, ht as TExistingForeignKey, i as isBucketableField, in as AtscriptExprNode, it as TDbUpdateResult, j as TCrudPermissions, jn as forEachResolvedRelation, jt as TSyncColumnResult, k as TColumnDiff, kn as andFilters, kt as TRowResolveOptions, l as AggregateControls, ln as AtscriptRef, lt as TDbWriteGuardContext, mn as translateQueryTree, mt as TExistingColumn, n as TComputedSelect, nn as isViewType, nt as TDbRemoveGuardContext, o as jsonValueAncestor, on as AtscriptQueryComparison, ot as TDbWriteCheck, p as AggregateResult, pn as isFieldRef, pt as TEnsureTableOptions, q as TDbInsertIgnoreResult, qt as ALL_VIEW_CAPABILITIES, r as TResolvedBucket, rn as aliasTargetOf, rt as TDbStorageType, s as normalizeComputedSelect, sn as AtscriptQueryFieldRef, st as TDbWriteCheckContext, t as TBucketFieldSource, tn as isAtscriptDbView, tt as TDbRemoveGuard, u as AggregateExpr, un as TViewJoin, ut as TDeleteOptions, v as DbQuery, vn as TCascadePin, vt as TFkLookupResolver, w as NullableOptional, wn as ResolvedRelationFilter, wt as TMetaResponse, x as FilterExpr, xn as resolveDesignType, xt as TIdResolveOptions, y as DbRow, yn as AtscriptDbReadable, yt as TFkLookupTarget, z as TDbDefaultFn, zn as TReadControls, zt as TypedWithRelation } from "./buckets-DJiYlMXc.cjs";
2
2
  import { _ as separateFieldOps, a as $mul, c as $update, d as TDbFieldOp, f as TFieldOps, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, p as getDbFieldOp, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.cjs";
3
3
  import { a as isPlainObject, i as isEmptyObject, n as findAncestorInSet, o as selfOrAncestor, r as getPath, t as deletePath } from "./object-CtPYTIvy.cjs";
4
- import { c as CalendarBucketLabel, d as WeekStart, g as ALL_AGGREGATE_FNS, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-CV7y8nC6.cjs";
5
- import { a as buildValidationContext, c as isNavRelation, d as getKeyProps, f as CasExhaustedError, g as bucketTimeZoneUnavailable, h as DbErrorCode, l as TArrayPatch, m as DbError, n as ValidatorMode, p as CasMismatchError, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as TDbPatch } from "./validator-CMnTI6r7.cjs";
4
+ import { c as CalendarBucketLabel, d as WeekStart, g as ALL_AGGREGATE_FNS, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-42CSpGDR.cjs";
5
+ import { _ as aggregateFailure, a as buildValidationContext, c as isNavRelation, d as getKeyProps, f as CasExhaustedError, g as aggregateExpressionsNotSupported, h as DbErrorCode, l as TArrayPatch, m as DbError, n as ValidatorMode, p as CasMismatchError, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as TDbPatch, v as bucketTimeZoneUnavailable, y as isConflict } from "./validator-tBNvM1qc.cjs";
6
6
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
7
- import { r as fkColumns, s as isColumnTypeChanged } from "./fk-diff-DLqwVkKG.cjs";
8
- import { i as tableNameOf } from "./relation-helpers-DH3LvwLV.cjs";
9
- import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, RELATION_OPS, RelationOp, RelationOp as RelationOp$1, ResolvedBucket as ResolvedBucket$1, Uniquery as Uniquery$1, computeInsights, isPrimitive, isRelationOp, walkFilter } from "@uniqu/core";
10
- import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
7
+ import { r as fkColumns, s as isColumnTypeChanged } from "./fk-diff-BQ4krij8.cjs";
8
+ import { i as tableNameOf } from "./relation-helpers-kX7jjgME.cjs";
9
+ import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, RELATION_OPS, RelationOp, RelationOp as RelationOp$1, ResolvedRowOrderKey, ResolvedSelectExpr, Uniquery as Uniquery$1, computeInsights, isPrimitive, isRelationOp, walkFilter } from "@uniqu/core";
10
+ import { AtscriptExprNode as AtscriptExprNode$1, TAtscriptAnnotatedType } from "@atscript/typescript/utils";
11
11
 
12
12
  //#region src/shared/consts.d.ts
13
13
  /**
@@ -149,6 +149,7 @@ interface TGuardedQuery {
149
149
  $select?: unknown;
150
150
  $groupBy?: unknown;
151
151
  $having?: unknown;
152
+ $rowOrder?: unknown;
152
153
  };
153
154
  }
154
155
  /**
@@ -244,6 +245,28 @@ type TBucketSourceVerdict = {
244
245
  code: "encrypted" | "jsonDescendant" | "notTimestamp" | "notFilterable" | "notDimension" | "noBuckets";
245
246
  reason: string;
246
247
  };
248
+ /** {@link groupSourceVerdict}'s answer — the `reason` clause has no trailing period. */
249
+ type TGroupSourceVerdict = {
250
+ ok: true;
251
+ } | {
252
+ ok: false;
253
+ code: "encrypted" | "notFilterable" | "notDimension";
254
+ reason: string;
255
+ };
256
+ /**
257
+ * Whether the stored leaf `fd` may be a `$groupBy` key (since 0.1.148) — the
258
+ * one rule for the core's strict-table check and moost-db's capability index
259
+ * (`/meta.fields[P].groupable` and the HTTP gate). First failing rule wins:
260
+ *
261
+ * 1. `encrypted` — `@db.encrypted`;
262
+ * 2. `notFilterable` — the adapter cannot filter (so cannot group) the storage;
263
+ * 3. `notDimension` — a strict table ({@link isStrictTable}) and the field is
264
+ * not a dimension.
265
+ *
266
+ * A calendar-bucket alias is not a field: it groups by its source, whose
267
+ * dimension rule is {@link bucketSourceVerdict}'s (callers skip aliases).
268
+ */
269
+ declare function groupSourceVerdict(fd: TDbFieldMeta, table: Pick<TBucketSourceTable, "dimensions" | "measures">, adapter: Pick<BaseDbAdapter, "canFilterField">): TGroupSourceVerdict;
247
270
  /**
248
271
  * Whether the stored leaf `fd` may be the source of a calendar bucket
249
272
  * (since 0.1.133) — every schema and adapter rule, once, for the core path
@@ -302,8 +325,9 @@ interface TQueryPathRefs {
302
325
  *
303
326
  * Aggregate mode is `aggregate` when given, else the presence of `$groupBy`.
304
327
  * In aggregate mode `$select` computed entries are collected by kind — an
305
- * aggregate's `$field` into `aggregate`, a calendar bucket's into `bucket` —
306
- * and their aliases (`$as`, else uniqu's `resolveAlias`) are exempted from
328
+ * aggregate's `$field` (a row-level expression's names, a `first` / `last`
329
+ * field) into `aggregate`, a calendar bucket's into `bucket`, a `$rowOrder`
330
+ * key into `sort` — and their aliases (`$as`, else uniqu's `resolveAlias`) are exempted from
307
331
  * `$sort` / `$having`; a bucket alias is also dropped from `groupBy`, which
308
332
  * lists grouped fields only.
309
333
  *
@@ -414,10 +438,11 @@ declare function checkHavingKeys(refs: TQueryPathRefs): {
414
438
  * ({@link checkHavingKeys} — after the path guard so an unknown key still
415
439
  * reads `Unknown field`), then the `$having` values (`guardHavingValues`).
416
440
  *
417
- * `buckets` are the query's resolved calendar buckets when the caller already
418
- * ran `normalizeComputedSelect` (resolved here otherwise).
441
+ * `resolved` is the query's normalized computed `$select`
442
+ * (`resolveComputedSelect`) when the caller already ran it (resolved here
443
+ * otherwise).
419
444
  */
420
- declare function guardAggregate(meta: TableMetadata, adapter: BaseDbAdapter, query: AggregateQuery$1, resolved?: readonly ResolvedBucket$1[]): void;
445
+ declare function guardAggregate(meta: TableMetadata, adapter: BaseDbAdapter, query: AggregateQuery$1, resolved?: TComputedSelect): void;
421
446
  //#endregion
422
447
  //#region src/with-optimistic-retry.d.ts
423
448
  interface WithOptimisticRetryOptions {
@@ -458,6 +483,14 @@ interface WithOptimisticRetryOptions {
458
483
  */
459
484
  declare function withOptimisticRetry<TRow extends Record<string, unknown>>(table: AtscriptDbTable, filter: Record<string, unknown>, mutator: (row: TRow) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined, opts?: WithOptimisticRetryOptions): Promise<TDbUpdateResult>;
460
485
  //#endregion
486
+ //#region src/shared/keys.d.ts
487
+ /**
488
+ * Identity of the key tuple `fields` of `row` for uniqueness checks, or
489
+ * `undefined` when any component is null / missing (a NULL never collides).
490
+ * Equal across driver representations (see {@link keyString}).
491
+ */
492
+ declare function uniqueKeyTuple(row: Record<string, unknown>, fields: readonly string[]): string | undefined;
493
+ //#endregion
461
494
  //#region src/shared/index-messages.d.ts
462
495
  /**
463
496
  * Wording of the "index not found" errors — one source for the core, every
@@ -556,4 +589,16 @@ declare function createFailureCollector(what: string): {
556
589
  throwIfAny: () => void;
557
590
  };
558
591
  //#endregion
559
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, ALL_VIEW_CAPABILITIES, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptExprNode, type AtscriptOrderItem, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RELATION_OPS, REL_FILTER_MAX_DEPTH, REL_FILTER_MAX_NODES, type RelationOp, RelationalFieldMapper, type ResolvedBucket, ResolvedRelationFilter, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbActionTargetSummary, type TDbAvailableActions, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteCheck, type TDbWriteCheckContext, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationFilterJunction, type TRelationFilterTable, type TRelationInfo, type TRelationStaticFilter, type TResolvedBucket, type TRowResolveOptions, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewCapability, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aliasTargetOf, andFilters, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, containsRelationFilter, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, fkColumns, forEachResolvedRelation, forceNavNonOptional, geoIndexNotFoundMessage, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, hasRelationOp, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, isRelationOp, isResolvedRelationFilter, isViewType, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, relationStaticFilter, resolveCalendarBuckets, resolveDesignType, searchIndexNotFoundMessage, selfOrAncestor, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, vectorIndexNotFoundMessage, walkFilter, withOptimisticRetry };
592
+ //#region src/query/aggregate-expr.d.ts
593
+ /**
594
+ * Why a field cannot be an arithmetic operand, or `undefined` when it can: it
595
+ * must be a `number` (not a decimal — those are exact, an expression is IEEE
596
+ * double — and not a timestamp-tagged number) with plain column storage. The
597
+ * runtime twin of `@db.compute`'s operand rule, so declared and query-time
598
+ * arithmetic accept the same fields.
599
+ *
600
+ * @since 0.1.148
601
+ */
602
+ declare function numericOperandProblem(fd: TDbFieldMeta): string | undefined;
603
+ //#endregion
604
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, ALL_VIEW_CAPABILITIES, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptExprNode, type AtscriptOrderItem, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RELATION_OPS, REL_FILTER_MAX_DEPTH, REL_FILTER_MAX_NODES, type RelationOp, RelationalFieldMapper, type ResolvedBucket, ResolvedRelationFilter, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbActionTargetSummary, type TDbAvailableActions, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertIgnoreResult, type TDbInsertIgnoreSlot, type TDbInsertManyIgnoreResult, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteCheck, type TDbWriteCheckContext, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TExprAggregate, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFirstLast, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGroupSourceVerdict, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TInsertOptions, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationFilterJunction, type TRelationFilterTable, type TRelationInfo, type TRelationStaticFilter, type TResolvedBucket, type TRowOrderKey, type TRowResolveOptions, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewCapability, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aggregateExpressionsNotSupported, aggregateFailure, aliasTargetOf, andFilters, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, containsRelationFilter, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, evaluateExpr, findAncestorInSet, fkColumns, forEachResolvedRelation, forceNavNonOptional, geoIndexNotFoundMessage, getDbFieldOp, getKeyProps, getPath, groupSourceVerdict, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, hasRelationOp, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isConflict, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, isRelationOp, isResolvedRelationFilter, isViewType, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, numericOperandProblem, reconcileCas, relationStaticFilter, resolveCalendarBuckets, resolveDesignType, searchIndexNotFoundMessage, selfOrAncestor, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, uniqueKeyTuple, unsupportedOperatorMessage, vectorIndexNotFoundMessage, walkFilter, withOptimisticRetry };