Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Node's filesystem for libsql-wasm #175

Open
penberg opened this issue Feb 6, 2024 · 5 comments
Open

Switch to Node's filesystem for libsql-wasm #175

penberg opened this issue Feb 6, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@penberg
Copy link
Contributor

penberg commented Feb 6, 2024

Suggested by Dominic Elm.

@penberg penberg added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 6, 2024
@d3lm
Copy link

d3lm commented Feb 6, 2024

Hey 👋 Thanks for creating this ticket. The reason I suggested to use the Node.js file system is because the db file would be persisted across reloads as it could be written to the host file system (the host here is WebContainer). AFAIK libsql was compiled via Emscripten so instead of using an in-memory file system there could be a version that uses Node's raw file system via NODERAWFS. This means nothing has to be mounted and it would directly use the Node FS.

@d3lm
Copy link

d3lm commented Feb 6, 2024

Or potentially, if this is meant to be used via Node.js always then maybe we can make it the default and if we wanted a browser version then we could publish a separate *-web package maybe.

@penberg
Copy link
Contributor Author

penberg commented Feb 20, 2024

I looked into this with @d3lm and we likely want a VFS implementation that uses Node filesystem API that we can plug into the SQLite/libSQL Wasm build.

@penberg
Copy link
Contributor Author

penberg commented Mar 4, 2024

Here's one implementation of the VFS approach for upstream SQLite: https://github.com/tndrle/node-sqlite3-wasm

@rphlmr
Copy link

rphlmr commented Apr 24, 2024

I am working on "Drizzle play" that relies on WebContainer. It would definitely help to have this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants