Does Not Build on OS X
It does not build on OS X. I installed the latest Node.js using Homebrew.
Checked node-sqlite out of GitHub and ran the following.
[alan@postojna node-sqlite]$ node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /opt/Cellar/node/0.1.103
Checking for sqlite3 : not found
Checking for library sqlite3 : yes
'configure' finished successfully (0.419s)
Waf: Entering directory `/Users/alan/git/synapse/node-sqlite/build'
[1/4] cxx: src/sqlite3_bindings.cc -> build/default/src/sqlite3_bindings_1.o
[2/4] cxx: src/database.cc -> build/default/src/database_1.o
../src/database.h:95: error: ‘sqlite3_int64’ does not name a type
../src/database.h:95: error: ‘sqlite3_int64’ does not name a type
../src/database.cc: In static member function ‘static int Database::EIO_Open(eio_req*)’:
../src/database.cc:99: error: ‘SQLITE_OPEN_READWRITE’ was not declared in this scope
../src/database.cc:100: error: ‘SQLITE_OPEN_CREATE’ was not declared in this scope
../src/database.cc:101: error: ‘SQLITE_OPEN_FULLMUTEX’ was not declared in this scope
../src/database.cc:102: error: ‘sqlite3_open_v2’ was not declared in this scope
../src/database.cc: In static member function ‘static int Database::EIO_AfterPrepareAndStep(eio_req*)’:
../src/database.cc:274: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc: In static member function ‘static int Database::EIO_PrepareAndStep(eio_req*)’:
../src/database.cc:348: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc:353: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc: In static member function ‘static int Database::EIO_Prepare(eio_req*)’:
../src/database.cc:447: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc:452: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
Waf: Leaving directory `/Users/alan/git/synapse/node-sqlite/build'
Build failed:
-> task failed (err #1):
{task: cxx sqlite3_bindings.cc -> sqlite3_bindings_1.o}
-> task failed (err #1):
{task: cxx database.cc -> database_1.o}
I'm seeing the same issue on OS X version 10.5.8
Found a fix, in database.h change the line that reads #include <sqlite3.h> to #include "sqlite3.h"
This will change the include from using the standard include path to using the file "sqlite3.h" in the current working directory.
Then download the sqlite3 source files from http://www.sqlite.org/download.html and copy the sqlite3.h file into your /node-sqlite/src/ directory and re-run the configure/build command.
There should be a 'pound' symbol at the start of those include lines - GitHub Markdown turned my pounds into hr's
Even better, download the source files for sqlite, build and install from source. This will place sqlite in your /bin directory and make the headers available for the node-sqlite build.
Can't install this extension on Ubuntu Hardy, with same errors.
Yeah, trying to figure out where SQLite lives on different platforms is an annoying pain in the ass. Soon I will just ship the amalgamated SQLite source with node-sqlite and build it as a dependency.
On ubuntu, may be you can try to install the package libsqlite3-dev to ensure you have sqlite3.h available.