Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 localStorage & SQL

I understand that HTML5 "localStorage" is a key:value store but I am wondering if there is a Javascript library available that offers a more SQL-ish API?

like image 270
jldupont Avatar asked Dec 10 '09 02:12

jldupont


4 Answers

W3C Database specification says:

User agents must implement the SQL dialect supported by Sqlite 3.6.19.

As of now, at least Google Chrome supports SQL dialect. I have checked myself.

like image 115
N 1.1 Avatar answered Oct 05 '22 22:10

N 1.1


Check out Will HTML5 be SQL-free? and DOM Storage: a Cure for the Common Cookie for some links and opinions.

like image 23
Kevin Hakanson Avatar answered Oct 05 '22 22:10

Kevin Hakanson


You should use HTML5 database storage (it supports SQL through transactions). a tutorial here: http://www.html5rocks.com/tutorials/webdatabase/todo/

like image 45
Ionut Popa Avatar answered Oct 05 '22 23:10

Ionut Popa


HTML5 local database storage comes with a SQL interface by default, if I'm not mistaken

Here is a Webkit post with some examples: http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/

Currently, Chrome forces you to use Gears, which is slightly different, but still SQL-based. Future versions of Chrome will follow the HTML5 spec, however.

like image 22
Matt Avatar answered Oct 05 '22 22:10

Matt