W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2007

[whatwg] SQL API and database versioning

From: Brady Eidson <beidson@apple.com>
Date: Wed, 10 Oct 2007 22:36:36 -0700
Message-ID: <F43ADF7D-8594-49C4-B638-F6391F024AB4@apple.com>
openDatabase() is called with a database name and an expected version  
string.

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.

~Brady
Received on Wednesday, 10 October 2007 22:36:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:37 UTC