Creating and opening databases using Web SQL Database or the Cordova SQLite Storage plugin is easy, but there are a few differences between the two that you do need to be aware of. Before we cover these differences, let's go over the basics.
The snippets in this section are located at
snippets/08/ex1-create-database/ in the code package of this book. When using the interactive snippet playground, select
8: Web SQL Database and Example 1.
While using Web SQL Database, you can open a database with the following:
let db = window.openDatabase(name, version, description, quota);
Let's go over the parameters:
name: This is the filename of the database. It usually ends in a
.dbextension. This parameter is required.