@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 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
 
@@ -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 = Promise.withResolvers();
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,6 @@
1
+ export interface PromiseWithResolvers<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: unknown) => void;
5
+ }
6
+ export declare function promiseWithResolvers<T = void>(): PromiseWithResolvers<T>;
@@ -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
+ }
@@ -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 = Promise.withResolvers();
6
+ const init = promiseWithResolvers();
6
7
  const { driver } = new SQLocalDrizzle({
7
8
  databasePath: url,
8
9
  onConnect: () => init.resolve(),
@@ -0,0 +1,6 @@
1
+ export interface PromiseWithResolvers<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: unknown) => void;
5
+ }
6
+ export declare function promiseWithResolvers<T = void>(): PromiseWithResolvers<T>;
@@ -0,0 +1,9 @@
1
+ export function promiseWithResolvers() {
2
+ let resolve;
3
+ let reject;
4
+ const promise = new Promise((res, rej) => {
5
+ resolve = res;
6
+ reject = rej;
7
+ });
8
+ return { promise, resolve, reject };
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/sqlite",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AIGNE SQLite database library for building AI-powered applications",
5
5
  "publishConfig": {
6
6
  "access": "public"