@mastra/dsql 1.5.4 → 1.5.5-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.
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@ let _mastra_core_base = require("@mastra/core/base");
7
7
  let _mastra_core_utils = require("@mastra/core/utils");
8
8
  let _mastra_core_agent = require("@mastra/core/agent");
9
9
  let _mastra_core_evals = require("@mastra/core/evals");
10
- //#region src/shared/config.ts
10
+ // src/shared/config.ts
11
11
  /**
12
12
  * Default connection pool settings optimized for Aurora DSQL.
13
13
  *
@@ -71,8 +71,7 @@ const getEffectiveRegion = (config) => {
71
71
  if (extractedRegion) return extractedRegion;
72
72
  throw new Error("DSQLStore: region could not be determined. Provide region in config or use a standard DSQL endpoint.");
73
73
  };
74
- //#endregion
75
- //#region src/storage/client.ts
74
+ // src/storage/client.ts
76
75
  /**
77
76
  * Truncate a query string for error messages.
78
77
  */
@@ -440,8 +439,7 @@ async function withRetry(fn, options = {}) {
440
439
  }
441
440
  throw lastError;
442
441
  }
443
- //#endregion
444
- //#region src/shared/batch.ts
442
+ // src/shared/batch.ts
445
443
  /**
446
444
  * Batch utilities for Aurora DSQL.
447
445
  *
@@ -490,8 +488,7 @@ function splitIntoBatches(records, options = {}) {
490
488
  batchCount: batches.length
491
489
  };
492
490
  }
493
- //#endregion
494
- //#region src/storage/db/index.ts
491
+ // src/storage/db/index.ts
495
492
  /**
496
493
  * Resolves DsqlDomainConfi to a database client and schema.
497
494
  * Handles creating a new pool if config is provided.
@@ -1231,8 +1228,7 @@ var DsqlDB = class extends _mastra_core_base.MastraBase {
1231
1228
  return this.clearTable({ tableName });
1232
1229
  }
1233
1230
  };
1234
- //#endregion
1235
- //#region src/storage/domains/utils.ts
1231
+ // src/storage/domains/utils.ts
1236
1232
  function getSchemaName(schema) {
1237
1233
  return schema ? `"${(0, _mastra_core_utils.parseSqlIdentifier)(schema, "schema name")}"` : void 0;
1238
1234
  }
@@ -1261,8 +1257,7 @@ function transformFromSqlRow({ tableName, sqlRow }) {
1261
1257
  });
1262
1258
  return result;
1263
1259
  }
1264
- //#endregion
1265
- //#region src/storage/domains/agents/index.ts
1260
+ // src/storage/domains/agents/index.ts
1266
1261
  var AgentsDSQL = class AgentsDSQL extends _mastra_core_storage.AgentsStorage {
1267
1262
  #db;
1268
1263
  #schema;
@@ -1826,8 +1821,7 @@ var AgentsDSQL = class AgentsDSQL extends _mastra_core_storage.AgentsStorage {
1826
1821
  };
1827
1822
  }
1828
1823
  };
1829
- //#endregion
1830
- //#region src/storage/db/run-fencing.ts
1824
+ // src/storage/db/run-fencing.ts
1831
1825
  /**
1832
1826
  * Epoch milliseconds on the database clock. Aurora DSQL never waits on a row
1833
1827
  * lock, so the transaction's start time is the time its statements run, and
@@ -1870,8 +1864,7 @@ function withRunFence(client, claimsTable, fence, operation, write) {
1870
1864
  return write(t);
1871
1865
  });
1872
1866
  }
1873
- //#endregion
1874
- //#region src/storage/domains/memory/index.ts
1867
+ // src/storage/domains/memory/index.ts
1875
1868
  /**
1876
1869
  * Generate SQL placeholder string for IN clauses.
1877
1870
  * @param count - Number of placeholders to generate
@@ -2947,8 +2940,7 @@ var MemoryDSQL = class MemoryDSQL extends _mastra_core_storage.MemoryStorage {
2947
2940
  return result;
2948
2941
  }
2949
2942
  };
2950
- //#endregion
2951
- //#region src/storage/domains/observability/index.ts
2943
+ // src/storage/domains/observability/index.ts
2952
2944
  var ObservabilityDSQL = class ObservabilityDSQL extends _mastra_core_storage.ObservabilityStorage {
2953
2945
  static retentionTables = { spans: {
2954
2946
  table: _mastra_core_storage.TABLE_SPANS,
@@ -3504,8 +3496,7 @@ var ObservabilityDSQL = class ObservabilityDSQL extends _mastra_core_storage.Obs
3504
3496
  }
3505
3497
  }
3506
3498
  };
3507
- //#endregion
3508
- //#region src/storage/domains/scores/index.ts
3499
+ // src/storage/domains/scores/index.ts
3509
3500
  /**
3510
3501
  * DSQL-specific score row transformation.
3511
3502
  * Uses Z-suffix timestamps (createdAtZ, updatedAtZ) when available.
@@ -3882,8 +3873,7 @@ var ScoresDSQL = class ScoresDSQL extends _mastra_core_storage.ScoresStorage {
3882
3873
  }
3883
3874
  }
3884
3875
  };
3885
- //#endregion
3886
- //#region src/storage/domains/workflows/index.ts
3876
+ // src/storage/domains/workflows/index.ts
3887
3877
  const RUN_OWNER_COLUMNS = `generation, "ownerId", "leaseExpiresAt", ${DB_NOW_MS} AS "nowMs"`;
3888
3878
  function toRunOwnershipRecord(runId, row) {
3889
3879
  const leaseExpiresAt = row.leaseExpiresAt === null ? null : Number(row.leaseExpiresAt);
@@ -4419,8 +4409,7 @@ var WorkflowsDSQL = class WorkflowsDSQL extends _mastra_core_storage.WorkflowsSt
4419
4409
  }
4420
4410
  }
4421
4411
  };
4422
- //#endregion
4423
- //#region src/storage/index.ts
4412
+ // src/storage/index.ts
4424
4413
  var DSQLStore = class extends _mastra_core_storage.MastraStorage {
4425
4414
  #pool;
4426
4415
  #db;
@@ -4530,7 +4519,6 @@ var DSQLStore = class extends _mastra_core_storage.MastraStorage {
4530
4519
  this.isInitialized = false;
4531
4520
  }
4532
4521
  };
4533
- //#endregion
4534
4522
  exports.AgentsDSQL = AgentsDSQL;
4535
4523
  exports.DSQLStore = DSQLStore;
4536
4524
  exports.DSQL_POOL_DEFAULTS = DSQL_POOL_DEFAULTS;