@aigne/sqlite 0.1.0 → 0.3.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/CHANGELOG.md +21 -0
- package/lib/cjs/index.browser.js +2 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.node.d.ts +1 -1
- package/lib/cjs/index.node.js +7 -1
- package/lib/cjs/promise.d.ts +6 -0
- package/lib/cjs/promise.js +12 -0
- package/lib/esm/index.browser.js +2 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.node.d.ts +1 -1
- package/lib/esm/index.node.js +7 -1
- package/lib/esm/promise.d.ts +6 -0
- package/lib/esm/promise.js +9 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.3.0](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.2.0...sqlite-v0.3.0) (2025-07-04)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* **core:** add standard userId/sessionId in userContext ([#219](https://github.com/AIGNE-io/aigne-framework/issues/219)) ([58e5804](https://github.com/AIGNE-io/aigne-framework/commit/58e5804cf08b1d2fa6e232646fadd70b5db2e007))
|
9
|
+
|
10
|
+
## [0.2.0](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.1.1...sqlite-v0.2.0) (2025-07-03)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* upgrade dependencies and adapt code to breaking changes ([#216](https://github.com/AIGNE-io/aigne-framework/issues/216)) ([f215ced](https://github.com/AIGNE-io/aigne-framework/commit/f215cedc1a57e321164064c33316e496eae8d25f))
|
16
|
+
|
17
|
+
## [0.1.1](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.1.0...sqlite-v0.1.1) (2025-06-05)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* compatible nodejs version >=20 ([#149](https://github.com/AIGNE-io/aigne-framework/issues/149)) ([d5ae9f2](https://github.com/AIGNE-io/aigne-framework/commit/d5ae9f245972e87e70fd87cdd960ade9940f288c))
|
23
|
+
|
3
24
|
## [0.1.0](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.0.1...sqlite-v0.1.0) (2025-05-29)
|
4
25
|
|
5
26
|
|
package/lib/cjs/index.browser.js
CHANGED
@@ -4,8 +4,9 @@ exports.initDatabase = initDatabase;
|
|
4
4
|
const sqlite_proxy_1 = require("drizzle-orm/sqlite-proxy");
|
5
5
|
// @ts-ignore sqlocal does not support commonjs, but we can use it in the browser with ESM module
|
6
6
|
const drizzle_1 = require("sqlocal/drizzle");
|
7
|
+
const promise_js_1 = require("./promise.js");
|
7
8
|
async function initDatabase({ url = ":memory:", } = {}) {
|
8
|
-
const init =
|
9
|
+
const init = (0, promise_js_1.promiseWithResolvers)();
|
9
10
|
const { driver } = new drizzle_1.SQLocalDrizzle({
|
10
11
|
databasePath: url,
|
11
12
|
onConnect: () => init.resolve(),
|
package/lib/cjs/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export interface InitDatabaseOptions {
|
2
2
|
url?: string;
|
3
|
+
wal?: boolean;
|
3
4
|
}
|
4
5
|
export declare function initDatabase(options?: InitDatabaseOptions): Promise<import("drizzle-orm/libsql/driver-core.js").LibSQLDatabase<Record<string, never>> | import("drizzle-orm/sqlite-proxy/driver.js").SqliteRemoteDatabase<Record<string, never>>>;
|
package/lib/cjs/index.node.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type LibSQLDatabase } from "drizzle-orm/libsql";
|
2
2
|
import type { InitDatabaseOptions } from "./index.js";
|
3
|
-
export declare function initDatabase({ url, }?: InitDatabaseOptions): Promise<LibSQLDatabase>;
|
3
|
+
export declare function initDatabase({ url, wal, }?: InitDatabaseOptions): Promise<LibSQLDatabase>;
|
package/lib/cjs/index.node.js
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.initDatabase = initDatabase;
|
4
|
+
const client_1 = require("@libsql/client");
|
4
5
|
const libsql_1 = require("drizzle-orm/libsql");
|
5
|
-
async function initDatabase({ url = ":memory:", } = {}) {
|
6
|
+
async function initDatabase({ url = ":memory:", wal = false, } = {}) {
|
7
|
+
if (wal) {
|
8
|
+
const client = (0, client_1.createClient)({ url });
|
9
|
+
await client.execute("PRAGMA journal_mode=WAL;");
|
10
|
+
return (0, libsql_1.drizzle)(client);
|
11
|
+
}
|
6
12
|
return (0, libsql_1.drizzle)(url);
|
7
13
|
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.promiseWithResolvers = promiseWithResolvers;
|
4
|
+
function promiseWithResolvers() {
|
5
|
+
let resolve;
|
6
|
+
let reject;
|
7
|
+
const promise = new Promise((res, rej) => {
|
8
|
+
resolve = res;
|
9
|
+
reject = rej;
|
10
|
+
});
|
11
|
+
return { promise, resolve, reject };
|
12
|
+
}
|
package/lib/esm/index.browser.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
import { drizzle } from "drizzle-orm/sqlite-proxy";
|
2
2
|
// @ts-ignore sqlocal does not support commonjs, but we can use it in the browser with ESM module
|
3
3
|
import { SQLocalDrizzle } from "sqlocal/drizzle";
|
4
|
+
import { promiseWithResolvers } from "./promise.js";
|
4
5
|
export async function initDatabase({ url = ":memory:", } = {}) {
|
5
|
-
const init =
|
6
|
+
const init = promiseWithResolvers();
|
6
7
|
const { driver } = new SQLocalDrizzle({
|
7
8
|
databasePath: url,
|
8
9
|
onConnect: () => init.resolve(),
|
package/lib/esm/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export interface InitDatabaseOptions {
|
2
2
|
url?: string;
|
3
|
+
wal?: boolean;
|
3
4
|
}
|
4
5
|
export declare function initDatabase(options?: InitDatabaseOptions): Promise<import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>> | import("drizzle-orm/sqlite-proxy").SqliteRemoteDatabase<Record<string, never>>>;
|
package/lib/esm/index.node.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type LibSQLDatabase } from "drizzle-orm/libsql";
|
2
2
|
import type { InitDatabaseOptions } from "./index.js";
|
3
|
-
export declare function initDatabase({ url, }?: InitDatabaseOptions): Promise<LibSQLDatabase>;
|
3
|
+
export declare function initDatabase({ url, wal, }?: InitDatabaseOptions): Promise<LibSQLDatabase>;
|
package/lib/esm/index.node.js
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
+
import { createClient } from "@libsql/client";
|
1
2
|
import { drizzle } from "drizzle-orm/libsql";
|
2
|
-
export async function initDatabase({ url = ":memory:", } = {}) {
|
3
|
+
export async function initDatabase({ url = ":memory:", wal = false, } = {}) {
|
4
|
+
if (wal) {
|
5
|
+
const client = createClient({ url });
|
6
|
+
await client.execute("PRAGMA journal_mode=WAL;");
|
7
|
+
return drizzle(client);
|
8
|
+
}
|
3
9
|
return drizzle(url);
|
4
10
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aigne/sqlite",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"description": "AIGNE SQLite database library for building AI-powered applications",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -45,13 +45,13 @@
|
|
45
45
|
}
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"@libsql/client": "^0.15.
|
49
|
-
"drizzle-orm": "^0.
|
48
|
+
"@libsql/client": "^0.15.9",
|
49
|
+
"drizzle-orm": "^0.44.2",
|
50
50
|
"sqlocal": "^0.14.1"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
|
-
"@types/bun": "^1.2.
|
54
|
-
"@types/node": "^
|
53
|
+
"@types/bun": "^1.2.17",
|
54
|
+
"@types/node": "^24.0.10",
|
55
55
|
"npm-run-all": "^4.1.5",
|
56
56
|
"rimraf": "^6.0.1",
|
57
57
|
"typescript": "^5.8.3"
|