-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
persistent file storage with NODEFS #92
Comments
Any reason this issue has languished? This description makes it look like an easy fix to add the filesystem type to the constructor, and maybe a few branch points at critical locations. So I'm wondering if there's hidden complexity that I'm not aware of. I'm fairly new to Emscripten. Was hoping to leverage Spatiasql in a locally-running PWA, hosting databases several GB in size. The users of this app would know that they'd likely be working with large data, so that isn't the issue, but memory use is. I'd wanted to use the browser, its UI, and its geospatial/other capabilities as a cross-platform runtime, in situations where the user may not have a solid internet connection. For the moment I'll investigate something else, but the trend really does seem to be toward the web in some form or another. Thanks. |
A pull request is always welcome! |
Undoubtedly, but that isn't what I asked. As someone new to Emscripten,
I was wondering if there was some complication that prevented this from
being done. I may indeed submit a PR, but if IDFS is horribly slow or
inefficient, or there's some other reason that this wouldn't work, then
I'd rather not spin my wheels to no effect.
Thanks.
|
@ndarilek I believe the largest obstacle to this issue remains the same as many of the features or improvements we'd love to make, it's less about it being possible and more about the time required. That said, there's nothing that would prevent this project from using NODEFS, Emscripten or not. It would just take time and effort to get it integrated. |
Thanks. In thinking about it more, I wonder if I've misunderstood the
scope of this project, and if I even need it.
I'm trying to access SQLite from Rust compiled to wasm. I initially
thought this project was like the JS equivalents of OpenAL/OpenGL and
friends, presenting a SQLite-like interface to both JS and wasm, but I'm
learning a lot about the Emscripten ecosystem and think I've misunderstood.
If my aim is to use SQLite via wasm, I'm guessing there's no reason I
can't just compile it plus my needed extensions with the Emscripten
toolchain, mount an IDFS directory like /data via the JS that bootstraps
my code, then create databases in paths under /data like normal? Is that
accurate?
|
Yes, that sounds entirely accurate |
To allow persistent file storage with NODEFS, and real time update of a SQLITE file instead of loading the whole thing at startup and writing it down using export, I had to changed the class constructor, the close function and debug an issue related to emscriten :
api.coffee : temporary random filename replaced by NODEFS mount relative filename
Makefile: modified to ensure closure don't break NODEFS
optimized: EMFLAGS= --memory-init-file 0 --closure 0 -O3 -s INLINING_LIMIT=50
emscripten / src / library_nodefs.js : modified to avoid file "DeleteOnClose" bug under windows
Perhaps the constructor could take an optional argument to specify witch file system to use (MEMFS / NODEFS / IDBFS / ...
The text was updated successfully, but these errors were encountered: