WebReflection / dblite

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

Doesn't work on latest node #33

Closed mikeptweet closed 9 years ago

mikeptweet commented 9 years ago

This worked fine but know it doesn't work on node v0.10.36

No errors, no nothing from the tests ... doesn't look like it's spawning sqlite3.exe

Windows

WebReflection commented 9 years ago

which version of sqlite3 ? have you read changes needed due sqlite3 changes ?

are you initializing like this? https://github.com/WebReflection/dblite#dblite

mikeptweet commented 9 years ago

Sqlite3,exe is 3.8.8.2 ... my code is here (and I've tried it with all variations of your doc.

var dblite = require('dblite').withSQLite('3.8.6+'); //dblite.bin = "c:/nodejs/sqlite3.exe"; var db = dblite(':memory:'); db.query("Select sqlite_version() as version",function(err, rows) { if (err) { throw err;
} else { console.log(rows[0]); } });

WebReflection commented 9 years ago

would this change make any difference?

dblite.bin = "c:\\\\nodejs\\sqlite3.exe";

which windows?

mikeptweet commented 9 years ago

Nope ... tried it on Windows 7, 8 & Windows Server 2012 ... all the same. I did a brand new installation of Node on a clean machine ... still the same

WebReflection commented 9 years ago

I've finally found the problem, it's SQLite. They changed again the EOL of the csv, so while 3.8.6 introduced \r\n on Linux, 3.8.8 forces \n on windows too.

Moreover:

 Encoding considerations:

      As per section 4.1.1. of RFC 2046 [3], this media type uses CRLF
      to denote line breaks.  However, implementors should be aware that
      some implementations may use other values.

That leads to the following reference

The TL;DR answer here is:

  1. if you want an hot fix for your machine, get rid of all the crap inside defineCSVEOL when it comes to assigning the value and just use EOL='\n' instead, that fixes everything
  2. on Linux, do not use the .withSQLite BS initialization
  3. be patience enough to wait for me to create a bloody lazy EOL initializer based on actual sqlite3 query.

The latter one requires quite a big refactory but since chaps behind SQLite keep playing with the bloody Line Feed randomly and accordingly with their daily mood, I don't see how this project could be defined usable in any other way.

I thought features detections were a thing of the Web, even the most used database in the world needs this stuff.

Apologies for any inconvenient

WebReflection commented 9 years ago

updated the README too

WebReflection commented 9 years ago

can you please confirm that 0.7.0 works again as expected? I've hopefully solved this annoying thing forever.

Thank you

mikeptweet commented 9 years ago

Its Working! That you so much for your prompt .

On Wed, Feb 25, 2015 at 4:04 AM, Andrea Giammarchi <notifications@github.com

wrote:

updated the README https://github.com/WebReflection/dblite#warning too

— Reply to this email directly or view it on GitHub https://github.com/WebReflection/dblite/issues/33#issuecomment-75926938.

mikeptweet commented 7 years ago

Dblite stopped working again on the latest node (7.5.0) ... probably related to this same issue. Can you please take a look as I have an app depending on this?

Thanks a bunch

WebReflection commented 7 years ago

Can you please take a look as I have an app depending on this?

You should test everything works before updating ;-)

Can you give me more details about the issue? Is it still a Windows Machine? Which Windows? Which version of sqlite?

mikeptweet commented 7 years ago

It looks like it was a bum sqlite shell executable on Windows ... I downloaded the latest and it works OK.

Sorry for the false alarm and thanks again for this library :-)