@mastra/spanner 1.9.5 → 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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +15 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/datasets/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/metrics.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
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 =
|
|
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
|
|
8487
|
-
|
|
8488
|
-
|
|
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",
|