@tursodatabase/database-wasm-common 0.2.0-pre.11

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/README.md ADDED
@@ -0,0 +1,8 @@
1
+ ## About
2
+
3
+ This package is the Turso embedded database common JS library which is shared between final builds for Node and Browser.
4
+
5
+ Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-wasm`.
6
+
7
+ > **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now.
8
+
@@ -0,0 +1,40 @@
1
+ interface BrowserImports {
2
+ is_web_worker(): boolean;
3
+ lookup_file(ptr: number, len: number): number;
4
+ read(handle: number, ptr: number, len: number, offset: number): number;
5
+ read_async(handle: number, ptr: number, len: number, offset: number, c: number): any;
6
+ write(handle: number, ptr: number, len: number, offset: number): number;
7
+ write_async(handle: number, ptr: number, len: number, offset: number, c: number): any;
8
+ sync(handle: number): number;
9
+ sync_async(handle: number, c: number): any;
10
+ truncate(handle: number, len: number): number;
11
+ truncate_async(handle: number, len: number, c: number): any;
12
+ size(handle: number): number;
13
+ }
14
+ declare function mainImports(worker: Worker, completeOpfs: (c: any, r: any) => void): BrowserImports;
15
+ declare function workerImports(opfs: OpfsDirectory, memory: WebAssembly.Memory): BrowserImports;
16
+ declare class OpfsDirectory {
17
+ fileByPath: Map<String, {
18
+ handle: number;
19
+ sync: FileSystemSyncAccessHandle;
20
+ }>;
21
+ fileByHandle: Map<number, FileSystemSyncAccessHandle>;
22
+ fileHandleNo: number;
23
+ constructor();
24
+ registerFile(path: string): Promise<void>;
25
+ unregisterFile(path: string): Promise<void>;
26
+ lookupFileHandle(path: string): number | null;
27
+ read(handle: number, buffer: Uint8Array, offset: number): number;
28
+ write(handle: number, buffer: Uint8Array, offset: number): number;
29
+ sync(handle: number): number;
30
+ truncate(handle: number, size: number): number;
31
+ size(handle: number): number;
32
+ }
33
+ declare function waitForWorkerResponse(worker: Worker, id: number): Promise<any>;
34
+ declare function registerFileAtWorker(worker: Worker, path: string): Promise<void>;
35
+ declare function unregisterFileAtWorker(worker: Worker, path: string): Promise<void>;
36
+ declare function isWebWorker(): boolean;
37
+ declare function setupWebWorker(): void;
38
+ declare function setupMainThread(wasmFile: ArrayBuffer, factory: () => Worker): Promise<any>;
39
+ export { OpfsDirectory, workerImports, mainImports as MainDummyImports, waitForWorkerResponse, registerFileAtWorker, unregisterFileAtWorker, isWebWorker, setupWebWorker, setupMainThread };
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"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"}
package/dist/index.js ADDED
@@ -0,0 +1,424 @@
1
+ import { getDefaultContext as __emnapiGetDefaultContext, instantiateNapiModule as __emnapiInstantiateNapiModule, WASI as __WASI, instantiateNapiModuleSync, MessageHandler } from '@napi-rs/wasm-runtime';
2
+ function getUint8ArrayFromMemory(memory, ptr, len) {
3
+ ptr = ptr >>> 0;
4
+ return new Uint8Array(memory.buffer).subarray(ptr, ptr + len);
5
+ }
6
+ function getStringFromMemory(memory, ptr, len) {
7
+ const shared = getUint8ArrayFromMemory(memory, ptr, len);
8
+ const copy = new Uint8Array(shared.length);
9
+ copy.set(shared);
10
+ const decoder = new TextDecoder('utf-8');
11
+ return decoder.decode(copy);
12
+ }
13
+ function panicMain(name) {
14
+ throw new Error(`method ${name} must be invoked only from the worker thread`);
15
+ }
16
+ function panicWorker(name) {
17
+ throw new Error(`method ${name} must be invoked only from the main thread`);
18
+ }
19
+ function mainImports(worker, completeOpfs) {
20
+ return {
21
+ is_web_worker() {
22
+ return false;
23
+ },
24
+ write_async(handle, ptr, len, offset, c) {
25
+ writeFileAtWorker(worker, handle, ptr, len, offset)
26
+ .then(result => {
27
+ completeOpfs(c, result);
28
+ }, err => {
29
+ console.error('write_async', err);
30
+ completeOpfs(c, -1);
31
+ });
32
+ },
33
+ sync_async(handle, c) {
34
+ syncFileAtWorker(worker, handle)
35
+ .then(result => {
36
+ completeOpfs(c, result);
37
+ }, err => {
38
+ console.error('sync_async', err);
39
+ completeOpfs(c, -1);
40
+ });
41
+ },
42
+ read_async(handle, ptr, len, offset, c) {
43
+ readFileAtWorker(worker, handle, ptr, len, offset)
44
+ .then(result => {
45
+ completeOpfs(c, result);
46
+ }, err => {
47
+ console.error('read_async', err);
48
+ completeOpfs(c, -1);
49
+ });
50
+ },
51
+ truncate_async(handle, len, c) {
52
+ truncateFileAtWorker(worker, handle, len)
53
+ .then(result => {
54
+ completeOpfs(c, result);
55
+ }, err => {
56
+ console.error('truncate_async', err);
57
+ completeOpfs(c, -1);
58
+ });
59
+ },
60
+ lookup_file(ptr, len) {
61
+ panicMain("lookup_file");
62
+ },
63
+ read(handle, ptr, len, offset) {
64
+ panicMain("read");
65
+ },
66
+ write(handle, ptr, len, offset) {
67
+ panicMain("write");
68
+ },
69
+ sync(handle) {
70
+ panicMain("sync");
71
+ },
72
+ truncate(handle, len) {
73
+ panicMain("truncate");
74
+ },
75
+ size(handle) {
76
+ panicMain("size");
77
+ }
78
+ };
79
+ }
80
+ ;
81
+ function workerImports(opfs, memory) {
82
+ return {
83
+ is_web_worker() {
84
+ return true;
85
+ },
86
+ lookup_file(ptr, len) {
87
+ try {
88
+ const handle = opfs.lookupFileHandle(getStringFromMemory(memory, ptr, len));
89
+ return handle == null ? -404 : handle;
90
+ }
91
+ catch (e) {
92
+ return -1;
93
+ }
94
+ },
95
+ read(handle, ptr, len, offset) {
96
+ try {
97
+ return opfs.read(handle, getUint8ArrayFromMemory(memory, ptr, len), offset);
98
+ }
99
+ catch (e) {
100
+ return -1;
101
+ }
102
+ },
103
+ write(handle, ptr, len, offset) {
104
+ try {
105
+ return opfs.write(handle, getUint8ArrayFromMemory(memory, ptr, len), offset);
106
+ }
107
+ catch (e) {
108
+ return -1;
109
+ }
110
+ },
111
+ sync(handle) {
112
+ try {
113
+ return opfs.sync(handle);
114
+ }
115
+ catch (e) {
116
+ return -1;
117
+ }
118
+ },
119
+ truncate(handle, len) {
120
+ try {
121
+ opfs.truncate(handle, len);
122
+ return 0;
123
+ }
124
+ catch (e) {
125
+ return -1;
126
+ }
127
+ },
128
+ size(handle) {
129
+ try {
130
+ return opfs.size(handle);
131
+ }
132
+ catch (e) {
133
+ return -1;
134
+ }
135
+ },
136
+ read_async(handle, ptr, len, offset, completion) {
137
+ panicWorker("read_async");
138
+ },
139
+ write_async(handle, ptr, len, offset, completion) {
140
+ panicWorker("write_async");
141
+ },
142
+ sync_async(handle, completion) {
143
+ panicWorker("sync_async");
144
+ },
145
+ truncate_async(handle, len, c) {
146
+ panicWorker("truncate_async");
147
+ },
148
+ };
149
+ }
150
+ class OpfsDirectory {
151
+ fileByPath;
152
+ fileByHandle;
153
+ fileHandleNo;
154
+ constructor() {
155
+ this.fileByPath = new Map();
156
+ this.fileByHandle = new Map();
157
+ this.fileHandleNo = 0;
158
+ }
159
+ async registerFile(path) {
160
+ if (this.fileByPath.has(path)) {
161
+ return;
162
+ }
163
+ const opfsRoot = await navigator.storage.getDirectory();
164
+ const opfsHandle = await opfsRoot.getFileHandle(path, { create: true });
165
+ const opfsSync = await opfsHandle.createSyncAccessHandle();
166
+ this.fileHandleNo += 1;
167
+ this.fileByPath.set(path, { handle: this.fileHandleNo, sync: opfsSync });
168
+ this.fileByHandle.set(this.fileHandleNo, opfsSync);
169
+ }
170
+ async unregisterFile(path) {
171
+ const file = this.fileByPath.get(path);
172
+ if (file == null) {
173
+ return;
174
+ }
175
+ this.fileByPath.delete(path);
176
+ this.fileByHandle.delete(file.handle);
177
+ file.sync.close();
178
+ }
179
+ lookupFileHandle(path) {
180
+ try {
181
+ const file = this.fileByPath.get(path);
182
+ if (file == null) {
183
+ return null;
184
+ }
185
+ return file.handle;
186
+ }
187
+ catch (e) {
188
+ console.error('lookupFile', path, e);
189
+ throw e;
190
+ }
191
+ }
192
+ read(handle, buffer, offset) {
193
+ try {
194
+ const file = this.fileByHandle.get(handle);
195
+ const result = file.read(buffer, { at: Number(offset) });
196
+ return result;
197
+ }
198
+ catch (e) {
199
+ console.error('read', handle, buffer.length, offset, e);
200
+ throw e;
201
+ }
202
+ }
203
+ write(handle, buffer, offset) {
204
+ try {
205
+ const file = this.fileByHandle.get(handle);
206
+ const result = file.write(buffer, { at: Number(offset) });
207
+ return result;
208
+ }
209
+ catch (e) {
210
+ console.error('write', handle, buffer.length, offset, e);
211
+ throw e;
212
+ }
213
+ }
214
+ sync(handle) {
215
+ try {
216
+ const file = this.fileByHandle.get(handle);
217
+ file.flush();
218
+ return 0;
219
+ }
220
+ catch (e) {
221
+ console.error('sync', handle, e);
222
+ throw e;
223
+ }
224
+ }
225
+ truncate(handle, size) {
226
+ try {
227
+ const file = this.fileByHandle.get(handle);
228
+ file.truncate(size);
229
+ return 0;
230
+ }
231
+ catch (e) {
232
+ console.error('truncate', handle, size, e);
233
+ throw e;
234
+ }
235
+ }
236
+ size(handle) {
237
+ try {
238
+ const file = this.fileByHandle.get(handle);
239
+ const size = file.getSize();
240
+ return size;
241
+ }
242
+ catch (e) {
243
+ console.error('size', handle, e);
244
+ throw e;
245
+ }
246
+ }
247
+ }
248
+ let workerRequestId = 0;
249
+ function waitForWorkerResponse(worker, id) {
250
+ let waitResolve, waitReject;
251
+ const callback = msg => {
252
+ if (msg.data.__turso__ && msg.data.id == id) {
253
+ if (msg.data.error != null) {
254
+ waitReject(msg.data.error);
255
+ }
256
+ else {
257
+ waitResolve(msg.data.result);
258
+ }
259
+ cleanup();
260
+ }
261
+ };
262
+ const cleanup = () => worker.removeEventListener("message", callback);
263
+ worker.addEventListener("message", callback);
264
+ const result = new Promise((resolve, reject) => {
265
+ waitResolve = resolve;
266
+ waitReject = reject;
267
+ });
268
+ return result;
269
+ }
270
+ function readFileAtWorker(worker, handle, ptr, len, offset) {
271
+ workerRequestId += 1;
272
+ const currentId = workerRequestId;
273
+ const promise = waitForWorkerResponse(worker, currentId);
274
+ worker.postMessage({ __turso__: "read_async", handle: handle, ptr: ptr, len: len, offset: offset, id: currentId });
275
+ return promise;
276
+ }
277
+ function writeFileAtWorker(worker, handle, ptr, len, offset) {
278
+ workerRequestId += 1;
279
+ const currentId = workerRequestId;
280
+ const promise = waitForWorkerResponse(worker, currentId);
281
+ worker.postMessage({ __turso__: "write_async", handle: handle, ptr: ptr, len: len, offset: offset, id: currentId });
282
+ return promise;
283
+ }
284
+ function syncFileAtWorker(worker, handle) {
285
+ workerRequestId += 1;
286
+ const currentId = workerRequestId;
287
+ const promise = waitForWorkerResponse(worker, currentId);
288
+ worker.postMessage({ __turso__: "sync_async", handle: handle, id: currentId });
289
+ return promise;
290
+ }
291
+ function truncateFileAtWorker(worker, handle, len) {
292
+ workerRequestId += 1;
293
+ const currentId = workerRequestId;
294
+ const promise = waitForWorkerResponse(worker, currentId);
295
+ worker.postMessage({ __turso__: "truncate_async", handle: handle, len: len, id: currentId });
296
+ return promise;
297
+ }
298
+ function registerFileAtWorker(worker, path) {
299
+ workerRequestId += 1;
300
+ const currentId = workerRequestId;
301
+ const promise = waitForWorkerResponse(worker, currentId);
302
+ worker.postMessage({ __turso__: "register", path: path, id: currentId });
303
+ return promise;
304
+ }
305
+ function unregisterFileAtWorker(worker, path) {
306
+ workerRequestId += 1;
307
+ const currentId = workerRequestId;
308
+ const promise = waitForWorkerResponse(worker, currentId);
309
+ worker.postMessage({ __turso__: "unregister", path: path, id: currentId });
310
+ return promise;
311
+ }
312
+ function isWebWorker() {
313
+ return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;
314
+ }
315
+ function setupWebWorker() {
316
+ let opfs = new OpfsDirectory();
317
+ let memory = null;
318
+ const handler = new MessageHandler({
319
+ onLoad({ wasmModule, wasmMemory }) {
320
+ memory = wasmMemory;
321
+ const wasi = new __WASI({
322
+ print: function () {
323
+ // eslint-disable-next-line no-console
324
+ console.log.apply(console, arguments);
325
+ },
326
+ printErr: function () {
327
+ // eslint-disable-next-line no-console
328
+ console.error.apply(console, arguments);
329
+ },
330
+ });
331
+ return instantiateNapiModuleSync(wasmModule, {
332
+ childThread: true,
333
+ wasi,
334
+ overwriteImports(importObject) {
335
+ importObject.env = {
336
+ ...importObject.env,
337
+ ...importObject.napi,
338
+ ...importObject.emnapi,
339
+ ...workerImports(opfs, memory),
340
+ memory: wasmMemory,
341
+ };
342
+ },
343
+ });
344
+ },
345
+ });
346
+ globalThis.onmessage = async function (e) {
347
+ if (e.data.__turso__ == 'register') {
348
+ try {
349
+ await opfs.registerFile(e.data.path);
350
+ self.postMessage({ __turso__: true, id: e.data.id });
351
+ }
352
+ catch (error) {
353
+ self.postMessage({ __turso__: true, id: e.data.id, error: error });
354
+ }
355
+ return;
356
+ }
357
+ else if (e.data.__turso__ == 'unregister') {
358
+ try {
359
+ await opfs.unregisterFile(e.data.path);
360
+ self.postMessage({ __turso__: true, id: e.data.id });
361
+ }
362
+ catch (error) {
363
+ self.postMessage({ __turso__: true, id: e.data.id, error: error });
364
+ }
365
+ return;
366
+ }
367
+ else if (e.data.__turso__ == 'read_async') {
368
+ let result = opfs.read(e.data.handle, getUint8ArrayFromMemory(memory, e.data.ptr, e.data.len), e.data.offset);
369
+ self.postMessage({ __turso__: true, id: e.data.id, result: result });
370
+ }
371
+ else if (e.data.__turso__ == 'write_async') {
372
+ let result = opfs.write(e.data.handle, getUint8ArrayFromMemory(memory, e.data.ptr, e.data.len), e.data.offset);
373
+ self.postMessage({ __turso__: true, id: e.data.id, result: result });
374
+ }
375
+ else if (e.data.__turso__ == 'sync_async') {
376
+ let result = opfs.sync(e.data.handle);
377
+ self.postMessage({ __turso__: true, id: e.data.id, result: result });
378
+ }
379
+ else if (e.data.__turso__ == 'truncate_async') {
380
+ let result = opfs.truncate(e.data.handle, e.data.len);
381
+ self.postMessage({ __turso__: true, id: e.data.id, result: result });
382
+ }
383
+ handler.handle(e);
384
+ };
385
+ }
386
+ async function setupMainThread(wasmFile, factory) {
387
+ const worker = factory();
388
+ let completeOpfs = null;
389
+ const __emnapiContext = __emnapiGetDefaultContext();
390
+ const __wasi = new __WASI({
391
+ version: 'preview1',
392
+ });
393
+ const __sharedMemory = new WebAssembly.Memory({
394
+ initial: 4000,
395
+ maximum: 65536,
396
+ shared: true,
397
+ });
398
+ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule, } = await __emnapiInstantiateNapiModule(wasmFile, {
399
+ context: __emnapiContext,
400
+ asyncWorkPoolSize: 1,
401
+ wasi: __wasi,
402
+ onCreateWorker() { return worker; },
403
+ overwriteImports(importObject) {
404
+ importObject.env = {
405
+ ...importObject.env,
406
+ ...importObject.napi,
407
+ ...importObject.emnapi,
408
+ ...mainImports(worker, (c, res) => completeOpfs(c, res)),
409
+ memory: __sharedMemory,
410
+ };
411
+ return importObject;
412
+ },
413
+ beforeInit({ instance }) {
414
+ for (const name of Object.keys(instance.exports)) {
415
+ if (name.startsWith('__napi_register__')) {
416
+ instance.exports[name]();
417
+ }
418
+ }
419
+ },
420
+ });
421
+ completeOpfs = __napiModule.exports.completeOpfs;
422
+ return __napiModule;
423
+ }
424
+ export { OpfsDirectory, workerImports, mainImports as MainDummyImports, waitForWorkerResponse, registerFileAtWorker, unregisterFileAtWorker, isWebWorker, setupWebWorker, setupMainThread };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@tursodatabase/database-wasm-common",
3
+ "version": "0.2.0-pre.11",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/tursodatabase/turso"
7
+ },
8
+ "type": "module",
9
+ "license": "MIT",
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "packageManager": "yarn@4.9.2",
19
+ "files": [
20
+ "dist/**",
21
+ "README.md"
22
+ ],
23
+ "devDependencies": {
24
+ "typescript": "^5.9.2"
25
+ },
26
+ "scripts": {
27
+ "tsc-build": "npm exec tsc",
28
+ "build": "npm run tsc-build",
29
+ "test": "echo 'no tests'"
30
+ },
31
+ "dependencies": {
32
+ "@napi-rs/wasm-runtime": "^1.0.5"
33
+ }
34
+ }