Saturday, 17 August 2013

connect sequelize.js to node-webkit desktop app using sqlite

connect sequelize.js to node-webkit desktop app using sqlite

currently I am using node-sqlite3 sqlite binding on my node-webkit desktop
app and using it as
var sqlite3 = require('node_sqlite3').verbose();
var db = new sqlite3.Database('file:data.db');
db.run(query);
and on my knowledge this natively compiled node-sqlite3 is the only way to
use sqlite db with node-webkit.
now I want to use sequelize.js on the app which is normally used as:
var Sequelize = require('sequelize-sqlite').sequelize
var sqlite = require('sequelize-sqlite').sqlite
var sequelize = new Sequelize('database', 'username', 'password', {
dialect: 'sqlite',
storage: 'path/to/database.sqlite'
})
how can I achieve this ?
the goal is to make the database life easier by running migrations , use
models to manipulate database , or suggest if there are any other
javascript libraries (mvc is prefered) , which can work through
node-webkit+sqlite (and how to make them work) .
is angularjs is an option , if yes how to do this.
thank yous.

No comments:

Post a Comment