@evolu/web 1.0.1-preview.2 → 1.0.1-preview.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"WasmSqliteDriver.d.ts","sourceRoot":"","sources":["../src/WasmSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAGnB,MAAM,eAAe,CAAC;AAavB,eAAO,MAAM,sBAAsB,EAAE,kBA+DpC,CAAC"}
1
+ {"version":3,"file":"WasmSqliteDriver.d.ts","sourceRoot":"","sources":["../src/WasmSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAGnB,MAAM,eAAe,CAAC;AAavB,eAAO,MAAM,sBAAsB,EAAE,kBAsEpC,CAAC"}
@@ -8,10 +8,11 @@ globalThis.sqlite3ApiConfig = {
8
8
  };
9
9
  // Init ASAP.
10
10
  const sqlite3Promise = sqlite3InitModule();
11
- export const createWasmSqliteDriver = async (name) => {
11
+ export const createWasmSqliteDriver = async (name, options) => {
12
12
  const sqlite3 = await sqlite3Promise;
13
- const poolUtil = await sqlite3.installOpfsSAHPoolVfs({ name });
14
- const db = new poolUtil.OpfsSAHPoolDb("/evolu1.db");
13
+ const db = options?.memory
14
+ ? new sqlite3.oo1.DB(":memory:")
15
+ : new (await sqlite3.installOpfsSAHPoolVfs({ name })).OpfsSAHPoolDb("/evolu1.db");
15
16
  let isDisposed = false;
16
17
  const cache = createPreparedStatementsCache((sql) => db.prepare(sql), (statement) => {
17
18
  statement.finalize();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolu/web",
3
- "version": "1.0.1-preview.2",
3
+ "version": "1.0.1-preview.3",
4
4
  "description": "Evolu for web",
5
5
  "keywords": [
6
6
  "evolu",
@@ -35,11 +35,11 @@
35
35
  "typescript": "^5.8.3",
36
36
  "user-agent-data-types": "^0.4.2",
37
37
  "vitest": "^3.2.3",
38
- "@evolu/common": "6.0.1-preview.3",
38
+ "@evolu/common": "6.0.1-preview.10",
39
39
  "@evolu/tsconfig": "0.0.2"
40
40
  },
41
41
  "peerDependencies": {
42
- "@evolu/common": "^6.0.1-preview.3"
42
+ "@evolu/common": "^6.0.1-preview.10"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -17,10 +17,17 @@ globalThis.sqlite3ApiConfig = {
17
17
  // Init ASAP.
18
18
  const sqlite3Promise = sqlite3InitModule();
19
19
 
20
- export const createWasmSqliteDriver: CreateSqliteDriver = async (name) => {
20
+ export const createWasmSqliteDriver: CreateSqliteDriver = async (
21
+ name,
22
+ options,
23
+ ) => {
21
24
  const sqlite3 = await sqlite3Promise;
22
- const poolUtil = await sqlite3.installOpfsSAHPoolVfs({ name });
23
- const db = new poolUtil.OpfsSAHPoolDb("/evolu1.db");
25
+
26
+ const db = options?.memory
27
+ ? new sqlite3.oo1.DB(":memory:")
28
+ : new (await sqlite3.installOpfsSAHPoolVfs({ name })).OpfsSAHPoolDb(
29
+ "/evolu1.db",
30
+ );
24
31
  let isDisposed = false;
25
32
 
26
33
  const cache = createPreparedStatementsCache<PreparedStatement>(