سؤال

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 ;-)

هل كانت مفيدة؟

المحلول

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;

نصائح أخرى

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!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top