@wxn0brp/db-storage-sqlite 0.110.4 → 0.110.5-alpha.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.
package/README.md CHANGED
@@ -59,6 +59,9 @@ await db.users.update({ name: "John Doe" }, { email: "newemail@example.com" });
59
59
 
60
60
  // 8. Remove entries
61
61
  await db.users.remove({ name: "John Doe" });
62
+
63
+ // 9. Close the SQLite handle
64
+ await db.close();
62
65
  ```
63
66
 
64
67
  ## API Notes
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare class SQLiteValthera extends ActionsBase {
9
9
  primaryKey: Record<string, string>;
10
10
  _inited: boolean;
11
11
  constructor(db: SupportedDB, primaryKey?: Record<string, string>);
12
+ close(): Promise<void>;
12
13
  _prepare(sql: string): Promise<VStatement>;
13
14
  getCollections(): Promise<string[]>;
14
15
  add(config: VQueryT.Add): Promise<Data>;
package/dist/index.js CHANGED
@@ -18,6 +18,11 @@ export class SQLiteValthera extends ActionsBase {
18
18
  this.db = db;
19
19
  this.primaryKey = primaryKey;
20
20
  }
21
+ async close() {
22
+ const close = this.db.close;
23
+ if (typeof close === "function")
24
+ await Promise.resolve(close.call(this.db));
25
+ }
21
26
  async _prepare(sql) {
22
27
  const db = this.db;
23
28
  if (typeof db.prepare !== "undefined")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db-storage-sqlite",
3
- "version": "0.110.4",
3
+ "version": "0.110.5-alpha.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "A pure SQLite storage adapter for the ValtheraDB database library",
@@ -22,13 +22,13 @@
22
22
  "@types/better-sqlite3": "^7.6.13",
23
23
  "@types/bun": "*",
24
24
  "@types/node": "*",
25
- "@wxn0brp/db-core": "^0.11.0",
25
+ "@wxn0brp/db-core": "^0.11.1-alpha.2",
26
26
  "better-sqlite3": "^12.10.0",
27
27
  "tsc-alias": "^1",
28
28
  "typescript": "^6"
29
29
  },
30
30
  "peerDependencies": {
31
- "@wxn0brp/db-core": "^0.11.0",
31
+ "@wxn0brp/db-core": "^0.11.1-alpha.2",
32
32
  "better-sqlite3": "^12.10.0"
33
33
  },
34
34
  "peerDependenciesMeta": {