Cordova SQLite Storage Plugin
Last updated
Last updated
This Cordova/PhoneGap plugin uses SQLite databases on Android, iOS and Windows with an HTML5/Web SQL API.
Plugin ID/package name: cordova-sqlite-storage
Tested version: 6.1.0
To check the third party Cordova plugins, you need to create a custom build debugger (Android version or iOS version).
Import the SQLite storage plugin demo to your Monaca account
From the IDE menu, go to Config → Manage Cordova Plugins .
Click the Import Cordova Plugin button. Then, you can choose to import the plugin using a ZIP file or a URL/package name.
After importing the plugin into the project, you can initialize your database. Please make sure to call the plugin API after the Cordova is loaded.
This section describes some of the main functions used in the Demo. For complete API references, please refer to the repository.
Verify that both the Javascript and native part of this plugin are installed in your application.
Return Value
Promise
Verify that this plugin is able to open a database, execute the CRUD (create, read, update, and delete) operations, and clean it up properly.
Return Value
Promise
Open a database access handle object.
Parameter
Name | Type | Description |
| String | Name of the database |
| String | [optional] Location of the database |
| String | [optional] iOS Database Location. Available options are: |
Return Value
Promise
Example
An example of opening a database access handle object with a default or a specified location:
The successcb
and errorcb
callback parameters are optional but can be extremely helpful in case anything goes wrong. For example:
Execute SQL on the opened database.
Return Value
Promise
Example
Delete a database access handle object.
Parameter
Name | Type | Description |
| String | Name of the database |
| String | [optional] Location of the database |
| String | [optional] iOS Database Location. Available options are: |
Return Value
Promise
Example