mercredi 21 janvier 2015

Read SQLite database from the disk using sql.js

I am able to read the file when it is being uploaded using - input type="file", but I want to read the SQLite file from a hard coded path. The documentation for sql.js does provide a solution as given below, but i'm not able to get it working. Please help.



var fs = require('fs');
var SQL = require('sql.js');
var filebuffer = fs.readFileSync('test.sqlite');
// Load the db
var db = new SQL.Database(filebuffer);



  • I hope its very simple and any one using sql.js can answer this.


Aucun commentaire:

Enregistrer un commentaire