[Fwd: [whatwg] Comments on updated SQL API]

FYI, the What WG list (aka the shadow HTML WG <ducks/>) are looking into 
SQL APIs (for local storage, eg. Mozilla have SQLlite). Sort of like a 
super structured cookie system I guess.

Anyone care to prose a quad-store profile on top of it, plus SPARQL 
interface?

Dan

Forwarded message 1

  • From: Maciej Stachowiak <mjs@apple.com>
  • Date: Sat, 22 Sep 2007 00:24:01 -0700
  • Subject: [whatwg] Comments on updated SQL API
  • To: WHATWG Mailing List <whatwg@whatwg.org>
  • Message-Id: <01E3A07C-5D93-47BF-9361-B8E45922540B@apple.com>
Mostly I like the new API (no surprise to Ian I'm sure).

http://www.whatwg.org/specs/web-apps/current-work/#sql

A few comments. I think putting the currentRow accessors directly on  
the ResultSet is a bit of an odd choice. It seems like it could be  
confusing that myResultSet[0] returns the value of the first field of  
the current row, rather than the first row. At the very least I think  
there should be a currentRow field pointing to a ResultRow object that  
has the accessors. Also, ResultRow could have item, namedItem and  
getName marked DontEnum to allow for..in to be used to get the field  
names, which is more idiomatic JavaScript than the getName method.

Another suggestion is that having a rows array might be more  
convenient than the combination of next(), validRow, and whatever  
accessors exist in the current row (either a separate object or the  
ResultSet could have array-like accessors). The tradeoff for the  
convenience is that you'd have to either cache any already visited  
rows in the ResultSet object (at minimum), since database cursors  
typically only offer iteration in one direction. This one is less  
obvious to me since iterating with next() is not all that inconvenient.

Regards,
Maciej

Received on Sunday, 23 September 2007 10:02:49 UTC