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