![]() ![]() We started off using a plain old Web SQL Database in our PhoneGap app, but ran into the following limitations: Available under GPL v3 or commercial license.We ended up using the PhoneGap SQLite plugin, here's why: cordova-sqlite-evfree - similar to cordova-sqlite-extīut with improved memory handling.cordova-sqlite-ext - extended version with additionalįeatures including REGEXP support on Android and iOS.It supports iOS, Android & Windows platforms. cordova-sqlite-storage - core version that includes its own sqlite3 implementation.It is available in the following variations: It effectively has no size limitations.It is available with support for the Windows platform.The SQLite plugin provides an API virtually identical to WebSQL described above. Provides an extensive implementation that is available across all Cordova platforms. While the API is not supported natively by any Cordova platform, the File plugin It provides APIs to store and retrieve data on the local file system,Īnd is described in some detail in an excellent html5rocks article. ![]() The FileSystem API was a W3C spec that was implemented by Chrome, but not otherīrowsers. Limited total amount of storage and possible eviction as described on MDN.Robustness from using a transactional database model.Multiple databases and object stores provides more structure than LocalStorage.Simple data model easier to learn than SQL.Good performance - asynchronous API won't block the UI, and indexing provides.open ( databaseName, databaseVersion ) openRequest. Var db var databaseName = ' myDB ' var databaseVersion = 1 var openRequest = window. The following code snippet demonstrates some simple usage of IndexedDB: When you make a request, you get a request object, which provides onerrorĪnd onsuccess events, as well as properties such as result, error.Operation, then get notified of the result via a DOM event. IndexedDB works asynchronously - you request a particular database.Doesn't support object lookup via compound index.Windows platform support for IndexedDB is incomplete. There could be differences between the behavior on the Safari and Firefox browsers, The actual behavior may depend on which browser is used. IndexedDB is supported by the underlying WebView on all platforms, with known limitations on the following platforms: IndexedDB provides a simple and easy to understand data model, much like LocalStorage.īut unlike LocalStorage, you can create multiple databases, with multiple stores perĭatabase, and its asynchronous API and search indexes provide performance benefits. It provides some of the benefits of SQL tables, withoutĬonstraining the structure or needing to define it up front. IndexedDB lets you storeĪrbitrary JavaScript objects (provided they are supported by the structured clone algorithm), The goal of the IndexedDB API is to combine the strengths of the LocalStorageĪnd WebSQL APIs, while avoiding their weaknesses. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |