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

[WIP]Add support for NODEFS #439

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

[WIP]Add support for NODEFS #439

wants to merge 11 commits into from

Conversation

fanthos
Copy link

@fanthos fanthos commented Mar 1, 2021

Export FS to outer module to allow custom mount filesystem.
Link and export NODEFS to allow mount NODEFS on emscripten virtual fs.

@fanthos fanthos changed the title Add nodefs to Makefile Add support for NODEFS Mar 1, 2021
@fanthos fanthos changed the title Add support for NODEFS [WIP]Add support for NODEFS Mar 1, 2021
@fanthos fanthos changed the title [WIP]Add support for NODEFS Add support for NODEFS Mar 1, 2021
@lovasoa
Copy link
Member

lovasoa commented Mar 1, 2021

May I ask what exactly is your use case for sql.js on node.js ? sql.js is slower, more limited, and uses more memory than a native sqlite. If you are working on both node and the browser, I would suggest writing a small abstraction layer that can talk to either native SQLite or sql.js depending on the platform. There isn't really any point in running sql.js on node.

@fanthos fanthos changed the title Add support for NODEFS [WIP]Add support for NODEFS Mar 1, 2021
@fanthos
Copy link
Author

fanthos commented Mar 1, 2021

I have a project running nodejs on different processor and operating system, including MIPS and x86, so making code portable might be helpful for this.
Currently the tests passed on debug mode.

@lovasoa
Copy link
Member

lovasoa commented Mar 1, 2021

SQLite is an extremely portable piece of software. It should work without issue on almost any architecture. Especially if you plan to run on less powerful hardware, I would encourage you to use a native solution.

@fanthos
Copy link
Author

fanthos commented Mar 1, 2021

The code works good without Closure Compiler, but I have no idea how Closure Compiler breaks it.

@fanthos
Copy link
Author

fanthos commented Mar 2, 2021

Compressing sql-asm-debug.js with uglify-js -m option result a 2,493kb file and all tests passed.

@davidvedvick
Copy link

Please consider this change again! One benefit of this capability is that if you're on a shared host your host can upgrade the underlying NodeJS version without you having to recompile SQLite bindings. Right now I need to re-build my SQLite packages when NearlyFreeSpeech.NET moves to the next NodeJS LTS version. If I'm not on my toes, my site could be down for some time (obviously, this is not mission critical for me, but could be for others).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants