Part of the app I’m building requires having a local database. OK, require might be the wrong word as it could be done with HTML local storage, but a database is easier, and more in line with the Android version of the app. Conveniently, both Android and HTML5 WebSQL use SqlLite as the backend database as well, so I don’t even have to worry about differences in syntax (although I already use several db’s, so not a big deal), and should be able to port everything across easily.
Aside: I went with WebSQL over IndexedDB since WebSQL is supported in WebWorks. At least it is documented in the WebWorks documentation. And using a relational database makes it easier/quicker to port from Android.
HTML5 does not have this, exactly. When you open a database using window.openDatabase, you can optionally specify a version number. If you do, the version has to match exactly or you get an error. If you do not specify a version, then you get whatever is already there, or a new database if none has been created, after which you can verify the version you want with db.changeVersion, however, you have to specify both the old and new version, and you have to check the versions yourself for whether you want to call changeVersion, which is annoying and eventually can be a maintenance nightmare.
Moral of the story: Google first, think later.