-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
atom-shell #357
Comments
Hi @daiyam were you able to get this working? I'm interested in doing this too. I'll let you know if I make any headway. |
I'm using a wrapper around sqlite3 like dblite without its bugs. |
I tried...
will give out
or
or
|
That's because the issue mapbox/node-pre-gyp#110 is not yet closed (in other words, because node-pre-gyp does not support Atom Shell as a target yet). |
I was curious about how Mapbox was using SQLite inside their Mapbox Studio app (an atom-shell application). It looks like they're still using atom-shell 0.16.x, which happened to define the node_ami version number as "16", which matches up with an available binary in node-pre-gyp. I don't fully understand the different versioning approaches used in node-pre-gyp. I'm not sure if 0.16.x is actually compatible or just happens to not fail. At any rate, it works and SQLite 3 is usable with atom-shell 0.16.x. For technical reasons we can't move our project back to atom-shell 0.16.x, and we're stuck with 0.19.x, which has node_ami = 18. @Mithgol, if there's anything I can do to help close that issue, let me know! |
Mapbox studio is not using atom shell and node-sqlite3 in the same process. The lack of binary compatibility with node was a major deterant. Because we have multiple node c++ addons and support multiple platforms having to provide 2x the binaries for atom-shell is not viable for us at this point. So Mapbox Studio is only using atom shell for the browser and not taking advantage of the ability to call into node modules. |
@bengotow You can help by adding a commit or two towards the final goal of mapbox/node-pre-gyp#112. |
You could also wait for PR #369 and then manually build with node-gyp
edit: corrected typo in snippet |
Thanks @bwin, @Mithgol - I looked into the changes that needed to be made and figured it'd be best to wait for folks with a deeper understanding of the V8 headers and versioning involved to update things. In the meantime, we've started using the (deprecated) WebSQL API in Chromium. It's surprisingly performant (simple indexed SELECT queries in 1-2msec), and good enough for us to build on top of until the dust settles a bit with all this stuff. Thanks for the help - we'll be rolling onto node-sqlite3 as soon as we can! |
I just wanted to chime in and say it would be super awesome if this worked with atom-shell out of the box! |
Thanks @maxogden! - mapbox/node-pre-gyp#112 is on my radar. |
I was able to get sqlite3 working with Electron after install with the following. Note that the version numbers are hard-coded into the arguments which are Electron 0.27.1 and v43 (by the way anybody know where 43 come from? It seems to refer to modules versioning that is related to the version of Electron, but I can't find any translation of these numbers - the only way to find it is to just let your app throw an error and see what the foldername is that it's looking for.) cd node_modules/sqlite3
npm run prepublish
node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/node-v43-darwin-x64
node-gyp rebuild --target=0.27.1 --arch=x64 --target_platform=darwin --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/node-v43-darwin-x64 |
43 is the NODE_MODULE_VERSION which is similar to the ABI version, node, iojs and electron all have their non-overlapping own version ranges that they increment whenever the native API changes. I don't think this is written down anywhere (i've been trying to get core people to document it) |
Gonna also throw in my hat. Would love to see this work out of the box. I can confirm that @jasonhinkle's solution does work. I still haven't tried with ASPM as documented here. I tried with |
For anyone having same issue: http://verysimple.com/2015/05/30/using-node_sqlite3-with-electron/ |
@olimsaidov Nice! I should have written something up myself. I have the exact same process going on Delicious. Works perfectly. Pretty much the same process for compiling any native lib, other dbs included. |
Lots of these have the word "darwin" in them (and aren't working for me), are they mac-specific? |
@thefinn93 Yes. You need to specify which platform you are targeting. I haven't built for other platforms just yet, so I'm not entirely sure what options you need to change. |
The target_platform and target_arch need to be changed for your environment - the options can be found at https://www.npmjs.com/package/node-pre-gyp |
Refs mapbox/node-pre-gyp#175. |
@zcbenz - thank you for mapbox/node-pre-gyp#175 - it is now merged and part of node-pre-gyp v0.6.12. Would it be possible for you to create a pull that starts building binaries for electron on travis? |
Hi,
How can I compile node-sqlite3 for atom-shell? I want to use it in the web-page side to avoid any unnecessary ipc call.
Thx
The text was updated successfully, but these errors were encountered: