mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 20:14:21 +01:00
This PR restructure JS packages and also adds support for OPFS for tursodatabase in browser. The new structure looks like this: 1. `@tursodatabase/database-common` - contains abstract JS code for bindings which depends only on `NativeDB` interface and not on the explicit native bindings 2. `@tursodatabase/database` - contains native bindings for the database and re-use `core` package 3. `@tursodatabase/database-browser` - contains bindings for browser (WASM + OPFS) As OPFS sync API (which is the most performant one in the web) works only in the web worker - this PR also make few operations async in order to run them as `napi-rs` AsyncTask. The following operations became async in `promise.ts` for node and browser: `pragma` / `exec` / `close`. Also, as few code pathes during initialization are non-async - they complicates integration of sync constructor in the browser with OPFS. So, right now - turso support only `connect` method for browser in non- memory mode. Closes #2927