@aigne/sqlite 0.4.3 → 0.4.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.4](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.4.4-beta...sqlite-v0.4.4) (2025-11-12)
4
+
5
+ ## [0.4.4-beta](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.4.3...sqlite-v0.4.4-beta) (2025-11-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **sqlite:** auto-create parent directories for file-based databases ([#727](https://github.com/AIGNE-io/aigne-framework/issues/727)) ([581789f](https://github.com/AIGNE-io/aigne-framework/commit/581789f38d838f53396e9e41ce9367a486319c53))
11
+
3
12
  ## [0.4.3](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.4.3-beta...sqlite-v0.4.3) (2025-10-19)
4
13
 
5
14
  ## [0.4.3-beta](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.4.2...sqlite-v0.4.3-beta) (2025-10-07)
@@ -15,12 +15,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.initDatabase = initDatabase;
18
+ const promises_1 = require("node:fs/promises");
19
+ const node_path_1 = require("node:path");
18
20
  const client_1 = require("@libsql/client");
19
21
  const libsql_1 = require("drizzle-orm/libsql");
20
22
  const retry_js_1 = require("./retry.js");
21
23
  __exportStar(require("./reexport.js"), exports);
22
24
  async function initDatabase({ url = ":memory:", wal = false, } = {}) {
23
25
  let db;
26
+ if (/^file:.*/.test(url)) {
27
+ const path = url.replace(/^file:(\/\/)?/, "");
28
+ await (0, promises_1.mkdir)((0, node_path_1.dirname)(path), { recursive: true });
29
+ }
24
30
  if (wal) {
25
31
  const client = (0, client_1.createClient)({ url });
26
32
  await client.execute(`\
@@ -1,9 +1,15 @@
1
+ import { mkdir } from "node:fs/promises";
2
+ import { dirname } from "node:path";
1
3
  import { createClient } from "@libsql/client";
2
4
  import { drizzle } from "drizzle-orm/libsql";
3
5
  import { withRetry } from "./retry.js";
4
6
  export * from "./reexport.js";
5
7
  export async function initDatabase({ url = ":memory:", wal = false, } = {}) {
6
8
  let db;
9
+ if (/^file:.*/.test(url)) {
10
+ const path = url.replace(/^file:(\/\/)?/, "");
11
+ await mkdir(dirname(path), { recursive: true });
12
+ }
7
13
  if (wal) {
8
14
  const client = createClient({ url });
9
15
  await client.execute(`\
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/sqlite",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "AIGNE SQLite database library for building AI-powered applications",
5
5
  "publishConfig": {
6
6
  "access": "public"