@mastra/oracledb 0.5.2-alpha.1 → 0.5.3-alpha.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.
@@ -3,7 +3,7 @@ name: mastra-oracledb
3
3
  description: Documentation for @mastra/oracledb. Use when working with @mastra/oracledb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/oracledb"
6
- version: "0.5.2-alpha.1"
6
+ version: "0.5.3-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.2-alpha.1",
2
+ "version": "0.5.3-alpha.0",
3
3
  "package": "@mastra/oracledb",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -12,18 +12,21 @@ Retention covers **growth tables** only: tables that accumulate rows unbounded a
12
12
 
13
13
  Storage adapters use the shared core retention contract for `prune()`, or a database-native mechanism when that better matches the backend.
14
14
 
15
- | Adapter | Mechanism | Retention support |
16
- | -------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | libSQL | `prune()` | All supported growth domains |
18
- | PostgreSQL | `prune()` | All supported growth domains. vNext observability drops expired partitions or chunks |
19
- | MongoDB | `prune()` or native TTL | All supported growth domains. Native TTL indexes are also available |
20
- | DuckDB | `prune()` | Observability spans, metrics, logs, scores, and feedback |
21
- | MySQL | `prune()` | Observability spans |
22
- | Microsoft SQL Server | `prune()` | Observability spans |
23
- | Oracle Database | `prune()` | Observability spans and logs |
24
- | Amazon Aurora DSQL | `prune()` | Observability spans |
25
- | Google Cloud Spanner | `prune()` | Observability spans, plus metrics when metrics storage is enabled |
26
- | ClickHouse | Native TTL | Observability spans, metrics, logs, scores, and feedback. When all five signals have finite retention, deletion-request records expire after the longest signal retention plus 30 days |
15
+ | Adapter | Mechanism | Retention support |
16
+ | --------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | libSQL | `prune()` | All supported growth domains |
18
+ | PostgreSQL | `prune()` | All supported growth domains. vNext observability drops expired partitions or chunks |
19
+ | MongoDB | `prune()` or native TTL | All supported growth domains. Native TTL indexes are also available |
20
+ | DuckDB | `prune()` | Observability spans, metrics, logs, scores, and feedback |
21
+ | MySQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
22
+ | Microsoft SQL Server | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
23
+ | Oracle Database | `prune()` | Observability spans and logs, durable agent run fencing (`runOwnership`, `runFences`) |
24
+ | Amazon Aurora DSQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
25
+ | Google Cloud Spanner | `prune()` | Observability spans, plus metrics when metrics storage is enabled. Durable agent run fencing (`runOwnership`, `runFences`) |
26
+ | DynamoDB | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
27
+ | Convex | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`). Redeploy your Convex functions after upgrading |
28
+ | Cloudflare D1 and Durable Objects | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
29
+ | ClickHouse | Native TTL | Observability spans, metrics, logs, scores, and feedback. When all five signals have finite retention, deletion-request records expire after the longest signal retention plus 30 days |
27
30
 
28
31
  ## Storage-specific maintenance
29
32
 
package/dist/index.cjs CHANGED
@@ -5723,6 +5723,17 @@ var MemoryOracle = class MemoryOracle extends _mastra_core_storage.MemoryStorage
5723
5723
  _mastra_core_storage.TABLE_OBSERVATIONAL_MEMORY,
5724
5724
  _mastra_core_storage.TABLE_MEMORY_RUN_FENCES
5725
5725
  ];
5726
+ /**
5727
+ * Tables `prune()` can clean up. Run fences anchor on `retiredAt` (epoch ms), which stays NULL until the
5728
+ * execution holding the fence settles, so a running execution's fence is
5729
+ * never pruned.
5730
+ */
5731
+ static retentionTables = { runFences: {
5732
+ table: _mastra_core_storage.TABLE_MEMORY_RUN_FENCES,
5733
+ column: "retiredAt",
5734
+ indexed: false,
5735
+ anchorType: "epoch-ms"
5736
+ } };
5726
5737
  db;
5727
5738
  schemaName;
5728
5739
  messageBatchSize;
@@ -5773,6 +5784,24 @@ var MemoryOracle = class MemoryOracle extends _mastra_core_storage.MemoryStorage
5773
5784
  async backfillObservationalMemorySupersededBy() {
5774
5785
  await this.ctx.db.withConnection((connection) => backfillObservationalMemorySupersededBy(this.ctx, connection));
5775
5786
  }
5787
+ async prune(policies, options) {
5788
+ return (0, _mastra_core_storage.executeRetentionPrune)({
5789
+ domain: "memory",
5790
+ targets: (0, _mastra_core_storage.resolveRetentionTargets)({
5791
+ policies,
5792
+ descriptor: MemoryOracle.retentionTables,
5793
+ order: ["runFences"]
5794
+ }),
5795
+ options,
5796
+ cutoffFor: (target, now) => (0, _mastra_core_storage.retentionCutoffMs)(target.policy, now),
5797
+ deleteBatch: (target, cutoff, limit) => this.db.pruneBatch({
5798
+ tableName: target.table,
5799
+ column: target.column,
5800
+ cutoff,
5801
+ limit
5802
+ })
5803
+ });
5804
+ }
5776
5805
  async dangerouslyClearAll() {
5777
5806
  await clearAllMemoryTables(this.ctx);
5778
5807
  await this.db.clearTable(_mastra_core_storage.TABLE_MEMORY_RUN_FENCES);
@@ -8364,6 +8393,17 @@ function toRunOwnershipRecord(runId, row) {
8364
8393
  }
8365
8394
  var WorkflowsOracle = class WorkflowsOracle extends _mastra_core_storage.WorkflowsStorage {
8366
8395
  static MANAGED_TABLES = [_mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT, _mastra_core_storage.TABLE_WORKFLOW_RUN_OWNERS];
8396
+ /**
8397
+ * Tables `prune()` can clean up. Run ownership rows anchor on `updatedAt` (epoch ms), which every
8398
+ * claim, renewal and release refreshes, so a live execution's row is never
8399
+ * older than its renew interval.
8400
+ */
8401
+ static retentionTables = { runOwnership: {
8402
+ table: _mastra_core_storage.TABLE_WORKFLOW_RUN_OWNERS,
8403
+ column: "updatedAt",
8404
+ indexed: false,
8405
+ anchorType: "epoch-ms"
8406
+ } };
8367
8407
  db;
8368
8408
  schemaName;
8369
8409
  skipDefaultIndexes;
@@ -8382,6 +8422,24 @@ var WorkflowsOracle = class WorkflowsOracle extends _mastra_core_storage.Workflo
8382
8422
  await this.createTables();
8383
8423
  await this.createIndexes();
8384
8424
  }
8425
+ async prune(policies, options) {
8426
+ return (0, _mastra_core_storage.executeRetentionPrune)({
8427
+ domain: "workflows",
8428
+ targets: (0, _mastra_core_storage.resolveRetentionTargets)({
8429
+ policies,
8430
+ descriptor: WorkflowsOracle.retentionTables,
8431
+ order: ["runOwnership"]
8432
+ }),
8433
+ options,
8434
+ cutoffFor: (target, now) => (0, _mastra_core_storage.retentionCutoffMs)(target.policy, now),
8435
+ deleteBatch: (target, cutoff, limit) => this.db.pruneBatch({
8436
+ tableName: target.table,
8437
+ column: target.column,
8438
+ cutoff,
8439
+ limit
8440
+ })
8441
+ });
8442
+ }
8385
8443
  async dangerouslyClearAll() {
8386
8444
  await this.db.clearTable(_mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT);
8387
8445
  await this.db.clearTable(_mastra_core_storage.TABLE_WORKFLOW_RUN_OWNERS);