Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Read at the bottom for Update 2 (2013-12-06) - there is now a pure JS <a href="https://github.com/kripken/sql.js" rel="nofollow">module</a> which looks promising for windows work...</em></p> <p>I've been having a similar problem, and shy some pretty magic with re-linking the windows SQLite (or compiling the existing nodejs packages) the best I could come up with is to use a child process and shell out to the console sqlite client and then capture the results... Not the prettiest, and I have no idea if this can scale, but in a limited intranet scenario it might be Good Enough™.</p> <p><strong>Update:</strong></p> <p>Here's some code which I cobbled together - give you an idea in case you're not that familiar with child_process module. This works on <code>nodejs 0.6.0</code>.</p> <p>First I build up the command required to pull something out of sqlite:</p> <pre><code>var cmd = '"' + sqlitePath + '" "' + dbPath + '" "select * from sqlite_master"'; </code></pre> <p>Note, if you include the optional flags <code>-noheader</code> and <code>-list</code> then you might get slightly better output for parsing. You can also control the field delimiter by using <code>-separator 'x'</code> where <code>x</code> is your delimiter.</p> <p>Then I actually spawn the child process:</p> <pre><code>var child = exec(cmd, function(error, stdout, stderr) { if (error) { console.log('error while trying to do stuff...'); // error message in error and stderr } else { console.log('success'); // successful stuff is in stdout } }); </code></pre> <p>In combination with some string parsing and playing with the sqlite console client's options you may be able to get this to do enough. I do say again, however, <em>this is not production tested</em> - I'm just mocking up some intranet stuff, and even so I'm sure it's not the best approach!</p> <p><strong>Update 2 (2013-12-06):</strong></p> <p>For folks reading this question now, you might be interested to check out <a href="https://github.com/kripken/sql.js" rel="nofollow">sql.js</a> on github; it is a pure JS implementation of sqlite which looks promising for interacting on windows (or whatever platform). Please note, to install via npm the package name is <code>node-sqlite-purejs</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload