WebReflection / dblite

sqlite for node.js without gyp problems
MIT License
209 stars 34 forks source link

Can't open database #20

Closed jjp91 closed 10 years ago

jjp91 commented 10 years ago

Says Error: near "/": syntax error

Even if i put a relative or fix path, program is the one below

var dblite = require('dblite');

var db = dblite( '/home/jj/var/ProjetStyle/node/test.sqlite3' , function ( err , result ) {

if ( err )
    console.log(err) ;
else
    console.log(result) ;

} ) ;

System Linux 3.2.0-56-generic 32Bit cwd /home/jj/var/ProjetStyle/node node -v v0.10.22 npm -v 1.3.14

WebReflection commented 10 years ago

where did you read that you pass a callback when you open a database ?

var dblite = require('dblite');

var db = dblite( 'test.sqlite3');
db.query('SELECT * FROM sqlite_master', function (err, result) {
  console.log(err || result);
});
jjp91 commented 10 years ago

Yes, I tried without, but it was just a test to see if I get an error message.

Anyway, this is a mistake from me, sorry.

PS:Relax, people can do mistakes ................ even you.

WebReflection commented 10 years ago

I genuinely asked thinking about a documentation bug ... happy you solved