@axiom-lattice/local-stores 1.0.21 → 1.0.22

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.mjs CHANGED
@@ -1156,6 +1156,12 @@ var LocalConnectionStore = class {
1156
1156
  this.db = db;
1157
1157
  ensureTable(db, DDL9);
1158
1158
  }
1159
+ async listByTenant(tenantId) {
1160
+ const rows = this.db.prepare(
1161
+ `SELECT * FROM connection_configs WHERE tenant_id = ? ORDER BY created_at`
1162
+ ).all(tenantId);
1163
+ return rows.map((r) => this.mapRow(r));
1164
+ }
1159
1165
  async listByType(tenantId, type) {
1160
1166
  const rows = this.db.prepare(
1161
1167
  `SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? ORDER BY created_at`
@@ -2347,6 +2353,13 @@ var LocalEvalStore = class {
2347
2353
  ).run(...vals);
2348
2354
  return this.getRunResultById(tenantId, id);
2349
2355
  }
2356
+ async deleteRunResult(tenantId, id) {
2357
+ const result = this.db.prepare(
2358
+ `DELETE FROM lt_eval_run_results
2359
+ WHERE id = ? AND run_id IN (SELECT id FROM lt_eval_runs WHERE tenant_id = ?)`
2360
+ ).run(id, tenantId);
2361
+ return result.changes > 0;
2362
+ }
2350
2363
  // -------------------------------------------------------------------------
2351
2364
  // Reports
2352
2365
  // -------------------------------------------------------------------------