Monday, October 22nd, 2007

WebKit Does HTML5 Client-side Database Storage

Category: Browsers, Database

<p>The WebKit team has implemented an implementation of the HTML 5 client side storage API which gives you an asynchronous API:

javascript
< view plain text >
  1. var database = openDatabase("Database Name", "Database Version");
  2.  
  3. database.executeSql("SELECT * FROM test", function(result1) {
  4.    // do something with the results
  5.    database.executeSql("DROP TABLE test", function(result2) {
  6.      // do some more stuff
  7.      alert("My second database query finished executing!");
  8.    });
  9. });

Once you have the latest nightly, you can check out their database example and even see the tool that is available in the Web inspector:

Related Content:

Posted by Dion Almaer at 8:03 am
16 Comments

++++-
4.5 rating from 30 votes

16 Comments »

Comments feed TrackBack URI

Pardon my ignorance but isn’t this a HUGE security risk?

Comment by Maxivida — October 22, 2007

@Maxivida,

According to the writeup (and the HTML5 spec), the databases are under the familiar same-origin policy (like, say, cookies). You probably wouldn’t want to push anything truly sensitive, but I don’t see it as a terrible security risk.

Comment by mhw — October 22, 2007

Yeah, you’re not going to be storing unencrypted passwords and credit-card numbers in here, but you shouldn’t be any where. This is an awesome step forward… it will be nice in 10 years when IE has this too.

Comment by Jon Hartmann — October 22, 2007

I had NO idea this was in the HTML 5 spec.

Will we have this feature in Adobe Air as well? It uses WebKit.

Comment by Mike — October 22, 2007

plz have some sync queries too!

Comment by Uriel Katz — October 22, 2007

Oops. I was talking about TrimQuery.

Comment by Justin Meyer — October 22, 2007

When released this will be 2 major browsers, the planned Firefox 3 release and Apple’s Safari, that implement offline storage. Neato :)

Comment by NikolaTesla — October 22, 2007

Ok, it’s a further option to solve some very specific problems, like offline sites development. So, why put it into a recommendation of HTML, a technology which is designed to solve GENERAL problems?

Even DOM, our greatest “scripting weapon”, was into a separated recommendation. And i think that a SQL engine isn’t greater than DOM.

The next-generation standards (CSS3, JS2.0, HTML5 / WA 1.0) will be so SLOWLY and INCOMPLETE adopted than their previous versions, if the things continues to go into this way.

Comment by Hudson Tavares — October 22, 2007

Does anyone know if the WebKit bundled w/ Adobe AIR is compatible for this? Can I use this client-side DB with AIR?

Comment by jtrav — October 22, 2007

@Hudson Tavares: The HTML specification is more like “The Browser API” specification now days. The more things get pulled under the specified standard, the harder it will be for companies to get away with partially implementing the system.

Comment by Jon Hartmann — October 22, 2007

We should be worrying about greater cross platform *cough* Liunx *cough* support for Air before new features are added to it.

Comment by Axel — October 22, 2007

@Jon Hartmann: Make a standard bigger can result in unexpected behaviors of browser’s companies. Key-standards, like XHTML and CSS, are huge enough by themselves; looking at nowadays, even CSS 2.0 (a 9-years-old standard) were not completely adopted by the mainstream browsers.

Although a standard need to enclose many aspects than possible, this can weaken it’s objectiveness. A SQL engine doesn’t figure an essencial part to client-side; at this point, putting it into the HTML specification may be a precedent to another “secondary needs”.

@jtrav: Maybe we’ll need to expect until the next beta (or some update). Probably, Adobe will not be so crazy, and update the WebKit version while it’s not enough reliable (“This initial implementation has some things missing from the spec as well as a few known bugs”).

Comment by Hudson Tavares — October 22, 2007

Now, all we need is Mozilla and Microsoft to jump on board and create a panel to develop a standard, It would be a programmer’s dream. But that’s highly doubtful. Oh, just a programmers dream.

Comment by Marc Nobel — October 23, 2007

Oh yes, and Google should be a part of the panel too. Google is one of the few companies that have fresh ideas, and few people telling them that they can’t do that. Most of the javascript apis from Google are well written and easy to implement. That’s what we need.

Comment by Marc Nobel — October 23, 2007

I’ve done a little bit of work to hook this into TiddlyWiki. Check it out here:

http://jimpick.com/test/clientside-storage.html

It works with the nightly WebKit builds, as well as the iPhone (and emulator).

Comment by jpick — September 2, 2008

Google Chrome version (type about:version into the address bar):Operating System:Error Message:Extensions installed:

Please describe your question/comment in detail (for example, steps to reproduce the problem):

The default web document icon is a blank page, this changed recently not sure if it was with chrome 10 or IE 9, but one or the other.

Changing default browser to IE9 changes the icon to IE9 icon, changing it back to Chrome yields a blank.
sata docking station http://www.espow.com/wholesale-computers-networking-computer-accessories-drive-cases-and-docking.html

Comment by ddlgs12 — June 25, 2011

Leave a comment

You must be logged in to post a comment.