@mastra/libsql 1.8.0 → 1.8.1-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
@@ -3902,6 +3902,16 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
3902
3902
  tableName: TABLE_EXPERIMENT_RESULTS,
3903
3903
  schema: EXPERIMENT_RESULTS_SCHEMA
3904
3904
  });
3905
+ await this.#db.alterTable({
3906
+ tableName: TABLE_EXPERIMENTS,
3907
+ schema: EXPERIMENTS_SCHEMA,
3908
+ ifNotExists: ["agentVersion"]
3909
+ });
3910
+ await this.#db.alterTable({
3911
+ tableName: TABLE_EXPERIMENT_RESULTS,
3912
+ schema: EXPERIMENT_RESULTS_SCHEMA,
3913
+ ifNotExists: ["status", "tags"]
3914
+ });
3905
3915
  await this.#client.execute({
3906
3916
  sql: `CREATE INDEX IF NOT EXISTS idx_experiments_datasetid ON "${TABLE_EXPERIMENTS}" ("datasetId")`,
3907
3917
  args: []
@@ -4122,6 +4132,22 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
4122
4132
  conditions.push("datasetId = ?");
4123
4133
  queryParams.push(args.datasetId);
4124
4134
  }
4135
+ if (args.targetType) {
4136
+ conditions.push("targetType = ?");
4137
+ queryParams.push(args.targetType);
4138
+ }
4139
+ if (args.targetId) {
4140
+ conditions.push("targetId = ?");
4141
+ queryParams.push(args.targetId);
4142
+ }
4143
+ if (args.agentVersion) {
4144
+ conditions.push("agentVersion = ?");
4145
+ queryParams.push(args.agentVersion);
4146
+ }
4147
+ if (args.status) {
4148
+ conditions.push("status = ?");
4149
+ queryParams.push(args.status);
4150
+ }
4125
4151
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
4126
4152
  const countResult = await this.#client.execute({
4127
4153
  sql: `SELECT COUNT(*) as count FROM ${TABLE_EXPERIMENTS} ${whereClause}`,
@@ -4324,6 +4350,14 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
4324
4350
  const { page, perPage: perPageInput } = args.pagination;
4325
4351
  const conditions = ["experimentId = ?"];
4326
4352
  const queryParams = [args.experimentId];
4353
+ if (args.traceId) {
4354
+ conditions.push("traceId = ?");
4355
+ queryParams.push(args.traceId);
4356
+ }
4357
+ if (args.status) {
4358
+ conditions.push("status = ?");
4359
+ queryParams.push(args.status);
4360
+ }
4327
4361
  const whereClause = `WHERE ${conditions.join(" AND ")}`;
4328
4362
  const countResult = await this.#client.execute({
4329
4363
  sql: `SELECT COUNT(*) as count FROM ${TABLE_EXPERIMENT_RESULTS} ${whereClause}`,