

Building for sqlcipherįor instructions for building sqlcipher see Visit the “ Using Node modules” article in the node-webkit's wiki for more details.

ia32 is needed to target 32bit node-webkit builds, while 圆4 will target 64bit node-webkit builds (if available for your platform).Īfter the sqlite3 package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa). You must provide the right -target_arch flag. You can also run this command from within a node-sqlite3 checkout: npm install -build-from-source -runtime=node-webkit -target_arch=ia32 -target=$(NODE_WEBKIT_VERSION) This command internally calls out to node-pre-gyp which itself calls out to nw-gyp when the -runtime=node-webkit option is passed. Npm install sqlite3 -build-from-source -runtime=node-webkit -target_arch=ia32 -target=$(NODE_WEBKIT_VERSION) NODE_WEBKIT_VERSION="0.8.6" # see latest version at Install nw-gyp globally: npm install nw-gyp -g (unless already installed)īuild the module with the custom flags of -runtime, -target_arch, and -target: Building for node-webkitīecause of ABI differences, sqlite3 must be built in a custom to be used with node-webkit. Note that the magic must be exactly 15 characters long (16 bytes including null terminator). npm install -build-from-source -sqlite_magic="M圜ustomMagic15"

You can specify a different magic, though this will make standard tools and libraries unable to work with your files. The default sqlite file header is "SQLite format 3". npmrc will be honoured: python=/usr/bin/python2 This uses the npm_config_python config, so values in. npm install -build-from-source -python=/usr/bin/python2 Aĭifferent python executable can be specified on the command line. Note, if building against homebrew-installed sqlite on OS X you can do: npm install -build-from-source -sqlite=/usr/local/opt/sqlite/īy default the node-gyp install will use python as part of the installation. Var stmt = db.prepare("INSERT INTO lorem VALUES (?)") Var db = new sqlite3.Database(':memory:') ĭb.run("CREATE TABLE lorem (info TEXT)") var sqlite3 = require('sqlite3').verbose() Note: the module must be installed before use. SQLite's SQLCipher extension is also supported. The sqlite3 module also works with node-webkit if node-webkit contains a supported version of Node.js engine.
