[whatwg] SQL API and database versioning

Křištof Želechovski giecrilj at stegny.2a.pl
Thu Oct 11 09:36:10 PDT 2007

It looks like an unintended omission to me.  I would say "If the *expected*
database version is an empty string", which is ambiguous as well, but it is
about the "expected version" of course.

I think that if someone opens a database without expecting a particular
version and the database already exists the openDatabase() call should

Best regards, Chris

-----Original Message-----
From: whatwg-bounces at lists.whatwg.org
[mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Brady Eidson
Sent: Thursday, October 11, 2007 7:37 AM
To: WHATWG Mailing List
Subject: [whatwg] SQL API and database versioning

openDatabase() is called with a database name and an expected version  

If the database has a version, and it is different than the expected  
version, openDatabase() fails.  This makes sense.  But...

"Otherwise, if the database version is the empty string, or if the  
database doesn't yet exist, or if the database exists and the version  
provided to the openDatabase() method is the same as the current  
version associated with the database, then the method must return a  
Database object..."

1 of these 3 situations doesn't make sense.  A database without a  
version should not be considered valid if the caller to openDatabase()  
expects a version.

This seems silly as two callers, one expecting "versionFoo" of a  
database and the other expecting "versionBar" will both be allowed  
access to a versionless database.
That seems like an instant recipe for failure for at least versionFoo  
or versionBar, possibly both.

I think that if someone opens a database with an expected version and  
the database already exists but has an empty version string, the  
openDatabase() call should fail.


More information about the whatwg mailing list