Where is data stored when using an HTML 5 Web SQL Database
Asked Answered
C

4

10

I just read something about HTML 5 Web SQL Databases. I did a little search on here and Google but couldn't find a simple to the point answer.

Can someone tell me, where is the data stored when using this? In memory or a text file or something else?

Also what browsers support this?

Contingency answered 1/12, 2011 at 20:48 Comment(0)
S
10

It's stored in a SQLite database. Here is a browser support chart I found: .

That said, the W3C has officially dropped support for WebSQL in favor of IndexedDB. Here's the equivalent chart for that:

You may also want to look at DataJS, which is a library that abstracts some of the details of local storage and works across browsers:

Hope that helps.

Sublease answered 1/12, 2011 at 20:54 Comment(2)
Thanks for the links I will read up some more. I just found this page webkit.org/demos/sticky-notes/index.html which is really cool demo app using WebSQL for a simple note app. It's a shame you said they are dropping supportContingency
You can build the equivalent type of app with IndexedDb and it's arguable that this is a better abstraction for the web than WebSQL (though I don't want to get into that debate here :)). If you don't mind, could you mark this question as answered?Sublease
A
22

Web SQL locations by system for Google Chrome:

Windows Vista or 7

\Users\_username_\AppData\Local\Google\Chrome\User Data\Default\databases

Windows XP

\Documents and Settings\_username_\Local Settings\Application Data\Google\Chrome\User Data\Default\databases

Mac OS X

~/Library/Application Support/Google/Chrome/Default/databases

Linux

~/.config/google-chrome/Default/databases
Ascogonium answered 14/12, 2011 at 19:9 Comment(1)
Safari: ~/Library/Safari/Databases/Distinguishing
S
10

It's stored in a SQLite database. Here is a browser support chart I found: .

That said, the W3C has officially dropped support for WebSQL in favor of IndexedDB. Here's the equivalent chart for that:

You may also want to look at DataJS, which is a library that abstracts some of the details of local storage and works across browsers:

Hope that helps.

Sublease answered 1/12, 2011 at 20:54 Comment(2)
Thanks for the links I will read up some more. I just found this page webkit.org/demos/sticky-notes/index.html which is really cool demo app using WebSQL for a simple note app. It's a shame you said they are dropping supportContingency
You can build the equivalent type of app with IndexedDb and it's arguable that this is a better abstraction for the web than WebSQL (though I don't want to get into that debate here :)). If you don't mind, could you mark this question as answered?Sublease
L
2

Here is one browser example:

On Windows 7, Chrome stores Web SQL (aka SQLite) databases in:

C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\databases

Each extension or website that uses Web SQL is given its own folder. Within each folder will be a numbered, extensionless file that is an SQLite database. You could open said file with SQLite Database Browser or any SQLite-supported application.

Log answered 1/12, 2011 at 22:24 Comment(0)
H
1

And in case anyone is looking for IndexedDB:

On Mac OS X:

Chrome

  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.blob (Blob storage)
  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.leveldb (everything else - just LevelDB)

Firefox

  • ~/Library/Application Support/Firefox/Profiles/<profile>/storage/default/<site>/idb
Hofuf answered 31/3, 2016 at 18:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.