![]() ![]() It works in Chrome and Opera, but not in Safari or Webkit. Otherwise, an exception is thrown.Īlso, changeVersion, the method to change the database version, is not fully supported in Webkit. ![]() The version number is a required argument to openDatabase, so you must know the version number before you try to open it. If you upgrade your database to version 2.0 (e.g., there are some important schema changes since version 1.0), how do you know which visitors are on version 1.0 and which are on version 2.0? I could be wrong, but everything I’ve tested so far says that versioning in SQL databases is borked. Opera, on the other hand, builds the database without complaining, which I expect might change later as it’s still in alpha. The prompt is shown the image below, asking whether you want to grant the database permission to scale up to the next size of database - 5, 10, 50, 100 and 500MB. Estimated database sizeįrom the tests I’ve run, only Safari prompts the user if you try to create a database over the size of the default database size, 5MB. The return value from openDatabase contains the transaction methods, so we’ll need to capture this to be able to perform SQL queries. Without this feature, however, the databases are still being created on the fly and correctly versioned. The creation callback will be called if the database is being created. The missing feature of openDatabase (I’m not sure when it was added) is the fifth argument: I’ve passed four arguments to the openDatabase method. To create and open a database, use the following code: var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024) You also don’t have to worry about closing databases. If you try to open a database that doesn’t exist, the API will create it on the fly for you. Nonetheless, it’s fun to play with, so let’s get playing! Creating and Opening Databases On the other hand, since Opera has only just added support, it’s closer to the spec (I’ll mention the differences as we go along). Either way, I’d definitely recommend checking out the SQLite documentation for the functions that are available.īecause of this patchy support and the simple fact that Webkit had implemented the database spec some time ago, the spec on the W3C is now slightly ahead of the implementations in Safari, while Webkit is still catching up. Fellow Doctor Bruce Lawson has told me that Firefox are holding off as they feel there’s a better implementation than SQLite (though I hope it’s similar, whatever they pick). Only Webkit (Safari, SafariMobile and Chrome) and Opera 10.50 ( ATOW alpha on Mac) support web databases. Support is a little patchy at the moment. There are three core methods in the spec that I’m going to cover in this article: Order levitra It uses SQL and the WHERE clause to narrow down the recent chat about HTML5 on Twitter (it will work in Safari, Chrome and Opera 10.50). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |