[whatwg] SQL API and database versioning
Brady Eidson
beidson at apple.com
Wed Oct 10 22:36:36 PDT 2007
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
More information about the whatwg
mailing list