@mastra/spanner 1.9.6-alpha.0 → 1.10.0-alpha.1

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-spanner
3
3
  description: Documentation for @mastra/spanner. Use when working with @mastra/spanner APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/spanner"
6
- version: "1.9.6-alpha.0"
6
+ version: "1.10.0-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.6-alpha.0",
2
+ "version": "1.10.0-alpha.1",
3
3
  "package": "@mastra/spanner",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -3274,6 +3274,10 @@ var DatasetsSpanner = class DatasetsSpanner extends _mastra_core_storage.Dataset
3274
3274
  const tableName = quoteIdent(_mastra_core_storage.TABLE_DATASETS, "table name");
3275
3275
  const filterConditions = [];
3276
3276
  const filterParams = {};
3277
+ if (args.filters?.datasetIds !== void 0) {
3278
+ filterConditions.push(`${quoteIdent("id", "column name")} IN UNNEST(@datasetIds)`);
3279
+ filterParams.datasetIds = args.filters.datasetIds;
3280
+ }
3277
3281
  if (args.filters?.organizationId !== void 0) {
3278
3282
  filterConditions.push(`${quoteIdent("organizationId", "column name")} = @organizationId`);
3279
3283
  filterParams.organizationId = args.filters.organizationId;
@@ -3303,10 +3307,15 @@ var DatasetsSpanner = class DatasetsSpanner extends _mastra_core_storage.Dataset
3303
3307
  filterParams.nameSubstring = `%${args.filters.name}%`;
3304
3308
  }
3305
3309
  const whereClause = filterConditions.length > 0 ? `WHERE ${filterConditions.join(" AND ")}` : "";
3306
- const filterTypes = args.filters?.targetIds !== void 0 && args.filters.targetIds.length > 0 ? { targetIds: {
3310
+ const filterTypes = {};
3311
+ if (args.filters?.targetIds !== void 0 && args.filters.targetIds.length > 0) filterTypes.targetIds = {
3307
3312
  type: "array",
3308
3313
  child: { type: "string" }
3309
- } } : {};
3314
+ };
3315
+ if (args.filters?.datasetIds !== void 0) filterTypes.datasetIds = {
3316
+ type: "array",
3317
+ child: { type: "string" }
3318
+ };
3310
3319
  const [countRows] = await this.database.run({
3311
3320
  sql: `SELECT COUNT(*) AS count FROM ${tableName} ${whereClause}`,
3312
3321
  params: filterParams,
@@ -8483,18 +8492,15 @@ function buildWhereClause(filters, startIndex = 0) {
8483
8492
  conditions.push("1 = 0");
8484
8493
  return;
8485
8494
  }
8486
- const placeholders = [];
8487
- for (const v of values) {
8488
- const param = `f${i++}`;
8489
- placeholders.push(`@${param}`);
8490
- params[param] = v;
8491
- }
8492
- conditions.push(`${quoteIdent(col, "column name")} IN (${placeholders.join(", ")})`);
8495
+ const param = `f${i++}`;
8496
+ params[param] = [...values];
8497
+ conditions.push(`${quoteIdent(col, "column name")} IN UNNEST(@${param})`);
8493
8498
  };
8494
8499
  const ts = filters.timestamp;
8495
8500
  if (ts?.start) bindScalar("timestamp", ts.start, ts.startExclusive ? ">" : ">=");
8496
8501
  if (ts?.end) bindScalar("timestamp", ts.end, ts.endExclusive ? "<" : "<=");
8497
8502
  if (Array.isArray(filters.traceIds)) bindIn("traceId", filters.traceIds);
8503
+ if (Array.isArray(filters.experimentIds)) bindIn("experimentId", filters.experimentIds);
8498
8504
  for (const k of [
8499
8505
  "traceId",
8500
8506
  "spanId",