@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/local-stores",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Local SQLite-based stores for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,7 +25,7 @@
25
25
  "@types/sql.js": "^1.4.11",
26
26
  "sql.js": "^1.14.1",
27
27
  "uuid": "^14.0.1",
28
- "@axiom-lattice/core": "2.1.99",
28
+ "@axiom-lattice/core": "2.1.100",
29
29
  "@axiom-lattice/protocols": "2.1.51"
30
30
  },
31
31
  "devDependencies": {
@@ -42,6 +42,13 @@ export class LocalConnectionStore implements ConnectionStore {
42
42
  ensureTable(db, DDL);
43
43
  }
44
44
 
45
+ async listByTenant(tenantId: string): Promise<ConnectionEntry[]> {
46
+ const rows = this.db.prepare(
47
+ `SELECT * FROM connection_configs WHERE tenant_id = ? ORDER BY created_at`,
48
+ ).all(tenantId) as unknown as ConnectionRow[];
49
+ return rows.map((r) => this.mapRow(r));
50
+ }
51
+
45
52
  async listByType(tenantId: string, type: string): Promise<ConnectionEntry[]> {
46
53
  const rows = this.db.prepare(
47
54
  `SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? ORDER BY created_at`,
@@ -404,6 +404,14 @@ export class LocalEvalStore implements EvalStore {
404
404
  return this.getRunResultById(tenantId, id);
405
405
  }
406
406
 
407
+ async deleteRunResult(tenantId: string, id: string): Promise<boolean> {
408
+ const result = this.db.prepare(
409
+ `DELETE FROM lt_eval_run_results
410
+ WHERE id = ? AND run_id IN (SELECT id FROM lt_eval_runs WHERE tenant_id = ?)`,
411
+ ).run(id, tenantId);
412
+ return result.changes > 0;
413
+ }
414
+
407
415
  // -------------------------------------------------------------------------
408
416
  // Reports
409
417
  // -------------------------------------------------------------------------