@livestore/sqlite-wasm 0.0.0-snapshot-057a9e3a18ca69a310d4eb8cf35a34e94fa1841e → 0.0.0-snapshot-9d9745f6fc391ab1a695b44e8fad6c460c7b3b77
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/dist/.tsbuildinfo +1 -1
- package/dist/browser/mod.d.ts +2 -2
- package/dist/browser/mod.js +4 -4
- package/dist/browser/opfs/AccessHandlePoolVFS.d.ts +1 -1
- package/dist/browser/opfs/AccessHandlePoolVFS.js +1 -1
- package/dist/browser/opfs/index.d.ts +1 -1
- package/dist/browser/opfs/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index_.d.ts +1 -1
- package/dist/index_.js +1 -1
- package/dist/make-sqlite-db.js +1 -1
- package/dist/node/NodeFS.d.ts +1 -1
- package/dist/node/NodeFS.js +1 -1
- package/dist/node/mod.d.ts +1 -1
- package/dist/node/mod.js +3 -3
- package/package.json +7 -8
- package/src/browser/mod.ts +5 -5
- package/src/browser/opfs/AccessHandlePoolVFS.ts +1 -1
- package/src/browser/opfs/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/index_.ts +1 -1
- package/src/make-sqlite-db.ts +1 -1
- package/src/node/NodeFS.ts +1 -1
- package/src/node/mod.ts +3 -3
package/dist/browser/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MakeSqliteDb, PersistenceInfo, SqliteDb } from '@livestore/common';
|
|
2
2
|
import type { MemoryVFS } from '@livestore/wa-sqlite/src/examples/MemoryVFS.js';
|
|
3
|
-
import type { AccessHandlePoolVFS } from './opfs/AccessHandlePoolVFS.
|
|
4
|
-
export * from './opfs/opfs-sah-pool.
|
|
3
|
+
import type { AccessHandlePoolVFS } from './opfs/AccessHandlePoolVFS.ts';
|
|
4
|
+
export * from './opfs/opfs-sah-pool.ts';
|
|
5
5
|
export type WebDatabaseMetadataInMemory = {
|
|
6
6
|
_tag: 'in-memory';
|
|
7
7
|
vfs: MemoryVFS;
|
package/dist/browser/mod.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect, Hash } from '@livestore/utils/effect';
|
|
2
|
-
import { makeInMemoryDb } from
|
|
3
|
-
import { makeSqliteDb } from
|
|
4
|
-
import { makeOpfsDb } from
|
|
5
|
-
export * from
|
|
2
|
+
import { makeInMemoryDb } from "../in-memory-vfs.js";
|
|
3
|
+
import { makeSqliteDb } from "../make-sqlite-db.js";
|
|
4
|
+
import { makeOpfsDb } from "./opfs/index.js";
|
|
5
|
+
export * from "./opfs/opfs-sah-pool.js";
|
|
6
6
|
export const sqliteDbFactory = ({ sqlite3 }) => (input) => Effect.gen(function* () {
|
|
7
7
|
if (input._tag === 'in-memory') {
|
|
8
8
|
const { dbPointer, vfs } = makeInMemoryDb(sqlite3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from '@livestore/utils/effect';
|
|
2
|
-
import { FacadeVFS } from '../../FacadeVFS.
|
|
2
|
+
import { FacadeVFS } from '../../FacadeVFS.ts';
|
|
3
3
|
/**
|
|
4
4
|
* This VFS uses the updated Access Handle API with all synchronous methods
|
|
5
5
|
* on FileSystemSyncAccessHandle (instead of just read and write). It will
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schedule, Schema } from '@livestore/utils/effect';
|
|
2
2
|
// Based on https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/AccessHandlePoolVFS.js
|
|
3
3
|
import * as VFS from '@livestore/wa-sqlite/src/VFS.js';
|
|
4
|
-
import { FacadeVFS } from
|
|
4
|
+
import { FacadeVFS } from "../../FacadeVFS.js";
|
|
5
5
|
const SECTOR_SIZE = 4096;
|
|
6
6
|
// Each OPFS file begins with a fixed-size header with metadata. The
|
|
7
7
|
// contents of the file follow immediately after the header.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from '@livestore/utils/effect';
|
|
2
2
|
import type * as WaSqlite from '@livestore/wa-sqlite';
|
|
3
|
-
import { AccessHandlePoolVFS } from './AccessHandlePoolVFS.
|
|
3
|
+
import { AccessHandlePoolVFS } from './AccessHandlePoolVFS.ts';
|
|
4
4
|
export declare const makeOpfsDb: ({ sqlite3, directory, fileName, }: {
|
|
5
5
|
sqlite3: WaSqlite.SQLiteAPI;
|
|
6
6
|
directory: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from '@livestore/utils/effect';
|
|
2
|
-
import { AccessHandlePoolVFS } from
|
|
2
|
+
import { AccessHandlePoolVFS } from "./AccessHandlePoolVFS.js";
|
|
3
3
|
const semaphore = Effect.makeSemaphore(1).pipe(Effect.runSync);
|
|
4
4
|
const opfsVfsMap = new Map();
|
|
5
5
|
export const makeOpfsDb = ({ sqlite3, directory, fileName, }) => Effect.gen(function* () {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as WaSqlite from './index_.
|
|
1
|
+
export * as WaSqlite from './index_.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as WaSqlite from
|
|
1
|
+
export * as WaSqlite from "./index_.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index_.d.ts
CHANGED
package/dist/index_.js
CHANGED
package/dist/make-sqlite-db.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SqliteDbHelper, SqliteError } from '@livestore/common';
|
|
2
2
|
import { EventSequenceNumber } from '@livestore/common/schema';
|
|
3
3
|
import * as SqliteConstants from '@livestore/wa-sqlite/src/sqlite-constants.js';
|
|
4
|
-
import { makeInMemoryDb } from
|
|
4
|
+
import { makeInMemoryDb } from "./in-memory-vfs.js";
|
|
5
5
|
export const makeSqliteDb = ({ sqlite3, metadata, }) => {
|
|
6
6
|
const preparedStmts = [];
|
|
7
7
|
const { dbPointer } = metadata;
|
package/dist/node/NodeFS.d.ts
CHANGED
package/dist/node/NodeFS.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import * as VFS from '@livestore/wa-sqlite/src/VFS.js';
|
|
5
|
-
import { FacadeVFS } from
|
|
5
|
+
import { FacadeVFS } from "../FacadeVFS.js";
|
|
6
6
|
export class NodeFS extends FacadeVFS {
|
|
7
7
|
mapIdToFile = new Map();
|
|
8
8
|
lastError = null;
|
package/dist/node/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MakeSqliteDb, type PersistenceInfo, type SqliteDb } from '@livestore/common';
|
|
2
2
|
import { Effect, FileSystem } from '@livestore/utils/effect';
|
|
3
3
|
import type { MemoryVFS } from '@livestore/wa-sqlite/src/examples/MemoryVFS.js';
|
|
4
|
-
import { NodeFS } from './NodeFS.
|
|
4
|
+
import { NodeFS } from './NodeFS.ts';
|
|
5
5
|
export type NodeDatabaseMetadataInMemory = {
|
|
6
6
|
_tag: 'in-memory';
|
|
7
7
|
vfs: MemoryVFS;
|
package/dist/node/mod.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { UnexpectedError } from '@livestore/common';
|
|
3
3
|
import { Effect, FileSystem } from '@livestore/utils/effect';
|
|
4
|
-
import { makeInMemoryDb } from
|
|
5
|
-
import { makeSqliteDb } from
|
|
6
|
-
import { NodeFS } from
|
|
4
|
+
import { makeInMemoryDb } from "../in-memory-vfs.js";
|
|
5
|
+
import { makeSqliteDb } from "../make-sqlite-db.js";
|
|
6
|
+
import { NodeFS } from "./NodeFS.js";
|
|
7
7
|
export const sqliteDbFactory = ({ sqlite3, }) => Effect.andThen(FileSystem.FileSystem, (fs) => (input) => Effect.gen(function* () {
|
|
8
8
|
if (input._tag === 'in-memory') {
|
|
9
9
|
const { dbPointer, vfs } = makeInMemoryDb(sqlite3);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/sqlite-wasm",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-9d9745f6fc391ab1a695b44e8fad6c460c7b3b77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"types": "./dist/load-wasm/mod.browser.d.ts",
|
|
12
12
|
"browser": "./dist/load-wasm/mod.browser.js",
|
|
13
13
|
"worker": "./dist/load-wasm/mod.browser.js",
|
|
14
|
-
"
|
|
15
|
-
"default": "./dist/load-wasm/mod.browser.js"
|
|
14
|
+
"default": "./dist/load-wasm/mod.node.js"
|
|
16
15
|
},
|
|
17
16
|
"./node": {
|
|
18
17
|
"types": "./dist/node/mod.d.ts",
|
|
@@ -24,13 +23,13 @@
|
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
|
-
"@livestore/wa-sqlite": "1.0.5
|
|
28
|
-
"@livestore/common": "0.0.0-snapshot-
|
|
29
|
-
"@livestore/utils": "0.0.0-snapshot-
|
|
26
|
+
"@livestore/wa-sqlite": "1.0.5",
|
|
27
|
+
"@livestore/common": "0.0.0-snapshot-9d9745f6fc391ab1a695b44e8fad6c460c7b3b77",
|
|
28
|
+
"@livestore/utils": "0.0.0-snapshot-9d9745f6fc391ab1a695b44e8fad6c460c7b3b77"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@types/chrome": "^0.0
|
|
33
|
-
"@types/node": "
|
|
31
|
+
"@types/chrome": "^0.1.0",
|
|
32
|
+
"@types/node": "22.16.4",
|
|
34
33
|
"@types/wicg-file-system-access": "^2023.10.5"
|
|
35
34
|
},
|
|
36
35
|
"files": [
|
package/src/browser/mod.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { MakeSqliteDb, PersistenceInfo, SqliteDb } from '@livestore/common'
|
|
|
2
2
|
import { Effect, Hash } from '@livestore/utils/effect'
|
|
3
3
|
import type { MemoryVFS } from '@livestore/wa-sqlite/src/examples/MemoryVFS.js'
|
|
4
4
|
|
|
5
|
-
import { makeInMemoryDb } from '../in-memory-vfs.
|
|
6
|
-
import { makeSqliteDb } from '../make-sqlite-db.
|
|
7
|
-
import type { AccessHandlePoolVFS } from './opfs/AccessHandlePoolVFS.
|
|
8
|
-
import { makeOpfsDb } from './opfs/index.
|
|
5
|
+
import { makeInMemoryDb } from '../in-memory-vfs.ts'
|
|
6
|
+
import { makeSqliteDb } from '../make-sqlite-db.ts'
|
|
7
|
+
import type { AccessHandlePoolVFS } from './opfs/AccessHandlePoolVFS.ts'
|
|
8
|
+
import { makeOpfsDb } from './opfs/index.ts'
|
|
9
9
|
|
|
10
|
-
export * from './opfs/opfs-sah-pool.
|
|
10
|
+
export * from './opfs/opfs-sah-pool.ts'
|
|
11
11
|
|
|
12
12
|
export type WebDatabaseMetadataInMemory = {
|
|
13
13
|
_tag: 'in-memory'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schedule, Schema } from '@livestore/utils/effect'
|
|
2
2
|
// Based on https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/AccessHandlePoolVFS.js
|
|
3
3
|
import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
|
|
4
|
-
import { FacadeVFS } from '../../FacadeVFS.
|
|
4
|
+
import { FacadeVFS } from '../../FacadeVFS.ts'
|
|
5
5
|
|
|
6
6
|
const SECTOR_SIZE = 4096
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from '@livestore/utils/effect'
|
|
2
2
|
import type * as WaSqlite from '@livestore/wa-sqlite'
|
|
3
3
|
|
|
4
|
-
import { AccessHandlePoolVFS } from './AccessHandlePoolVFS.
|
|
4
|
+
import { AccessHandlePoolVFS } from './AccessHandlePoolVFS.ts'
|
|
5
5
|
|
|
6
6
|
const semaphore = Effect.makeSemaphore(1).pipe(Effect.runSync)
|
|
7
7
|
const opfsVfsMap = new Map<string, AccessHandlePoolVFS>()
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as WaSqlite from './index_.
|
|
1
|
+
export * as WaSqlite from './index_.ts'
|
package/src/index_.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from '@livestore/wa-sqlite'
|
|
2
|
-
export * from './make-sqlite-db.
|
|
2
|
+
export * from './make-sqlite-db.ts'
|
package/src/make-sqlite-db.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
import { SqliteDbHelper, SqliteError } from '@livestore/common'
|
|
9
9
|
import { EventSequenceNumber } from '@livestore/common/schema'
|
|
10
10
|
import * as SqliteConstants from '@livestore/wa-sqlite/src/sqlite-constants.js'
|
|
11
|
-
import { makeInMemoryDb } from './in-memory-vfs.
|
|
11
|
+
import { makeInMemoryDb } from './in-memory-vfs.ts'
|
|
12
12
|
|
|
13
13
|
export const makeSqliteDb = <
|
|
14
14
|
TMetadata extends {
|
package/src/node/NodeFS.ts
CHANGED
|
@@ -6,7 +6,7 @@ import path from 'node:path'
|
|
|
6
6
|
import type * as WaSqlite from '@livestore/wa-sqlite'
|
|
7
7
|
import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
|
|
8
8
|
|
|
9
|
-
import { FacadeVFS } from '../FacadeVFS.
|
|
9
|
+
import { FacadeVFS } from '../FacadeVFS.ts'
|
|
10
10
|
|
|
11
11
|
interface NodeFsFile {
|
|
12
12
|
pathname: string
|
package/src/node/mod.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { Effect, FileSystem } from '@livestore/utils/effect'
|
|
|
5
5
|
import type * as WaSqlite from '@livestore/wa-sqlite'
|
|
6
6
|
import type { MemoryVFS } from '@livestore/wa-sqlite/src/examples/MemoryVFS.js'
|
|
7
7
|
|
|
8
|
-
import { makeInMemoryDb } from '../in-memory-vfs.
|
|
9
|
-
import { makeSqliteDb } from '../make-sqlite-db.
|
|
10
|
-
import { NodeFS } from './NodeFS.
|
|
8
|
+
import { makeInMemoryDb } from '../in-memory-vfs.ts'
|
|
9
|
+
import { makeSqliteDb } from '../make-sqlite-db.ts'
|
|
10
|
+
import { NodeFS } from './NodeFS.ts'
|
|
11
11
|
|
|
12
12
|
export type NodeDatabaseMetadataInMemory = {
|
|
13
13
|
_tag: 'in-memory'
|