@lythos/infra 0.15.6 → 0.16.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sqlite-db.ts +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lythos/infra",
3
- "version": "0.15.6",
3
+ "version": "0.16.0",
4
4
  "description": "Runtime infrastructure base — SqliteDb, config fetch, shared helpers",
5
5
  "keywords": [
6
6
  "ai-agent",
package/src/sqlite-db.ts CHANGED
@@ -75,4 +75,18 @@ export abstract class SqliteDb {
75
75
  this._db?.close()
76
76
  this._db = null
77
77
  }
78
+
79
+ /**
80
+ * Symbol.dispose — enables `using` declaration (TC39 Stage 3, Bun-supported).
81
+ *
82
+ * Example:
83
+ * using db = new CatalogDb(path);
84
+ * db.query(...)
85
+ * // db.close() called automatically at end of block
86
+ *
87
+ * For test scopes or callback-style, see `useDb()` helper in consumer packages.
88
+ */
89
+ [Symbol.dispose](): void {
90
+ this.close()
91
+ }
78
92
  }