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

[whatwg] SQL API and database versioning

From: Křištof Želechovski <giecrilj@stegny.2a.pl>
Date: Thu, 11 Oct 2007 18:36:10 +0200
Message-ID: <000801c80c24$ddd0be20$4d01010a@IBM42F76C011DF>
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
succeed.

Best regards, Chris

-----Original Message-----
From: whatwg-bounces@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  
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 Thursday, 11 October 2007 09:36:10 UTC

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