-
Notifications
You must be signed in to change notification settings - Fork 302
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
[question] NodeJS support #708
Comments
While it's something we'd like to do, our small team is currently focused on different tasks. Community volunteers could do this using ObjectBox C API; we'd definitely be supportive. |
Thanks a lot for answering! (should I keep this issue open to notify volunteers?) |
Yes, let's leave that open at least for reference and tracking user interest (give a 👍 at the top). |
Here's a crazy idea: transpile the ObjectBox C API, using Emscripten? And then store the data.mdb in window.localStorage? |
Update: so I was tinkering with transpiling objectbox-c to wasm/js: Prepare the toolset: #!/bin/bash
git clone https://github.com/emscripten-core/emsdk.git ; cd emsdk ; ./emsdk install latest ; ./emsdk activate latest ; source ./emsdk_env.sh
cd .. ; git clone https://github.com/objectbox/objectbox-c.git ; cd objectbox-c ; chmod +x download.sh ; ./download.sh Then you can experiment with the following: emcc -Werror -Llib -lobjectbox -Iinclude -Iexternal -o objectbox-js-test.html src-test/plain-c-test-main.c Update: My conclusion: until the source code for the core is made available, transpiling to wasm for nodeJS support seems unlikely to happen. Wrapping the objectbox-c API for your target language X seems to be the way to provide support for objectbox. Although, I was able to transpile the monster sample for flatcc to wasm. # set up emscripten if necessary
cd .. ; git clone https://github.com/dvidelabs/flatcc ; cd flatcc
# compile c and generate from fbs
cmake . ; make
# transpile samples/monster
emcc -Werror -Iinclude -Isamples/monster/generated -o flatcc-js-monster.html src/runtime/*.c samples/monster/monster.c Your express script to setup the correct var express = require('express');
var app = express();
express.static.mime.types['wasm'] = 'application/wasm';
app.use(express.static(__dirname + '/')); Direct your browser to Theoretically, provided that we have the correct offsets, schema, versioning etc. required to read from the buffer (based on a objectbox database), you could read an objectbox database from the browser/nodejs, using a transpiled a flatcc program. |
There are thousands of native libraries for node, how hard can it be? Why transpile? |
Interested in using this database on the web platform.. |
Transpile for the necessary plumbing to put / get data from storage, based on your schema. IIRC, there's some work done on objectbox-dart support for the web. Maybe you could call the generated objectbox related javascript from objectbox-dart, on node, without flutter? |
Hello.
Is there any plan to support NodeJS?
Thank you!
The text was updated successfully, but these errors were encountered: