@lythos/infra 0.15.6 → 0.15.7
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 +1 -1
- package/src/sqlite-db.ts +14 -0
package/package.json
CHANGED
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
|
}
|