Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are node-webkit database files stored?

I've just started to work with Node-webkit, and think it's great.

I've setup a db using the "Web SQL Database" option, mentioned here, and it seems to work well. Much like Sqlite, which I'm a bit familiar with.

From the docs, this is implemented using sqlite, so I'd like to be able to find the actual db file this create on disk and look at it with a Sqlite editor, like sqliteman.

Where is the db file saved to?

I couldn't find it in the docs, or by googling it ;-)

like image 924
Brad Parks Avatar asked Dec 15 '22 02:12

Brad Parks


2 Answers

Since node-webkit version 0.6.1, you may retrieve the dataPath from the App object. The WebSQL files will be stored within the databases folder.

Wiki: https://github.com/rogerwang/node-webkit/wiki/App

Get the application's data path in user's directory.
Windows: %LOCALAPPDATA%/;
Linux: ~/.config/;
OSX: ~/Library/Application Support/ where is the field in the manifest.


Example:

require('nw.gui').App.dataPath;
like image 89
j0wy Avatar answered Feb 16 '23 01:02

j0wy


I'm on a mac, and I used the tool Sloth to see the files that are opened by an application... Basically it's a GUI version of the command line lsof (list open files)

It pointed me to the following path:

~/Library/Application Support/YOUR_APP_NAME/databases/file__0/

and the sqlite db file was in there!

like image 44
Brad Parks Avatar answered Feb 16 '23 01:02

Brad Parks