@aigne/sqlite 0.1.0 → 0.1.1
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 +7 -0
- package/lib/cjs/index.browser.js +2 -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/promise.d.ts +6 -0
- package/lib/esm/promise.js +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.1](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.1.0...sqlite-v0.1.1) (2025-06-05)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* compatible nodejs version >=20 ([#149](https://github.com/AIGNE-io/aigne-framework/issues/149)) ([d5ae9f2](https://github.com/AIGNE-io/aigne-framework/commit/d5ae9f245972e87e70fd87cdd960ade9940f288c))
|
9
|
+
|
3
10
|
## [0.1.0](https://github.com/AIGNE-io/aigne-framework/compare/sqlite-v0.0.1...sqlite-v0.1.0) (2025-05-29)
|
4
11
|
|
5
12
|
|
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(),
|
@@ -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(),
|