effect-dynamodb 1.39.0 → 1.41.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 (190) hide show
  1. package/README.md +1 -1
  2. package/dist/Aggregate.d.ts +138 -16
  3. package/dist/Aggregate.d.ts.map +1 -1
  4. package/dist/Aggregate.js +4298 -725
  5. package/dist/Aggregate.js.map +1 -1
  6. package/dist/Batch.d.ts +9 -5
  7. package/dist/Batch.d.ts.map +1 -1
  8. package/dist/Batch.js +28 -44
  9. package/dist/Batch.js.map +1 -1
  10. package/dist/Collection.d.ts.map +1 -1
  11. package/dist/Collection.js +16 -9
  12. package/dist/Collection.js.map +1 -1
  13. package/dist/ConsumedCapacity.js +1 -1
  14. package/dist/ConsumedCapacity.js.map +1 -1
  15. package/dist/DynamoClient.d.ts +44 -21
  16. package/dist/DynamoClient.d.ts.map +1 -1
  17. package/dist/DynamoClient.js +342 -124
  18. package/dist/DynamoClient.js.map +1 -1
  19. package/dist/Entity.d.ts +246 -41
  20. package/dist/Entity.d.ts.map +1 -1
  21. package/dist/Entity.js +6818 -1166
  22. package/dist/Entity.js.map +1 -1
  23. package/dist/EventStore.d.ts +37 -15
  24. package/dist/EventStore.d.ts.map +1 -1
  25. package/dist/EventStore.js +403 -163
  26. package/dist/EventStore.js.map +1 -1
  27. package/dist/Expression.d.ts.map +1 -1
  28. package/dist/Expression.js +40 -24
  29. package/dist/Expression.js.map +1 -1
  30. package/dist/Marshaller.d.ts +72 -11
  31. package/dist/Marshaller.d.ts.map +1 -1
  32. package/dist/Marshaller.js +625 -71
  33. package/dist/Marshaller.js.map +1 -1
  34. package/dist/Query.d.ts +103 -5
  35. package/dist/Query.d.ts.map +1 -1
  36. package/dist/Query.js +262 -15
  37. package/dist/Query.js.map +1 -1
  38. package/dist/StorageEncoding.d.ts +7 -1
  39. package/dist/StorageEncoding.d.ts.map +1 -1
  40. package/dist/StorageEncoding.js +8 -2
  41. package/dist/StorageEncoding.js.map +1 -1
  42. package/dist/Table.d.ts +338 -16
  43. package/dist/Table.d.ts.map +1 -1
  44. package/dist/Table.js +30 -2
  45. package/dist/Table.js.map +1 -1
  46. package/dist/Transaction.d.ts.map +1 -1
  47. package/dist/Transaction.js +70 -7
  48. package/dist/Transaction.js.map +1 -1
  49. package/dist/VectorSearchEmulation.d.ts.map +1 -1
  50. package/dist/VectorSearchEmulation.js +4 -3
  51. package/dist/VectorSearchEmulation.js.map +1 -1
  52. package/dist/change-feed/ChangeFeed.d.ts +8 -3
  53. package/dist/change-feed/ChangeFeed.d.ts.map +1 -1
  54. package/dist/change-feed/ChangeFeed.js +76 -9
  55. package/dist/change-feed/ChangeFeed.js.map +1 -1
  56. package/dist/change-feed/CheckpointStore.js +1 -1
  57. package/dist/change-feed/CheckpointStore.js.map +1 -1
  58. package/dist/change-feed/DynamoStreamsClient.d.ts +19 -10
  59. package/dist/change-feed/DynamoStreamsClient.d.ts.map +1 -1
  60. package/dist/change-feed/DynamoStreamsClient.js +24 -14
  61. package/dist/change-feed/DynamoStreamsClient.js.map +1 -1
  62. package/dist/index.d.ts +2 -2
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +1 -1
  65. package/dist/index.js.map +1 -1
  66. package/dist/internal/BoundCrud.d.ts +78 -32
  67. package/dist/internal/BoundCrud.d.ts.map +1 -1
  68. package/dist/internal/BoundCrud.js +25 -0
  69. package/dist/internal/BoundCrud.js.map +1 -1
  70. package/dist/internal/BoundQuery.d.ts +46 -3
  71. package/dist/internal/BoundQuery.d.ts.map +1 -1
  72. package/dist/internal/BoundQuery.js +402 -37
  73. package/dist/internal/BoundQuery.js.map +1 -1
  74. package/dist/internal/BoundVectorQuery.d.ts +6 -0
  75. package/dist/internal/BoundVectorQuery.d.ts.map +1 -1
  76. package/dist/internal/BoundVectorQuery.js +7 -4
  77. package/dist/internal/BoundVectorQuery.js.map +1 -1
  78. package/dist/internal/Capacity.d.ts +46 -5
  79. package/dist/internal/Capacity.d.ts.map +1 -1
  80. package/dist/internal/Capacity.js +177 -26
  81. package/dist/internal/Capacity.js.map +1 -1
  82. package/dist/internal/ClientOptions.d.ts +144 -0
  83. package/dist/internal/ClientOptions.d.ts.map +1 -0
  84. package/dist/internal/ClientOptions.js +290 -0
  85. package/dist/internal/ClientOptions.js.map +1 -0
  86. package/dist/internal/ConditionHolds.d.ts +29 -0
  87. package/dist/internal/ConditionHolds.d.ts.map +1 -0
  88. package/dist/internal/ConditionHolds.js +453 -0
  89. package/dist/internal/ConditionHolds.js.map +1 -0
  90. package/dist/internal/Cursor.d.ts +19 -10
  91. package/dist/internal/Cursor.d.ts.map +1 -1
  92. package/dist/internal/Cursor.js +25 -10
  93. package/dist/internal/Cursor.js.map +1 -1
  94. package/dist/internal/Digest.d.ts +20 -0
  95. package/dist/internal/Digest.d.ts.map +1 -0
  96. package/dist/internal/Digest.js +106 -0
  97. package/dist/internal/Digest.js.map +1 -0
  98. package/dist/internal/DynamoArithmetic.d.ts +33 -0
  99. package/dist/internal/DynamoArithmetic.d.ts.map +1 -0
  100. package/dist/internal/DynamoArithmetic.js +112 -0
  101. package/dist/internal/DynamoArithmetic.js.map +1 -0
  102. package/dist/internal/EntityCombinators.d.ts +23 -8
  103. package/dist/internal/EntityCombinators.d.ts.map +1 -1
  104. package/dist/internal/EntityCombinators.js +6 -2
  105. package/dist/internal/EntityCombinators.js.map +1 -1
  106. package/dist/internal/EntityOps.d.ts +69 -8
  107. package/dist/internal/EntityOps.d.ts.map +1 -1
  108. package/dist/internal/EntityOps.js.map +1 -1
  109. package/dist/internal/EventProjection.d.ts +18 -4
  110. package/dist/internal/EventProjection.d.ts.map +1 -1
  111. package/dist/internal/EventProjection.js +36 -8
  112. package/dist/internal/EventProjection.js.map +1 -1
  113. package/dist/internal/Expr.d.ts +72 -2
  114. package/dist/internal/Expr.d.ts.map +1 -1
  115. package/dist/internal/Expr.js +264 -5
  116. package/dist/internal/Expr.js.map +1 -1
  117. package/dist/internal/ExpressionLimits.d.ts +57 -1
  118. package/dist/internal/ExpressionLimits.d.ts.map +1 -1
  119. package/dist/internal/ExpressionLimits.js +97 -4
  120. package/dist/internal/ExpressionLimits.js.map +1 -1
  121. package/dist/internal/FormGuard.d.ts +52 -0
  122. package/dist/internal/FormGuard.d.ts.map +1 -0
  123. package/dist/internal/FormGuard.js +83 -0
  124. package/dist/internal/FormGuard.js.map +1 -0
  125. package/dist/internal/Hydrate.d.ts.map +1 -1
  126. package/dist/internal/Hydrate.js +2 -1
  127. package/dist/internal/Hydrate.js.map +1 -1
  128. package/dist/internal/InputForm.d.ts +24 -0
  129. package/dist/internal/InputForm.d.ts.map +1 -0
  130. package/dist/internal/InputForm.js +44 -0
  131. package/dist/internal/InputForm.js.map +1 -0
  132. package/dist/internal/InsertStatement.d.ts +15 -0
  133. package/dist/internal/InsertStatement.d.ts.map +1 -0
  134. package/dist/internal/InsertStatement.js +18 -0
  135. package/dist/internal/InsertStatement.js.map +1 -0
  136. package/dist/internal/ItemSize.d.ts +108 -4
  137. package/dist/internal/ItemSize.d.ts.map +1 -1
  138. package/dist/internal/ItemSize.js +190 -3
  139. package/dist/internal/ItemSize.js.map +1 -1
  140. package/dist/internal/MultiProjection.d.ts +7 -2
  141. package/dist/internal/MultiProjection.d.ts.map +1 -1
  142. package/dist/internal/MultiProjection.js +18 -12
  143. package/dist/internal/MultiProjection.js.map +1 -1
  144. package/dist/internal/OperandReaders.d.ts +36 -0
  145. package/dist/internal/OperandReaders.d.ts.map +1 -0
  146. package/dist/internal/OperandReaders.js +176 -0
  147. package/dist/internal/OperandReaders.js.map +1 -0
  148. package/dist/internal/Packed.d.ts.map +1 -1
  149. package/dist/internal/Packed.js +11 -10
  150. package/dist/internal/Packed.js.map +1 -1
  151. package/dist/internal/PathBuilder.d.ts +57 -8
  152. package/dist/internal/PathBuilder.d.ts.map +1 -1
  153. package/dist/internal/PathBuilder.js +98 -24
  154. package/dist/internal/PathBuilder.js.map +1 -1
  155. package/dist/internal/ProjectionEngine.d.ts +196 -3
  156. package/dist/internal/ProjectionEngine.d.ts.map +1 -1
  157. package/dist/internal/ProjectionEngine.js +1251 -86
  158. package/dist/internal/ProjectionEngine.js.map +1 -1
  159. package/dist/internal/Rekey.d.ts +187 -21
  160. package/dist/internal/Rekey.d.ts.map +1 -1
  161. package/dist/internal/Rekey.js +1349 -63
  162. package/dist/internal/Rekey.js.map +1 -1
  163. package/dist/internal/ReturnedItem.d.ts +23 -0
  164. package/dist/internal/ReturnedItem.d.ts.map +1 -0
  165. package/dist/internal/ReturnedItem.js +39 -0
  166. package/dist/internal/ReturnedItem.js.map +1 -0
  167. package/dist/internal/RoundTrip.d.ts +45 -0
  168. package/dist/internal/RoundTrip.d.ts.map +1 -0
  169. package/dist/internal/RoundTrip.js +106 -0
  170. package/dist/internal/RoundTrip.js.map +1 -0
  171. package/dist/internal/SentRequest.d.ts +14 -0
  172. package/dist/internal/SentRequest.d.ts.map +1 -0
  173. package/dist/internal/SentRequest.js +31 -0
  174. package/dist/internal/SentRequest.js.map +1 -0
  175. package/dist/internal/TransactPlan.d.ts.map +1 -1
  176. package/dist/internal/TransactPlan.js +4 -0
  177. package/dist/internal/TransactPlan.js.map +1 -1
  178. package/dist/internal/TransactWriteOps.d.ts +70 -15
  179. package/dist/internal/TransactWriteOps.d.ts.map +1 -1
  180. package/dist/internal/TransactWriteOps.js +166 -112
  181. package/dist/internal/TransactWriteOps.js.map +1 -1
  182. package/dist/internal/TransactableOps.d.ts +230 -27
  183. package/dist/internal/TransactableOps.d.ts.map +1 -1
  184. package/dist/internal/TransactableOps.js +549 -92
  185. package/dist/internal/TransactableOps.js.map +1 -1
  186. package/dist/internal/WriteDiagnosis.d.ts +66 -3
  187. package/dist/internal/WriteDiagnosis.d.ts.map +1 -1
  188. package/dist/internal/WriteDiagnosis.js +261 -15
  189. package/dist/internal/WriteDiagnosis.js.map +1 -1
  190. package/package.json +5 -5
package/dist/Table.d.ts CHANGED
@@ -34,6 +34,22 @@ export interface TableConfig {
34
34
  export declare const DEFAULT_TTL_ATTRIBUTE_NAME = "_ttl";
35
35
  /** Resolve the effective TTL attribute name from a TableConfig. */
36
36
  export declare const resolveTtlAttributeName: (tc: TableConfig) => string;
37
+ /**
38
+ * @internal The attributes a table's members write keys under, by its service (#237): the
39
+ * primary key's, every secondary index's (entity and aggregate) and every vector index's
40
+ * partition and filter attributes, as {@link resolveKeyAttributeTypes} lists them, and those of
41
+ * every aggregate made on the table without being registered on it and every event stream's
42
+ * index on it ({@link addTableKeyAttributes}). Any item holding one of them is indexed by it, so
43
+ * the library adds no attribute of its own under such a name. `undefined` for a service `make`
44
+ * didn't create.
45
+ */
46
+ export declare const tableKeyAttributes: (tag: unknown) => ReadonlySet<string> | undefined;
47
+ /**
48
+ * @internal Adds the attributes an aggregate made on a table, or an event stream's indexes on it,
49
+ * write keys under (#237): neither is registered on the table, and their items are on it all the
50
+ * same.
51
+ */
52
+ export declare const addTableKeyAttributes: (tag: unknown, names: Iterable<string>) => void;
37
53
  /** Minimal entity shape for Table membership (avoids circular import with Entity.ts) */
38
54
  interface EntityLike {
39
55
  readonly _tag: "Entity";
@@ -380,9 +396,50 @@ export type RekeyCounts = {
380
396
  * or it is an outbox item on another table than its read model's, of a
381
397
  * projection not defined where `rekey` runs
382
398
  * - `unrecognizedKey` — its member's, but stored neither under the key its
383
- * values compose now nor under the one 1.36 composed for them
399
+ * values compose now nor under the one 1.36 composed for them. A unique
400
+ * sentinel of a constraint the entity doesn't declare, or one not under the
401
+ * schema's own key prefix, is counted here too (a sentinel of a declared
402
+ * constraint that no row holds is in {@link RekeyReport.reservations}). When several
403
+ * members claim its `__edd_e__` (read models of one entity type whose outboxes
404
+ * share a table), it names none of them, and its row's key is no key any of
405
+ * them writes
406
+ * - `rootNotSeen` — a row of an aggregate with no root in its partition, met by
407
+ * a run that didn't read the whole table (`maxPages` or `resume`). A root at
408
+ * its old key on a page the run didn't read could still claim it, so nothing
409
+ * is said of it. A run over the whole table judges it: a dry run will do
410
+ * - `ambiguousOwner` — a projection's outbox item that more than one read model
411
+ * of its entity type sharing its table could have written, which they would
412
+ * move to different keys, and whose read-model row doesn't say whose it is:
413
+ * each one is in {@link RekeyReport.ambiguous}, with the reason
384
414
  */
385
- export type RekeySkipReason = "notLibrary" | "unregistered" | "unrecognizedKey";
415
+ export type RekeySkipReason = "notLibrary" | "unregistered" | "unrecognizedKey" | "rootNotSeen" | "ambiguousOwner";
416
+ /**
417
+ * A projection's outbox item `rekey` left where it is because it can't tell whose it is. Read
418
+ * models of one entity type whose outboxes share a table can write one key: a value holding `#`
419
+ * spells a longer key's text (`shop` = `x#branch_y` beside `shop` = `x`, `branch` = `y`). From
420
+ * 1.41.0 an item names its read model (`__edd_rm__`), and that decides. An item written before
421
+ * names none: it is the read model's whose rows' keys it can be, when only one can have written
422
+ * it, and moves as any other when every one that can would move it to one key. Otherwise the row
423
+ * it names (`__edd_row_pk__`, `__edd_row_sk__`) is read from each one's table, at that key and at
424
+ * the key that read model would move it to: the item is the read model's whose own row is there
425
+ * (its values compose that key), when exactly one finds one and none finds a tombstone. Otherwise
426
+ * it's left, and a rerun leaves it again:
427
+ *
428
+ * - `rowGone` — no read model has that row
429
+ * - `unsettled` — the row doesn't say whose the item is: a tombstone is there, which holds no
430
+ * values, or more than one read model finds a row of its own, or a read model's table isn't
431
+ * provided where `rekey` runs
432
+ */
433
+ export interface RekeyAmbiguity {
434
+ /** The entity type of the read models that can have written it. */
435
+ readonly member: string;
436
+ /** The item's primary key, as stored. */
437
+ readonly key: Readonly<Record<string, unknown>>;
438
+ /** Where each of them would move it: its key as stored for one that finds it current. */
439
+ readonly targets: ReadonlyArray<Readonly<Record<string, unknown>>>;
440
+ readonly reason: "rowGone" | "unsettled";
441
+ readonly message: string;
442
+ }
386
443
  /**
387
444
  * A row `rekey` did not move, and why. A row is moved only where nothing is
388
445
  * (or, a stream's snapshot, over an older one), and deleted only while it is
@@ -391,45 +448,209 @@ export type RekeySkipReason = "notLibrary" | "unregistered" | "unrecognizedKey";
391
448
  * - `bothKeys` — the same row (the same item, version, event, …) is also
392
449
  * under its current key — for an aggregate, any of its rows is, or which
393
450
  * of them are where can't be told; both are left as they are
394
- * - `taken` — another row holds its current key
451
+ * - `taken` — another row holds its current key — for an aggregate, a row
452
+ * that isn't one of its own holds one of its rows' current keys, and doesn't
453
+ * move out of the way in this run
395
454
  * - `contended` — concurrent writes changed it on every attempt
396
455
  * - `failed` — it could not be moved as stored (its values no longer decode,
397
456
  * a stream id reads as more than one id, or a write was refused);
398
457
  * `message` says why
399
- * - `uncomposable` — its key on a sharded index is from another layout, and its
400
- * values can't compose a current one (a `by` attribute was cleared) (#183)
458
+ * - `uncomposable` — its values can't compose a current key: a composite holds a
459
+ * value with no key text (`NaN`) or one no form of its schema takes
460
+ * (`EDD-9050`); `message` says which. Or its key on a sharded index is from
461
+ * another layout, and its values can't compose a current one (a `by`
462
+ * attribute was cleared) (#183)
463
+ * - `unguarded` — it can't be proven unchanged when it moves: guarded whole, it's
464
+ * over DynamoDB's limits on one expression, and it has no version or
465
+ * `updatedAt` to stand in (its member is neither `versioned` nor `timestamps`,
466
+ * or it's a stream's row or a projection's row tombstone or outbox item). A
467
+ * write landing between the read and the move would be lost, so it's left, in
468
+ * a dry run too (for an aggregate or a stream nothing of which has moved, every
469
+ * row of it; one already part-moved is finished under the strongest guard that
470
+ * fits, as on 1.39.0). Stop writes to the table and run with
471
+ * {@link RekeyOptions.writesStopped}
401
472
  */
402
473
  export interface RekeyConflict {
403
474
  /** The entity type, aggregate or stream name. */
404
475
  readonly member: string;
405
476
  readonly kind: RekeyRowKind;
406
- readonly reason: "bothKeys" | "taken" | "contended" | "failed" | "uncomposable";
477
+ readonly reason: "bothKeys" | "taken" | "contended" | "failed" | "uncomposable" | "unguarded";
407
478
  /** The row's primary key, as stored. */
408
479
  readonly key: Readonly<Record<string, unknown>>;
409
480
  /** Its current key: where it would move. */
410
481
  readonly target: Readonly<Record<string, unknown>> | undefined;
411
482
  readonly message: string;
412
483
  }
484
+ /**
485
+ * The index keys of live items that aren't what a `put` of their stored values writes (#185). Keys,
486
+ * not rows: a row can count more than once. The first four are counted on every run, for no extra
487
+ * read, and the last two only with {@link RekeyOptions.repairIndexKeys}.
488
+ *
489
+ * - `missing` — every composite is on the row, and no key
490
+ * - `truncated` — every composite is on the row, and the key stops at a leading run of them
491
+ * - `lagging` — the key holds other values: a composite changed under `preserve`, or a `sparse` half
492
+ * holds a key its values no longer compose
493
+ * - `ambiguous` — a `sparse` half with no key and two or more composites outside the primary key on
494
+ * the row. A writer naming only a later composite takes a row out of the index on purpose, and
495
+ * that leaves the same bytes, so these are never written
496
+ * - `repaired` — keys written: `missing`, `truncated` and `lagging`, less those a writer changed
497
+ * first. A dry run writes none, so it counts none: what it finds is what a run would write
498
+ * - `skipped` — keys a writer changed the row under, twice: the writer won
499
+ */
500
+ export interface RekeyIndexKeys {
501
+ readonly missing: number;
502
+ readonly truncated: number;
503
+ readonly lagging: number;
504
+ readonly ambiguous: number;
505
+ readonly repaired: number;
506
+ readonly skipped: number;
507
+ }
508
+ /**
509
+ * Rows `rekey` moved under a guard that can miss a write landing between its read and the move,
510
+ * with writes to the table going on (counted only without {@link RekeyOptions.writesStopped}). The
511
+ * move puts the row back as it read it, so a write the guard doesn't see is lost (DESIGN.md §7,
512
+ * "What 'as read' proves"):
513
+ *
514
+ * - `stamp` — an entity's row too wide to guard whole, guarded on its `updatedAt` (held, or absent)
515
+ * and what else fits: a write that leaves `updatedAt` as it was isn't seen when it changes an
516
+ * attribute the guard leaves out. A library write within the stamp's resolution (the same
517
+ * millisecond, or second for epoch seconds) is one: on an item, an update; on a tombstone, a soft
518
+ * delete of the item put again; on a time-series event, an `append` made after its current item
519
+ * was deleted. So is a `reembed`, which stamps nothing.
520
+ * - `sparse` — an entity's row with a sparse map (`storedAs: DynamoModel.SparseMap()`), guarded
521
+ * whole: a write that only adds an entry adds an attribute no declaration names, so the guard
522
+ * can't hold it absent. A library write stamps `updatedAt`, which the guard holds, so with
523
+ * timestamps only one within the stamp's resolution goes unseen.
524
+ * - `strongest` — a row of an aggregate or stream already part-moved, too wide to guard whole and
525
+ * finished under the strongest guard that fits: a write to an attribute it leaves out isn't seen.
526
+ *
527
+ * A row is counted only where a library write can be missed. A write from outside the library is
528
+ * seen only through the guard's terms, so these are never seen, on any row moved with writes going
529
+ * on, counted or not:
530
+ *
531
+ * - on a versioned item's row (live, snapshot or tombstone), one that leaves the version, the
532
+ * incarnation token and the vector attributes as they were, whatever else it changes;
533
+ * - on a unique sentinel, one that leaves the row it names as it was;
534
+ * - on an entity's other rows and an aggregate's rows, one that only adds attributes the member
535
+ * doesn't declare; on an event stream's row, one that only adds attributes; on a projection's row
536
+ * tombstone or outbox item, one that only adds attributes other than a drainer's claim;
537
+ * - on a row counted here, what its count says.
538
+ *
539
+ * Stopping writes and running with `writesStopped: true` closes every one of these.
540
+ */
541
+ export interface RekeyGuardGaps {
542
+ readonly stamp: number;
543
+ readonly sparse: number;
544
+ readonly strongest: number;
545
+ }
546
+ /** A row counted in {@link RekeyGuardGaps}, named so it can be checked. */
547
+ export interface RekeyGuardGapRow {
548
+ /** The entity type, aggregate or stream name. */
549
+ readonly member: string;
550
+ readonly kind: RekeyRowKind;
551
+ /** The count it's in. */
552
+ readonly gap: keyof RekeyGuardGaps;
553
+ /** The row's primary key, as stored when the run read it. */
554
+ readonly key: Readonly<Record<string, unknown>>;
555
+ /** Its current key: where the run moved it (a dry run: where it would). */
556
+ readonly target: Readonly<Record<string, unknown>>;
557
+ }
558
+ /** {@link RekeyGuardGaps}, and the rows counted. */
559
+ export interface RekeyGuardGapReport extends RekeyGuardGaps {
560
+ /**
561
+ * The rows counted, by member, kind and key: at most 100, the first in that order, so the list
562
+ * is the same whatever order the run met them in. The counts are exact.
563
+ */
564
+ readonly rows: ReadonlyArray<RekeyGuardGapRow>;
565
+ }
566
+ /**
567
+ * What `rekey` did with a unique sentinel no row holds, or one it couldn't judge
568
+ * ({@link RekeyReservation}):
569
+ *
570
+ * - `orphaned` — no row holds it, and it was left: the run didn't ask for
571
+ * {@link RekeyOptions.releaseOrphanedReservations}
572
+ * - `released` — deleted, or with `dryRun`, would be
573
+ * - `skipped` — left to a write that changed it or its row between the read and the release, twice
574
+ * - `raced` — no row held it when read, but a write got there before the release: it claimed the
575
+ * sentinel, gave the row it names its value, or deleted it. Read again, it is held or gone, so it
576
+ * was left, and it isn't counted `orphaned`
577
+ * - `undecided` — left, since nothing says whether a row holds it: it names no row, it names a row
578
+ * of another type whose attributes don't compose its key (one whose do is taken to hold it, as
579
+ * 1.40.0 took it, and isn't counted), or that row's values compose no sentinel key
580
+ */
581
+ export type RekeyReservationOutcome = "orphaned" | "released" | "skipped" | "raced" | "undecided";
582
+ /**
583
+ * A unique sentinel of a known entity and constraint that no row holds, or that `rekey` couldn't
584
+ * judge. A sentinel is held by the row its back-pointer (`_entity_pk` / `_entity_sk`) names, when
585
+ * that row's values compose the sentinel's key under any key text. With `softDelete: {
586
+ * preserveUnique: true }` a tombstone of that row holds it the same way: the soft delete kept the
587
+ * reservation on purpose.
588
+ */
589
+ export interface RekeyReservation {
590
+ /** The entity type. */
591
+ readonly member: string;
592
+ /** The unique constraint's name. */
593
+ readonly constraint: string;
594
+ /** The sentinel's primary key, as stored. */
595
+ readonly key: Readonly<Record<string, unknown>>;
596
+ /** The key its back-pointer names, as stored: `undefined` when it names none. */
597
+ readonly owner: Readonly<Record<string, unknown>> | undefined;
598
+ readonly outcome: RekeyReservationOutcome;
599
+ readonly message: string;
600
+ }
601
+ /**
602
+ * Unique sentinels no row holds, and ones `rekey` couldn't judge, counted only with
603
+ * {@link RekeyOptions.reservations} (or `releaseOrphanedReservations`): without, every count is 0,
604
+ * and such a sentinel is counted in `skipped.unrecognizedKey`, as 1.40.0 counted it. `released`,
605
+ * `skipped` and `raced` are counted only with {@link RekeyOptions.releaseOrphanedReservations}.
606
+ * `orphaned` counts every one found and still orphaned when released or left, so it includes those
607
+ * `released` and `skipped`, and not those `raced`. Each sentinel is judged once a run, however the
608
+ * run reaches it.
609
+ */
610
+ export interface RekeyReservationCounts {
611
+ readonly orphaned: number;
612
+ readonly released: number;
613
+ readonly skipped: number;
614
+ readonly raced: number;
615
+ readonly undecided: number;
616
+ }
617
+ /** {@link RekeyReservationCounts}, and each sentinel counted. */
618
+ export interface RekeyReservations extends RekeyReservationCounts {
619
+ /** One per sentinel counted, by member and then key. */
620
+ readonly entries: ReadonlyArray<RekeyReservation>;
621
+ }
413
622
  /** One member's share of a {@link RekeyReport}. */
414
623
  export interface RekeyMemberReport {
415
624
  readonly unchanged: number;
416
625
  readonly moved: RekeyCounts;
417
626
  readonly indexKeysRewritten: number;
627
+ readonly zonesRewritten: number;
418
628
  readonly sentinelsMoved: number;
419
629
  readonly conflicts: number;
630
+ readonly indexKeys: RekeyIndexKeys;
631
+ readonly reservations: RekeyReservationCounts;
632
+ readonly guardGaps: RekeyGuardGaps;
420
633
  }
421
634
  /**
422
- * What a `rekey` run did — or, with `dryRun`, would do. Counts are of rows
423
- * acted on: a row the scan reads after the run moved it (at its current key)
424
- * is `unchanged`, so `scanned` is not the sum of the others. A row an
425
- * application write moved between the scan and the move is `unchanged` too:
426
- * `moved` counts the rows this run moved.
635
+ * What a `rekey` run did — or, with `dryRun`, would do. Each row is judged once a run, however
636
+ * many times the scan and the moves of other rows reach it, and the report and the rows left
637
+ * don't depend on the order the scan returns rows in, its segment count or its `concurrency`.
638
+ * Counts are of rows stored when the run met them, never of rows the run wrote: the scan passes
639
+ * a row the run moved there. A row an application write moved between the scan and the move is
640
+ * `unchanged`: `moved` counts the rows this run moved.
427
641
  */
428
642
  export interface RekeyReport {
429
643
  readonly dryRun: boolean;
430
- /** Rows the scan returned. */
644
+ /**
645
+ * Rows the table held that the run met: each once, when the scan returned it or when the run
646
+ * moved it out of another row's way first. Rows the run put aren't counted, nor is a row the
647
+ * scan returned from a page read before the run moved it.
648
+ */
431
649
  readonly scanned: number;
432
- /** Rows of a known member already under their current keys, with nothing to rewrite. */
650
+ /**
651
+ * Rows of a known member already under their current keys, with nothing to rewrite. A row the
652
+ * run moved isn't, whichever member meets it after.
653
+ */
433
654
  readonly unchanged: number;
434
655
  /** Rows moved to their current keys (a dry run: rows that would move), by kind. */
435
656
  readonly moved: RekeyCounts;
@@ -438,18 +659,38 @@ export interface RekeyReport {
438
659
  * held 1.36 text, rewritten in place (`UpdateItem`).
439
660
  */
440
661
  readonly indexKeysRewritten: number;
662
+ /**
663
+ * Rows of an entity (items, snapshots, tombstones, time-series events) holding a named zone or a
664
+ * zoned date's text that isn't what a write of its value stores now, rewritten (a dry run: rows
665
+ * that would be): a zone 1.38.0 to 1.40.0 stored on Effect 4.1.3 with its `resolvedId`, which an
666
+ * equality condition or filter doesn't match. Rewritten in place, or in the row's move.
667
+ */
668
+ readonly zonesRewritten: number;
441
669
  /** Unique-constraint sentinels moved to their current keys. */
442
670
  readonly sentinelsMoved: number;
671
+ /** Index keys that aren't what a `put` of their row's values writes: {@link RekeyIndexKeys}. */
672
+ readonly indexKeys: RekeyIndexKeys;
673
+ /** Unique sentinels no row holds, and ones that couldn't be judged: {@link RekeyReservations}. */
674
+ readonly reservations: RekeyReservations;
675
+ /** Rows moved under a guard that can miss a write, and up to 100 of them: {@link RekeyGuardGapReport}. */
676
+ readonly guardGaps: RekeyGuardGapReport;
443
677
  /** Rows left where they are — see {@link RekeyConflict}. */
444
678
  readonly conflicts: ReadonlyArray<RekeyConflict>;
445
679
  /** Rows no member owns, by reason. */
446
680
  readonly skipped: {
447
681
  readonly [R in RekeySkipReason]: number;
448
682
  };
683
+ /**
684
+ * The outbox items counted in `skipped.ambiguousOwner`, each with why it was left: see
685
+ * {@link RekeyAmbiguity}.
686
+ */
687
+ readonly ambiguous: ReadonlyArray<RekeyAmbiguity>;
449
688
  /** Per entity type, aggregate and stream name. */
450
689
  readonly byMember: Readonly<Record<string, RekeyMemberReport>>;
451
690
  /** What the run consumed — always measured, whatever `ConsumedCapacity` reporting is set to. */
452
691
  readonly capacity: CapacityTotals;
692
+ /** What the run remembered, and whether it ran out of room: {@link RekeyJournal}. */
693
+ readonly journal: RekeyJournal;
453
694
  /**
454
695
  * Where the scan stopped, when it stopped before the end of the table
455
696
  * (`maxPages`): pass it as {@link RekeyOptions.resume} to go on.
@@ -457,20 +698,101 @@ export interface RekeyReport {
457
698
  */
458
699
  readonly resume: Option.Option<string>;
459
700
  }
701
+ /** The counts of a {@link RekeyReport}, by name. */
702
+ export type RekeyCountName = "scanned" | "unchanged" | "moved" | "indexKeysRewritten" | "sentinelsMoved" | "indexKeys" | "reservations" | "guardGaps" | "conflicts" | "skipped";
703
+ /**
704
+ * What a `rekey` run remembers ({@link RekeyOptions.journalCapacity}): the keys it wrote to, the
705
+ * units it judged, and what it counted once, each a 128-bit digest with a few flags, never key
706
+ * text or a row. A row it doesn't move, write or report costs nothing; an aggregate's rows, which
707
+ * its root's move may take after the scan meets them, cost an entry each, moved or not. Moving a
708
+ * row costs about five entries. A real run keeps no row's image (only the last few it put); a dry
709
+ * run keeps each row it plans to put, which its reads see, and that row takes an entry for every
710
+ * 256 bytes of it.
711
+ *
712
+ * Under the capacity every count is exact, and the same whatever order the run meets the rows in.
713
+ * Once it's reached (`full`), the run carries on — its writes are guarded as ever, so no row is
714
+ * lost or overwritten — but what it forgets it can't pass or count once: `inexact` names the counts
715
+ * that may be off. A real run then meets a row it put as a row stored there (`scanned`, `unchanged`,
716
+ * `indexKeys` count it, as 1.40.0 counted every such row), judges a unit reached again once more
717
+ * (`unchanged`, `reservations`), may count a row stored under two old key texts as two moves
718
+ * (`moved`), may report a row in another's way that a run with room moves after it (`conflicts`; a
719
+ * rerun moves it), and doesn't report a row with no aggregate root found (`skipped`). A dry run's
720
+ * reads no longer see its whole plan, so any count may be off.
721
+ */
722
+ export interface RekeyJournal {
723
+ /** {@link RekeyOptions.journalCapacity}, as used. */
724
+ readonly capacity: number;
725
+ /** The entries the run kept: at most `capacity`. */
726
+ readonly used: number;
727
+ /** Whether the run had more to keep than `capacity` entries. */
728
+ readonly full: boolean;
729
+ /** The counts that may be off: none while the journal isn't full. */
730
+ readonly inexact: ReadonlyArray<RekeyCountName>;
731
+ }
460
732
  /** Options for `db.tables.<Table>.rekey()`. */
461
733
  export interface RekeyOptions {
462
734
  /**
463
- * Count what would move, reading but writing nothing. Default `false`. Each row is
464
- * judged on its own, so a row whose destination is held by a row that can't move
465
- * may be predicted as moved.
735
+ * Count what would move, reading but writing nothing. Default `false`. What holds a
736
+ * row's destination is judged too, so what would stop the row stops it here as well.
466
737
  */
467
738
  readonly dryRun?: boolean | undefined;
739
+ /**
740
+ * Also write the index keys {@link RekeyReport.indexKeys} finds differing, except `ambiguous`
741
+ * ones. Default `false`: the run counts them and writes nothing new. Each row is one conditional
742
+ * `UpdateItem`, guarded on every key it writes and every composite it composes them from as read,
743
+ * so a writer changing any of them wins; on a failed condition the row is read once and judged
744
+ * again, then counted in `skipped`. A table with nothing to repair costs the scan alone.
745
+ */
746
+ readonly repairIndexKeys?: boolean | undefined;
747
+ /**
748
+ * Judge the unique sentinels no row holds, and count them in {@link RekeyReport.reservations}.
749
+ * Default `false`: the run sends what 1.40.0 sent, and counts such a sentinel in
750
+ * `skipped.unrecognizedKey`, as 1.40.0 did. Judging reads more than that: under `preserveUnique`,
751
+ * a sentinel whose item is gone or holds another value costs a query for the item's tombstones,
752
+ * and one that looks orphaned is read again. It writes nothing.
753
+ */
754
+ readonly reservations?: boolean | undefined;
755
+ /**
756
+ * Also delete the unique sentinels {@link RekeyReport.reservations} finds no row holding
757
+ * (`orphaned`), so their values can be taken again. Implies {@link reservations}. Default
758
+ * `false`: nothing is deleted. A maintenance step: it needs {@link writesStopped}, with every
759
+ * writer to the table stopped — another run releasing reservations counts as one — and fails
760
+ * with a `ValidationError` (`EDD-9098`) before anything is read without it. Each release is one
761
+ * transaction: the sentinel's `Delete`, conditioned on its back-pointer (and TTL, when it has
762
+ * one) as read, so another row's claim in between is never deleted, and a `ConditionCheck`
763
+ * that the row it names is still absent, or still holds the values read. These don't make it
764
+ * safe while the application writes, hence `writesStopped`: the row it names can take the value
765
+ * again in between, put again and soft-deleted under `preserveUnique`, leaving the sentinel as
766
+ * read and its tombstone holding the value, and the release deletes a reservation in use. On a
767
+ * failed condition the sentinel is read once and judged again. Only a sentinel of a known entity and constraint,
768
+ * under the schema's own key prefix, is ever judged. An orphaned sentinel holding the current
769
+ * key of another item's sentinel is judged, and released, before that sentinel moves there.
770
+ */
771
+ readonly releaseOrphanedReservations?: boolean | undefined;
772
+ /**
773
+ * Writes to the table are stopped for this run. A row `rekey` can't prove unchanged when it
774
+ * moves (`unguarded`: too wide to guard whole, with no version or stamped `updatedAt` to stand in) then
775
+ * moves under the strongest guard that fits, as on 1.39.0. Default `false`: such a row is
776
+ * left where it is and reported `unguarded`, since a write landing between the read and the move
777
+ * would be lost, unless its aggregate or stream is already part-moved. Run with this only while
778
+ * nothing else writes to the table.
779
+ */
780
+ readonly writesStopped?: boolean | undefined;
468
781
  /** Parallel scan segments (`TotalSegments`), each scanned by its own fiber. Default 1. */
469
782
  readonly segments?: number | undefined;
470
783
  /** Rows of one scan page handled at once, per segment. Default 4. */
471
784
  readonly concurrency?: number | undefined;
472
785
  /** The scan's page size (`Limit`). Default: DynamoDB's (1 MB pages). */
473
786
  readonly pageSize?: number | undefined;
787
+ /**
788
+ * How many entries the run's journal holds at most ({@link RekeyJournal}): one for each key it
789
+ * writes to, unit it judges and row it counts once; a row it doesn't move, write or report costs
790
+ * none. Default 1,000,000: about 145 bytes an entry, so about 138 MiB when full, and exact counts
791
+ * for about 200,000 moved rows. Past it the run goes on, its counts named in
792
+ * {@link RekeyReport.journal} may be off, and a smaller run (`maxPages`, then `resume`) keeps
793
+ * them exact. A positive integer up to 16,000,000.
794
+ */
795
+ readonly journalCapacity?: number | undefined;
474
796
  /**
475
797
  * Stop after this many scan pages (all segments together) and return a
476
798
  * {@link RekeyReport.resume} token: bound a run to a time slot and go on
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","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EAAE,GAAG,EAAE,GAAG,CAAC,GAC9C,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CACtD,GACD,SAAS,CAAA;IACb;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;CACnF;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;IAEzF,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;IAEvD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,CAAA;CAChF"}
package/dist/Table.js CHANGED
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * Use `DynamoClient.make()` to get a typed client with bound entity operations.
9
9
  */
10
+ import { setOwn } from "@effect-dynamodb/schema/internal/OwnNames.js";
10
11
  import { refuseSharedKeyAttribute } from "@effect-dynamodb/schema/internal/SharedKeyAttribute.js";
11
12
  import { isZOrderHalf } from "@effect-dynamodb/schema/KeyComposer.js";
12
13
  import { toWireDistanceFunction } from "@effect-dynamodb/schema/VectorIndex.js";
@@ -15,6 +16,32 @@ import { Context, Effect, Layer } from "effect";
15
16
  export const DEFAULT_TTL_ATTRIBUTE_NAME = "_ttl";
16
17
  /** Resolve the effective TTL attribute name from a TableConfig. */
17
18
  export const resolveTtlAttributeName = (tc) => tc.ttlAttributeName ?? DEFAULT_TTL_ATTRIBUTE_NAME;
19
+ const keyAttributesByTag = new WeakMap();
20
+ // A service key is a function as much as an object.
21
+ const isTagObject = (tag) => (typeof tag === "object" && tag !== null) || typeof tag === "function";
22
+ /**
23
+ * @internal The attributes a table's members write keys under, by its service (#237): the
24
+ * primary key's, every secondary index's (entity and aggregate) and every vector index's
25
+ * partition and filter attributes, as {@link resolveKeyAttributeTypes} lists them, and those of
26
+ * every aggregate made on the table without being registered on it and every event stream's
27
+ * index on it ({@link addTableKeyAttributes}). Any item holding one of them is indexed by it, so
28
+ * the library adds no attribute of its own under such a name. `undefined` for a service `make`
29
+ * didn't create.
30
+ */
31
+ export const tableKeyAttributes = (tag) => isTagObject(tag) ? keyAttributesByTag.get(tag) : undefined;
32
+ /**
33
+ * @internal Adds the attributes an aggregate made on a table, or an event stream's indexes on it,
34
+ * write keys under (#237): neither is registered on the table, and their items are on it all the
35
+ * same.
36
+ */
37
+ export const addTableKeyAttributes = (tag, names) => {
38
+ if (!isTagObject(tag))
39
+ return;
40
+ const known = keyAttributesByTag.get(tag) ?? new Set();
41
+ for (const name of names)
42
+ known.add(name);
43
+ keyAttributesByTag.set(tag, known);
44
+ };
18
45
  /**
19
46
  * Counter for generating unique Tag identifiers.
20
47
  * Each `make()` call increments this to ensure distinct Context.Service tags.
@@ -68,7 +95,7 @@ export const make = (config) => {
68
95
  // One attribute has one `AttributeDefinitions` type: a Z-order (`B`) sort key
69
96
  // can't share its attribute with a string key half or a vector filter
70
97
  // attribute of another type (EDD-9091).
71
- resolveKeyAttributeTypes(entities, aggregates, primary);
98
+ const keyAttributes = resolveKeyAttributeTypes(entities, aggregates, primary);
72
99
  // Two of an entity's key halves in one attribute must have the same fields, order and
73
100
  // casing (EDD-9106). `Entity.make` refused what no schema can reconcile; a casing an index
74
101
  // leaves to the schema resolves only here.
@@ -83,6 +110,7 @@ export const make = (config) => {
83
110
  entity._configure(config.schema, Tag);
84
111
  }
85
112
  }
113
+ addTableKeyAttributes(Tag, keyAttributes.keys());
86
114
  return {
87
115
  _tag: "Table",
88
116
  schema: config.schema,
@@ -163,7 +191,7 @@ export const mergeVectorIndexes = (entities) => {
163
191
  `"${existing.owner}" and "${storedType}" by entity "${owner}". A shared ` +
164
192
  `SearchSchema attribute must have one scalar type.`);
165
193
  }
166
- existing.filterStoredTypes[stored] = storedType;
194
+ setOwn(existing.filterStoredTypes, stored, storedType);
167
195
  if (existing.filters.some((f) => existing.resolveDbName(f) === stored))
168
196
  continue;
169
197
  existing.filters.push(filter);