Coder Social home page Coder Social logo

tryghost / node-sqlite3 Goto Github PK

View Code? Open in Web Editor NEW
6.1K 190.0 795.0 89.79 MB

SQLite3 bindings for Node.js

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.20% PLpgSQL 70.95% JavaScript 14.48% C++ 13.86% C 0.17% HTML 0.03% Python 0.23% Dockerfile 0.08%

node-sqlite3's People

Contributors

alexanderfloh avatar bnoordhuis avatar bruce-one avatar daniellockyer avatar erisds avatar gms1 avatar grumdrig avatar jschlight avatar kewde avatar kkaefer avatar kkoopa avatar lvivier avatar mapsam avatar mithgol avatar mohd-akram avatar mscdex avatar mtgto avatar orlandov avatar renovate[bot] avatar rhansen avatar ry avatar rzr avatar springmeyer avatar tmcw avatar tomhughes avatar tootallnate avatar tsufeki avatar wilhelmberg avatar wrynearson avatar yhahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-sqlite3's Issues

Installation with npm fails, again...

[email protected] preinstall /root/node_modules/sqlite3
node-waf clean || true; node-waf configure build

Nothing to clean (project not configured)
Setting srcdir to : /root/node_modules/sqlite3
Setting blddir to : /root/node_modules/sqlite3/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 /root/local/node
Checking for program pkg-config : /usr/bin/pkg-config
Checking for sqlite3 : yes
'configure' finished successfully (0.055s)
Waf: Entering directory /root/node_modules/sqlite3/build' [1/4] cxx: src/sqlite3.cc -> build/default/src/sqlite3_1.o [2/4] cxx: src/database.cc -> build/default/src/database_1.o ../src/database.cc: In static member function 'static v8::Handle<v8::Value> node_sqlite3::Database::New(const v8::Arguments&)': ../src/database.cc:134: error: 'SQLITE_OPEN_FULLMUTEX' was not declared in this scope Waf: Leaving directory/root/node_modules/sqlite3/build'
Build failed: -> task failed (err #1):
{task: cxx database.cc -> database_1.o}
npm ERR! error installing [email protected] Error: [email protected] preinstall: node-waf clean || true; node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/root/local/node/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] preinstall: node-waf clean || true; node-waf configure build
npm ERR! sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.26-2-amd64
npm ERR! command "node" "/root/local/node/bin/npm" "install" "sqlite3"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok

I have tried the audriusk@d19cfaf changeset also (previous thread #25) but same message...

documentation: 'make test' should not be run on a globally installed 'sqlite3' module

It appears that the test for opening an inaccessible database -- which should fail -- will in fact itself fail ** on a global install ** because the test of inaccesibility is based on an assumption that /usr/bin is unwritable. That's a good assumption for joe user. But suppose you wanted to test the globally installed instance of module 'sqlite3' in place -- then you'd have to be logged in as root, in which case /usr/bin/ will be writable!

Moreover, if you make the mistake of trying to 'make test' as root, then /usr/bin/test.db will be created and must be deleted before running 'make test' as joe user.

failing tests on ubuntu karmic

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.10
Release:    9.10
Codename:   karmic

dane@haiti:~/src/node-sqlite3$ ./node_modules/expresso/bin/expresso 

   uncaught undefined: Error: SQLITE_ERROR: no such table: foo


   uncaught undefined: AssertionError:  == 0
    at /home/dane/src/node-sqlite3/test/each.test.js:34:16
    at Statement.<anonymous> (/home/dane/src/node-sqlite3/lib/sqlite3.js:11:41)




^C
   parallel_insert.test.js test parallel inserts: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/parallel_insert.test.js:34:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   each.test.js test Statement#each: AssertionError: Only retrieved 0 out of 100000 rows.
    at /home/dane/src/node-sqlite3/test/each.test.js:19:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   each.test.js test Statement#each with complete callback: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/each.test.js:39:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   unicode.test.js test unicode characters: AssertionError: 487 == 3
    at /home/dane/src/node-sqlite3/test/unicode.test.js:50:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   map.test.js test Database#map() with two columns: AssertionError: 5 == 3
    at /home/dane/src/node-sqlite3/test/map.test.js:33:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   map.test.js test Database#map() with three columns: AssertionError: 5 == 2
    at /home/dane/src/node-sqlite3/test/map.test.js:71:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   prepare.test.js test inserting and retrieving rows: AssertionError: Didn't retrieve all rows
    at /home/dane/src/node-sqlite3/test/prepare.test.js:100:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   prepare.test.js test retrieving reset() function: AssertionError: Didn't retrieve all rows
    at /home/dane/src/node-sqlite3/test/prepare.test.js:132:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   prepare.test.js test multiple get() parameter binding: AssertionError: Didn't retrieve all rows
    at /home/dane/src/node-sqlite3/test/prepare.test.js:164:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   prepare.test.js test Database#run() and Database#all(): AssertionError: Didn't retrieve all rows
    at /home/dane/src/node-sqlite3/test/prepare.test.js:404:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   rerun.test.js test running the same statement multiple times: AssertionError: 5 == 2
    at /home/dane/src/node-sqlite3/test/rerun.test.js:40:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   named_columns.test.js test named columns: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/named_columns.test.js:31:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   open_close.test.js test closing with open statements: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/open_close.test.js:126:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   null_error.test.js test SQLITE_OK error: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/null_error.test.js:31:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   blob.test.js blob test: AssertionError: 10 == 1
    at /home/dane/src/node-sqlite3/test/blob.test.js:47:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   affected.test.js test row changes and lastID: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/affected.test.js:32:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   named_params.test.js test named parameters: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/named_params.test.js:58:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   serialization.test.js test serialize() and parallelize(): AssertionError: Didn't insert all rows
    at /home/dane/src/node-sqlite3/test/serialization.test.js:48:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   serialization.test.js test serialize(fn): AssertionError: Didn't insert all rows
    at /home/dane/src/node-sqlite3/test/serialization.test.js:84:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   other_objects.test.js test Date() and RegExp() serialization: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/other_objects.test.js:24:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   other_objects.test.js test large floats: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/other_objects.test.js:68:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   other_objects.test.js test large integers: AssertionError: true == false
    at /home/dane/src/node-sqlite3/test/other_objects.test.js:110:16
    at Test.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:961:13)
    at Test.emit (events.js:39:17)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:892:18)
    at EventEmitter.<anonymous> (events.js:59:20)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1053:10)
    at report (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:992:13)
    at EventEmitter.emit (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1050:9)
    at EventEmitter.exit (node.js:192:15)
    at EventEmitter.<anonymous> (/home/dane/src/node-sqlite3/node_modules/expresso/bin/expresso:1039:17)


   Failures: 24

build with node 0.5.5 error

Hello,

When I tried to compile sqlite3 module with node 0.5.5 i get error around eio_custom.
I resolved this by change return type of calback in database and statement files (h and cc).

The problem remain when i try to use the compiled module.

found steps which should be done.
https://groups.google.com/group/nodejs/browse_thread/thread/ae6bc0e37e2edc39

Who will done this?
I can do this and test.
Please keep me about this.
It is important to have sqlite3 module in the latest node.

Creating tables using substitution

I would like to create tables based on variable names. When i run the command and try to use substitution for the table name, I get the following error:

db.run("CREATE TABLE $sessions ( session_id int primary key,
...

events.js:45
throw arguments[1]; // Unhandled 'error' event
^
Error: SQLITE_ERROR: near "$sessions": syntax error

Using substitution for the value fields when writing to the database works great. It is just the table name that is giving me problems. If this is not supported, do you have any recommendations on how to achieve this?

node path not found

Hi

I keep getting a warning when trying to build the node-sqlite3 library (Checking for node path : not found ). I have all the dependencies and node is working correctly. Searching for a solution to this problem did not provide any answers.

node version is v0.5.0-pre

Could someone please help with this issue?

Thanks

Error: SQLITE_BUSY: unable to close due to unfinalised statements

FWIW using node from master (0.5pre) and gcc 4.5.2. I couldn't do the tests because the first test used 2Gb of swap and I had to kill it after 15 mins.

~ node db-test.js
1: Ipsum 0
2: Ipsum 1
3: Ipsum 2
4: Ipsum 3
5: Ipsum 4
6: Ipsum 5
7: Ipsum 6
8: Ipsum 7
9: Ipsum 8
10: Ipsum 9

events.js:45
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: SQLITE_BUSY: unable to close due to unfinalised statements

Path not found

Hi sorry for opening this issue again, but I believe the issue is not resolved as indicated below.

The indication might be that it was a successful build but the reason for this issue was that when trying to do require("sqlite3") it fails with:

steven@steven-TravelMate-5742 ~/dev/texviewer $ node index.js

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'sqlite3'
at Function._resolveFilename (module.js:322:11)
at Function._load (module.js:267:25)
at require (module.js:351:19)
at Object. (/home/steven/dev/texviewer/texserver.js:7:14)
at Module._compile (module.js:407:26)
at Object..js (module.js:413:10)
at Module.load (module.js:339:31)
at Function._load (module.js:298:12)
at require (module.js:351:19)
at Object. (/home/steven/dev/texviewer/index.js:4:17)

Source:
var http = require("http");
var url = require("url");
var sqlite = require("sqlite3");

function startServer(route){

"node npm install sqlite3" fails

> node npm install sqlite3

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm ERR! Error: EFAULT, Bad address
npm ERR! at doConnect (net.js:553:5)
npm ERR! at net.js:723:9
npm ERR! at dns.js:196:34
npm ERR! at IOWatcher.callback (dns.js:74:15)
npm ERR! Report this entire log at http://github.com/isaacs/npm/issues
npm ERR! or email it to [email protected]
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm ERR! System CYGWIN_NT-6.1-WOW64 1.7.9(0.237/5/3)
npm ERR! argv { remain: [ 'sqlite3' ],
npm ERR! argv cooked: [ 'install', 'sqlite3' ],
npm ERR! argv original: [ 'install', 'sqlite3' ] }
npm not ok

check for libsqlite3 during configure

As we know most systems will have sqlite, but turns out RHEL 5.5 does not by default, at least not on any reasonable path.

So, you get:

[dane@linux_wms_bm node-sqlite3]$ ./configure 
Setting srcdir to                        : /opt/mapnik/src/node-sqlite3 
Setting blddir to                        : /opt/mapnik/src/node-sqlite3/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/mapnik 
Checking for library sqlite3             : yes 
'configure' finished successfully (0.499s)
[dane@linux_wms_bm node-sqlite3]$ make
node-waf build
Waf: Entering directory `/opt/mapnik/src/node-sqlite3/build'
[1/4] cxx: src/sqlite3.cc -> build/default/src/sqlite3_1.o
[2/4] cxx: src/database.cc -> build/default/src/database_1.o
[3/4] cxx: src/statement.cc -> build/default/src/statement_1.o
../src/database.h:83: error: ‘sqlite3_int64’ does not name a type
../src/database.h:90: error: ‘sqlite3_int64’ does not name a type
../src/database.h:83: error: ‘sqlite3_int64’ does not name a type
../src/database.h:90: error: ‘sqlite3_int64’ does not name a type
../src/database.h:157: error: ‘sqlite3_uint64’ has not been declared
../src/database.h:161: error: ‘sqlite3_int64’ has not been declared
../src/database.h:157: error: ‘sqlite3_uint64’ has not been declared
....

'npm install sqlite3' fails on Debian Squeeze

[1/4] cxx: src/sqlite3.cc -> build/default/src/sqlite3_1.o
[2/4] cxx: src/database.cc -> build/default/src/database_1.o
[3/4] cxx: src/statement.cc -> build/default/src/statement_1.o
In file included from ../src/database.h:12,
from ../src/sqlite3.cc:8:
../src/async.h: In destructor ‘Async<Item, Parent>::~Async()’:
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
In file included from ../src/database.h:12,
from ../src/database.cc:7:
../src/async.h: In destructor ‘Async<Item, Parent>::~Async()’:
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
../src/async.h: In destructor ‘Async<Item, Parent>::~Async() [with Item = std::basic_string<char, std::char_traits, std::allocator >, Parent = node_sqlite3::Database]’:
../src/database.h:117: instantiated from here
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
../src/async.h: In destructor ‘Async<Item, Parent>::~Async() [with Item = std::basic_string<char, std::char_traits, std::allocator >, Parent = node_sqlite3::Database]’:
../src/database.h:117: instantiated from here
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
In file included from ../src/database.h:12,
from ../src/statement.cc:9:
../src/async.h: In destructor ‘Async<Item, Parent>::~Async()’:
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
../src/async.h: In destructor ‘Async<Item, Parent>::~Async() [with Item = node_sqlite3::Database::ProfileInfo, Parent = node_sqlite3::Database]’:
../src/database.cc:389: instantiated from here
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
../src/async.h: In destructor ‘Async<Item, Parent>::~Async() [with Item = node_sqlite3::Database::UpdateInfo, Parent = node_sqlite3::Database]’:
../src/database.cc:429: instantiated from here
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
../src/async.h: In destructor ‘Async<Item, Parent>::~Async() [with Item = std::basic_string<char, std::char_traits, std::allocator >, Parent = node_sqlite3::Database]’:
../src/database.h:117: instantiated from here
../src/async.h:56: error: cannot convert ‘ev_async_’ to ‘ev_loop_’ for argument ‘1’ to ‘void ev_invoke(ev_loop_, void_, int)’
Waf: Leaving directory `/home/qbit/golphie/node_modules/sqlite3/build'
Build failed:
-> task failed (err #1):
{task: cxx sqlite3.cc -> sqlite3_1.o}
-> task failed (err #1):
{task: cxx database.cc -> database_1.o}
-> task failed (err #1):
{task: cxx statement.cc -> statement_1.o}

npm log here: https://gist.github.com/1078137

EDIT: Added error messages.

install error!

info it worked if it ends with ok
verbose cli [ 'E:\nodejs\node.exe',
verbose cli 'E:\nodejs\node_modules\npm\bin\npm-cli.js',
verbose cli 'install',
verbose cli 'sqlite3' ]
info using [email protected]
info using [email protected]
verbose config file C:\Users\Dray.npmrc
verbose config file E:\nodejs\etc\npmrc
verbose config file E:\nodejs\node_modules\npm\npmrc
verbose mkdir done: E:\nodejs 755
verbose caching E:\nodejs\node_modules\express\package.json
verbose loadDefaults [email protected]
verbose caching E:\nodejs\node_modules\jade\package.json
verbose loadDefaults [email protected]
verbose caching E:\nodejs\node_modules\npm\package.json
verbose loadDefaults [email protected]
verbose into E:\nodejs [ 'sqlite3' ]
verbose cache add sqlite3
verbose cache add [ 'sqlite3', null ]
silly cache add: name, spec, args [ undefined, 'sqlite3', [ 'sqlite3', null ] ]
verbose parsed url { pathname: 'sqlite3', path: 'sqlite3', href: 'sqlite3' }
verbose addNamed [ 'sqlite3', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'sqlite3', '', false ]
verbose raw, before any munging sqlite3
verbose url resolving [ 'https://registry.npmjs.org/', './sqlite3' ]
verbose url resolved https://registry.npmjs.org/sqlite3
verbose etag "3QT8FWI1RWDL6KTGC7K123D24"
http GET https://registry.npmjs.org/sqlite3
http 304 https://registry.npmjs.org/sqlite3
silly get cb [ 304,
silly get cb { server: 'CouchDB/1.1.0 (Erlang OTP/R14B04)',
silly get cb etag: '"3QT8FWI1RWDL6KTGC7K123D24"',
silly get cb date: 'Wed, 21 Dec 2011 14:15:21 GMT',
silly get cb 'content-length': '0' } ]
verbose etag sqlite3 from cache
verbose mkdir done: C:\Users\Dray\AppData\Roaming\npm-cache\sqlite3 755
silly name, range, hasData 2 [ 'sqlite3', '', true ]
silly versions [ 'sqlite3',
silly versions [ '2.0.0',
silly versions '2.0.1',
silly versions '2.0.2',
silly versions '2.0.3',
silly versions '2.0.4',
silly versions '2.0.5',
silly versions '2.0.6',
silly versions '2.0.7',
silly versions '2.0.8',
silly versions '2.0.9',
silly versions '2.0.10',
silly versions '2.0.11',
silly versions '2.0.12',
silly versions '2.0.13',
silly versions '2.0.14',
silly versions '2.0.15',
silly versions '2.1.0',
silly versions '2.1.1' ] ]
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8r-v83.6.6.14-win32-ia32-6.1.7601',
verbose bin dist { shasum: '31cb74d383ac165cdf78a36b6e9bba3655d95d87',
verbose bin dist tarball: 'http://registry.npmjs.org/sqlite3/-/sqlite3-2.1.1.tgz' } ]
verbose has wscript [ undefined,
verbose has wscript { file: 'C:\Users\Dray\AppData\Roaming\npm-cache\sqlite3\2.1.1\package\package.json',
verbose has wscript contributors: false,
verbose has wscript serverjs: false,
verbose has wscript wscript: true } ]
verbose caching C:\Users\Dray\AppData\Roaming\npm-cache\sqlite3\2.1.1\package\package.json
verbose loadDefaults [email protected]
silly resolved [ { name: 'sqlite3',
silly resolved description: 'Asynchronous, non-blocking SQLite3 bindings',
silly resolved version: '2.1.1',
silly resolved homepage: 'http://github.com/developmentseed/node-sqlite3',
silly resolved author:
silly resolved { name: 'Development Seed',
silly resolved email: '[email protected]',
silly resolved url: 'http://developmentseed.org/' },
silly resolved contributors:
silly resolved [ { name: 'Konstantin Käfer', email: '[email protected]' },
silly resolved { name: 'Dane Springmeyer', email: '[email protected]' },
silly resolved { name: 'Will White', email: '[email protected]' },
silly resolved { name: 'Orlando Vazquez', email: '[email protected]' },
silly resolved { name: 'Artem Kustikov', email: '[email protected]' },
silly resolved { name: 'Eric Fredricksen', email: '[email protected]' },
silly resolved { name: 'John Wright', email: '[email protected]' },
silly resolved { name: 'Ryan Dahl', email: '[email protected]' },
silly resolved { name: 'Tom MacWright', email: '[email protected]' },
silly resolved { name: 'Carter Thaxton', email: '[email protected]' },
silly resolved { name: 'Audrius Kažukauskas', email: '[email protected]' },
silly resolved { name: 'Johannes Schauer', email: '[email protected]' } ],
silly resolved repository:
silly resolved { type: 'git',
silly resolved url: 'git://github.com/developmentseed/node-sqlite3.git' },
silly resolved devDependencies: { step: '0.0.4' },
silly resolved engines: { node: '~0.6.0' },
silly resolved licenses: [ { type: 'BSD' } ],
silly resolved main: './lib/sqlite3',
silly resolved _id: '[email protected]',
silly resolved scripts: { preinstall: 'node-waf clean || (exit 0); node-waf configure build' },
silly resolved dependencies: {},
silly resolved _engineSupported: true,
silly resolved _npmVersion: '1.1.0-beta-4',
silly resolved _nodeVersion: 'v0.6.6',
silly resolved defaultsLoaded: true } ]
info into E:\nodejs [email protected]
info installOne [email protected]
info unbuild E:\nodejs\node_modules\sqlite3
verbose from cache C:\Users\Dray\AppData\Roaming\npm-cache\sqlite3\2.1.1\package\package.json
verbose mkdir (expected) error ENOENT, no such file or directory 'E:\nodejs\node_modules___sqlite3.npm'
verbose mkdir done: E:\nodejs\node_modules___sqlite3.npm 755
verbose unpack
uid, gid [ undefined, undefined ]
verbose unpackTarget E:\nodejs\node_modules\sqlite3
silly gunzTarPerm modes [ '755', '644' ]
silly afterUntar undefined
verbose gunzed E:\nodejs\node_modules___sqlite3.npm\package
verbose rm'ed E:\nodejs\node_modules\sqlite3
verbose renamed [ 'E:\nodejs\node_modules___sqlite3.npm\package',
verbose renamed 'E:\nodejs\node_modules\sqlite3' ]
verbose has wscript [ undefined,
verbose has wscript { file: 'E:\nodejs\node_modules\sqlite3\package.json',
verbose has wscript contributors: false,
verbose has wscript serverjs: false,
verbose has wscript wscript: true } ]
verbose caching E:\nodejs\node_modules\sqlite3\package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose unsafe-perm in lifecycle true
silly exec cmd "/c" "node-waf clean || (exit 0); node-waf configure build"
silly spawning [ 'cmd',
silly spawning [ '/c', 'node-waf clean || (exit 0); node-waf configure build' ],
silly spawning 'E:\nodejs\node_modules\sqlite3' ]
info [email protected] Failed to exec preinstall script
ERR! error installing [email protected]
info unbuild E:\nodejs\node_modules\sqlite3
verbose from cache E:\nodejs\node_modules\sqlite3\package.json
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ true, 'E:\nodejs\node_modules', 'E:\nodejs\node_modules' ]
info postuninstall [email protected]
verbose installOne cb [email protected]
ERR! [email protected] preinstall: node-waf clean || (exit 0); node-waf configure build
ERR! cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1
ERR!
ERR! Failed at the [email protected] preinstall script.
ERR! This is most likely a problem with the sqlite3 package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR! node-waf clean || (exit 0); node-waf configure build
ERR! You can get their info via:
ERR! npm owner ls sqlite3
ERR! There is likely additional logging output above.
ERR!
ERR! System Windows_NT 6.1.7601
ERR! command "E:\nodejs\node.exe" "E:\nodejs\node_modules\npm\bin\npm-cli.js" "install" "sqlite3"
ERR! cwd E:\nodejs
ERR! node -v v0.6.6
ERR! npm -v 1.1.0-beta-4
ERR! code ELIFECYCLE
ERR! message [email protected] preinstall: node-waf clean || (exit 0); node-waf configure build
ERR! message cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1
verbose exit [ 1, true ]

Installation with npm fails

The installation of sqlite3 is failing when I try to install it through npm with npm install sqlite3
It was working previously, but it failed when I tried to reinstall it. I have received the exact same error in three of the machines I have. I am using node v0.4.8 and npm v1.0.6.

This is the output:

> [email protected] preinstall /Users/***/node_modules/sqlite3
> node-waf clean || true; node-waf configure build

Nothing to clean (project not configured)
Setting srcdir to                        : /Users/***/node_modules/sqlite3 
Setting blddir to                        : /Users/***/node_modules/sqlite3/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 /usr/local/Cellar/node/0.4.8 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for sqlite3                     : not found 
/Users/***/node_modules/sqlite3/wscript:24: error: the configuration failed (see    '/Users/***/node_modules/sqlite3/build/config.log')
npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 10.7.4
npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3"
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/***/npm-debug.log
npm not ok

windows port

Ticket to track potential future support for Windows.

Tasks:

  1. Compatibility with libuv/node v6.x (new event emitters) - #47

  2. Remove the phtread mutex usage (or provide option on windows to use boost threads for windows compatibility)

  3. Build system fixes, mostly waiting on upstream as per http://blog.nodejs.org/2011/11/05/node-v0-6-0/: "For example, we are not yet providing users with a blessed path for building addon modules in MS Visual Studio. Work will continue in later releases."

ImportError: No module named Scripting

Tthis is on Debian testing (wheezy) and sqlite package is version 3.7.3.

   > [email protected] preinstall /usr/local/share/etherpad-lite/node_modules/ueberDB/node_modules/sqlite3
   > node-waf clean || true; node-waf configure build

   Traceback (most recent call last):
     File "/usr/local/bin/node-waf", line 14, in 
       import Scripting
   ImportError: No module named Scripting
   Traceback (most recent call last):
     File "/usr/local/bin/node-waf", line 14, in 
       import Scripting
   ImportError: No module named Scripting
   npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`
   npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
   npm ERR! error installing [email protected]     at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
   npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:67:17)
   npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
   npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`
   npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
   npm ERR! error installing [email protected]     at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
   npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:67:17)
   npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
   npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build`
   npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
   npm ERR!
   npm ERR! Failed at the [email protected] preinstall script.
   npm ERR! This is most likely a problem with the sqlite3 package,
   npm ERR! not with npm itself.
   npm ERR! Tell the author that this fails on your system:
   npm ERR!     node-waf clean || true; node-waf configure build
   npm ERR! You can get their info via:
   npm ERR!     npm owner ls sqlite3
   npm ERR! There is likely additional logging output above.
   npm ERR!
   npm ERR! System Linux 2.6.32-5-686-bigmem
   npm ERR! command "node" "/usr/local/bin/npm" "install"
   npm ERR! cwd /usr/local/share/etherpad-lite
   npm ERR! node -v v0.4.10
   npm ERR! npm -v 1.0.22
   npm ERR!
   npm ERR! Additional logging details can be found in:
   npm ERR!     /usr/local/share/etherpad-lite/npm-debug.log
   npm not ok

Benchmark suite

Write a benchmark so that we can verify that changes don't affect the speed.

Integers are stored correctly, but retrieved incorrectly

I'm putting the integer in as one value, but I get a different value back.

Here's a test case:

(function () {
  "use strict";

  var sqlite3 = require('sqlite3').verbose(),
    dbpath = './test-integer.sqlite3',
    db = new sqlite3.Database(dbpath, runTest),
    inty = new Date().valueOf();

  function runTest(err) {
    db.exec("CREATE TABLE IF NOT EXISTS inttest ( inty INTEGER );" +
          "INSERT INTO inttest VALUES ( " + inty + " );", function (err) {
      if (err) {
        throw err;
      }
      db.all("SELECT * FROM inttest", function (err, arr) {
        if (arr[0].inty !== inty) {
          console.log('FAIL', inty, arr[0].inty);
        } else {
          console.log('passes');
        }
      });
    });
  };

}());

parseStream and parseFile yield different results.

I am attempting to use the same parser to process a stream or file. When processing a stream ( parser.parseString(data) ), I get he results I would expect. when I process a file using the same parser ( parser.parseFile(process.argv[3] + '.xml') ), I get the following error:

Error: SQLITE_ERROR: no such table: sessions

The database is being built but when I open the db, there isn't a session table. One unique thing when using parseFile is that I get a journal file which indicates that the table creation is not completing.

Compiler problem with declaring friend to nested classes

I am running into a compile problem while building version 2.0.9 and later.

Here's the error in the build output:

../src/statement.h: In destructor ‘virtual node_sqlite3::Statement::PrepareBaton::~PrepareBaton()’:
../src/database.h:172: error: ‘bool node_sqlite3::Database::open’ is protected
../src/statement.h:137: error: within this context
../src/database.h:173: error: ‘bool node_sqlite3::Database::locked’ is protected
../src/statement.h:137: error: within this context
../src/statement.h: In destructor ‘virtual node_sqlite3::Statement::PrepareBaton::~PrepareBaton()’:
../src/database.h:172: error: ‘bool node_sqlite3::Database::open’ is protected
../src/statement.h:137: error: within this context
../src/database.h:173: error: ‘bool node_sqlite3::Database::locked’ is protected
../src/statement.h:137: error: within this context

I'm using g++ with Mac OS X Leopard. I suspect I'm not alone in running into this build issue. Much of the node community uses Mac OS X as a development environment.

I've dug in, and discovered that the issue is subtle, and actually involves some vagueness in the C++ standard, which is why you may not be seeing this in your development environment.

The destructor for Statement::PrepareBaton cannot access the protected 'open' and 'locked' members of Database, even though Database declares Statement a friend class. The problem is that the nested class PrepareBaton does not have friend access to Database, as friendship is not considered transitive, even though PrepareBaton is a nested class of the friend.

The following discussion describes how this subtlety can differ across compilers:
http://www.rhinocerus.net/forum/language-c-moderated/578874-friend-transitive-nested-classes.html

In order to fix this, I added public inline accessor methods to Database called IsLocked() and IsOpen(), and modified the code in Statement::PrepareBaton to use those calls. Pretty straightforward.

I tried for a while to find an elegant way to still use friend classes, but couldn't come up with anything good. Maybe you'll have better luck. In the short term, could you please fix this issue, so simple npm updates will work with sqlite3 on Mac OS X? I'd rather not have to fork and use a separate implementation. I can send a pull request with my fix, though, if you like.

By the way, I really like your rewrite of orlandov's node-sqlite library. I used his for several projects, and even contributed here and there. It's nice to see someone pick up the torch.

Thanks,
Carter

Transaction API

// Flat interface.
var trx = db.begin();
trx.on('commit', function() {});
trx.on('rollback', function() {});


trx.rollback();
trx.commit(); // No implicit commit when calling db.begin();

// Creates a new stack
db.transaction(function(trx) {
    trx == this
    // implicit begin

    // transaction objects are like database objects:

    trx.run("CREATE TABLE foo (id INT PRIMARY KEY, bar)");
    trx.run("INSERT INTO foo VALUES(?, ?)", 1, "first text");
    trx.run("INSERT INTO foo VALUES(?, ?)", 1, "second text"); // will fail
    trx.run("INSERT INTO foo VALUES(?, ?)", 1, "third text", function(err) {
        if (err) {
            // Do nothing and the error will be ignored

            // See below for more explanation
            trx.clear();
            trx.rollback();
            trx.commit();
        }
    });

    trx.on('rollback', function() {
        // This is emitted after the transaction was rolled back.
    });

    trx.on('commit', function() {
        // This is emitted after the transaction was committed successfully.
    });

    trx.on('error', function() {
        // This will be called when a statement execution doesn't have a callback
        // and no error handlers.

        // removes all further statements from the stack. You can now add more
        // statements to the stack. the automatic commit on empty stack persists.
        // Does not remove the error handler, you have to do that manually.
        trx.clear();

        // removes all further statements from the stack and does a rollback of the
        // entire transaction.
        trx.rollback();

        // removes all further statements from the stack and commits the transaction
        trx.commit();
    });

    // when no error handler is attached and an error bubbles up to the transaction's
    // error event, the transaction is rolled back and the rollback event is emitted.

    // implicit commit when the stack is empty.
});

Reduce amount of memcpy()

Node's Buffer interface supports a way to declare an existing block of memory as a buffer, but it requires a free callback. This may be tricky to implement.

cannot build via npm

I'm trying to install node-sqlite3 via npm for 3 days now and I guess its a bug ;-)

when using "npm install cd sqlite3" i get lots of warnings and these lines in red:

Build failed:
-> task failed (err #1):
{task: cxx sqlite3.cc -> sqlite3_1.o}
-> task failed (err #1):
{task: cxx statement.cc -> statement_1.o}
-> task failed (err #1):
{task: cxx database.cc -> database_1.o}

however, it worked perfectly fine on my local machine by downloading the src, ./configure and make

as you can see in the log (https://gist.github.com/999243) I am using node 0.4.5 and npm 0.3.18

If there is any more information I can provide to help solving this problem, please let me know :)

Please Help: Trying to Build RELEASE for Windows with VS Express C++ 2010

I am very close to having a build, but I need a little help!

I hope this also helps someone else. I am using Windows XP Pro (yeah, yeah) with Visual Studio Express 2010 C++.

First, it would be good to tell three things:

  1. You need python installed and on your %PATH%. I'm using Python 2.7.
  2. You need to build node in a path with no spaces! Otherwsie, the vcbuild.bat will fail! I use C:\NODEV\
  3. Visual Studio 2008 and later project property pages are accessed by right-clicking on a project entry in the Solution Explorer pane.

So now I follow all the instructions at https://github.com/developmentseed/node-sqlite3/wiki/Building-On-Windows ** up to **

"Go to the "Property Manager" ... "

at which point I realize that VS Express 2008/2010 (and VS also I think) have slightly different interfacess from what I am used to. But I am an experienced visual studio user, so I press on.

I am in VS. The solution opens up in Release mode for me. This will be significant below.

** I need to know exactly what I'm supposed to be adding to the compiler and linker paths, but the instructions "change all three paths in "Additional Include Directories" to match those on your system" are pretty vague. Ok, fine, I think, I will just try to build and let VS tell me what it cannot find. But when I do this, I get exactly one error which will be familiar to VS developers:

deps\sqlite3\sqlite3.c(131070): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?

Thinking the sln file was maybe not created by a WIndows developer, I tell the compiler not to use precompiled headers and I try to build again. Now I get the kind of error I was looking for:

src\database.cc(2): fatal error C1083: Cannot open include file: 'node.h': No such file or directory.

So I add (in my case) C:\NODEV\node-v0.6.6\src to the compiler include path. Try to build again. Get this:

fatal error C1083: Cannot open include file: 'uv.h': No such file or directory

So I add C:\NODEV\node-v0.6.6\deps\uv\include to the compiler include path. Try to build again. Get this:

fatal error C1083: Cannot open include file: 'v8.h': No such file or directory

So I add C:\NODEV\node-v0.6.6\deps\v8\include to the compiler include path. Try to build again. Get this:

fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory

So I add C:\Documents and Settings\root\Desktop\developmentseed-node-sqlite3-v2.1.1-15-ge6b1f79\developmentseed-node-sqlite3-e6b1f79\deps\sqlite3

to the compiler path. (This is where I unpacked node-sqlite sources for windows.)

Try to build again. Finally no more compiler errors and now get link errors. Good!

Read through the link errors. Guess. Add C:\NODEV\node-v0.6.6\Debug\lib to the linker path and add the following libs to the linker dependencies:

v8_base.lib
v8_nosnapshot.lib
v8_snapshot.lib
uv.lib
openssl.lib
http_parser.lib
zlib.lib

Try to build again.

I get numerous errors like this:

v8_base.lib(api.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in database.obj

This suggests ( ** please tell me **) that this has something to do with the fact that the vcbuild.bat file (for node) build node in Debug but the node-sqlite project is built in Release.

SO I switch the VS build configuration mode to Debug and try to build again. Ah! Most of the errors are gone, and now I have to set all the optrions for Debug mode. (ya gotta love VS!)

The first thing I notice (in Debug settings now) is that someone upstream has tried to fix the deps already with this:

$(ProjectDir)deps\sqlite3 except that they misspelled "Project".

That line does not work in any version of VS I have ever used anyway, because VS is not smart enough to descend paths. So I just go ahead and add the same paths as above.

So here I go adding the include and lib paths to the Debug config pretty much the same way I did above...

I see that "kkaefer" appears in teh lib path for the Debug configuration, so I think I am on the right path (bad pun!) now and change that to match the lib path from my Node build instead, which is C:\NODEV\node-v0.6.6\Debug\lib

Try to build... SUCCESS!!! YEAH!!! But what does this mean...

I now have node_sqlite3.node and sqlite3.lib and I have no idea what to do with them. ** Please Help The Newbie! **

Also, it is now apparent that in order to get node-sqlite built in release, I will first need to build node in Release. I guess I will be looking at the vcbuild.bat file (for node) next.

I apologize for the long post. I see there is much interest in node-sqlite for Winnows. Hopefully it helps someone else.

I would appreciate some advice on how to install the module now that I have built it!

Thanks

More examples

I'm struggling to apply the async nature of sqlite3 to older projects that I am porting to node. Are there any good example projects on Github that use this module?

The single chaining example is great but it doesn't help much when trying to port the concept to larger old-word sync code.

Segmentation fault on db.each

I've install node-sqlite3: npm install sqlite3

Then I tried code from example

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');

db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();

After executing: node app.js

I get segmentation fault error. If I exclude db.each queries, it runs normally.

I've tried use external file instead of :memory: like var db = new sqlite3.Database('db.sql');
But it doesn't helps.

node v0.4.8
npm 1.0.15
Linux 2.6.39-gentoo-r3

Database#prepareSet(object, cb) - prepare a set of statements

Would you accept a patch for a Database.prototype.prepareSet() method which takes an object containing strings of SQL and creates a Statement object for each, replacing the original string with the new object? Written in JS for the original sqlite binding, it looks like:

sqlite.Database.prototype.prepareSet = function(ioSet, iCallback, _async) {
  var that = this;
  for (var a in ioSet) {
    if (typeof ioSet[a] !== 'string')
      continue;
    that.prepare(ioSet[a], function(err, stmt) {
      if (err) return iCallback(err);
      ioSet[a] = stmt;
      that.prepareSet(ioSet, iCallback, 1);
    });
    return;
  }
  if (!_async)
    process.nextTick(iCallback);
  else
    iCallback();
};

documentation: 'make test' requires module 'step'

I am a node newbie, but it appears to me that 'make test' for module 'sqlite3' requires module 'step' (in addition to module 'expresso').

Also, the 'may take several minutes' to build the test database was an understatement on my box. Granted, its an old Core2 Duo @ 3GHz with only 2GiB RAM and 6GiB swap running Ubuntu Oneric Ocelot. Building the test database took over my system for between 10 and 15 minutes on heavy thrashing!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.