How to use local database with Node-Webkit offline desktop application?

929 views
Skip to first unread message

somn....@gmail.com

unread,
Dec 26, 2016, 4:25:45 AM12/26/16
to nw.js
I am a beginner. I have knowledge of HTML5, JavaScript, and JQuery.
I want to build Desktop applications using web technologies. I read about Node-Webkit.

I was wondering if offline databases like sqlite can be used with NW.js to save data locally at user's computer?
I am going to work on a Windows based desktop application.

Please help me. I need a simple & working demo application, which shows database connectivity, and operations like - Insert, Select, Update, Delete.

Dávid Házi

unread,
Dec 28, 2016, 6:11:12 AM12/28/16
to nw.js, somn....@gmail.com
I suggest instead of using sqlite use indexeddb. Its part of the html specification.
If you really want to use sqllite then google for a node.js example. It will work same as in nw.js

Alexander Mikhnevich

unread,
Dec 29, 2016, 1:50:45 AM12/29/16
to nw.js, somn....@gmail.com
To resolve that you need learn some node.js, not nw.js. 
NW.js gave the OS independent visual framework, node.js realize the functional part which is you looking for in this quesion. 
Look how to use sequelize in node.js. 

понедельник, 26 декабря 2016 г., 12:25:45 UTC+3 пользователь somn....@gmail.com написал:

somn....@gmail.com

unread,
Jan 6, 2017, 1:10:35 AM1/6/17
to nw.js, somn....@gmail.com

I found the solution. It's sql.js.

sql.js is sqlite compiled into javascript. Now I'm able to use sqlite. I can create db, insert data, read data, run sql queries.
And, it is 100% offline!

See the link:

Ed Thompson

unread,
Jan 16, 2017, 9:29:08 AM1/16/17
to nw.js, somn....@gmail.com
Do you have to custom build sqlite3 for node?
Reply all
Reply to author
Forward
0 new messages