Chapter 8. More Features and Advances in SQLite

This chapter will explore some new features in SQLite, and it will also cover the recent advances made in this database. This chapter will show you how SQLite is exposed to other languages and frameworks and discuss the extensions of the C API, the usage of PhoneGap, and other cross-platform development environments. This chapter will also outline SQLite's other features and how SQLite has advanced to ensure that all those who use it can master it quickly.

You will also look at how SQLite has changed in recent years, how it has advanced to be integrated with a variety of existing technologies, and how its simple, easy-to-use formula has guaranteed its popularity to others. The amount of apps that use database technology, without disclosing the backend or local database, is incredible. SQLite, as will be shown later, has advanced to new levels and kept its simplicity but with developers pushing it to achieve new heights and popularity.

Firefox and SQLite extensions to their browsers are available for administration purposes. SQLite has gone through several code changes, and in the future, it will continue to do so or be overtaken by something newer.

Adobe's Enterprise Management system works with PhoneGap, which uses SQLite. Because of its simple setup, there are several cases of SQLite using different technologies and integrating well.

The growth of relational database management systems to this date have been very strong, and if the data requires industrial strength, storage, and application, SQLite is the right format. However, in more recent years, solutions such as NOSQL, which purely rely on the data selected from technologies such as REST APIs or web services, have not used RDBMS (relational database management system) to store their data. It will be retrieved and held in a file type structure, in effect, as its own version of RDMS. SQLite does not have the industrial support of tools like database backup or database recovery. In a world of mobile devices where the growth has been intensive and beating all types of expectation, SQLite is by far the easiest and quickest one to use with a minimum time spent learning.

The Firefox SQLite Manager facility is a good software extension to the browser. Once installed, it can serve as an aid to various processes of the database administrator.

Its simplicity and flexibility make it great for developing and testing. There is no mechanism to ensure performance, and it is possible to tune up the library. SQLite is great for embedded applications that are somewhat fixed, single user, mobile users, and gaming information storage.

It is easy to download and install SQLite. Once this is done, it gets fired up to work.

Before starting to develop a software for PhoneGap with SQLite, the environment must be set up properly for the PhoneGap framework to work correctly with SQLite. The PhoneGap environment will enable the SQLite database to be set up and connected with Xcode, toward the end, to produce an iOS application.

There is also a native SQLite plugin for PhoneGap, called Brodysoft (refer to https://build.phonegap.com/plugins/2368), that provides an interface for the storage and usage of the standard Web SQL database standards.

As the demand for mobile technology, mobile apps, and mobile development grows, the need for further advancement, with products such as PhoneGap, will be demanding the following, for example:

To support additional plugins, which are more than 600 on the PhoneGap environment, the source attribute can be used.

PhoneGap plugins, unlike before, can contain compiled components such as frameworks, .jar files, and other related binaries. There is a lot of documentation about this procedure on the PhoneGap site. PhoneGap is now moving ahead with an Amazon Mobile Ad Network plugin, which will allow developers to monetize their app. This is because the Amazon Ads API has been created to be used within applications to facilitate advertising, and is a platform for this sole purpose. It will be used across different tablets, mobile devices, different utilities, and game apps.

The cordova.xml file used by Cordova or PhoneGap is the main parameter file where configuration changes are made to the environment.

For example, using the native Cordova/PhoneGap plugin for Android and iOS, the HTML5 Web SQL API can be used to code directly, as shown in the following. Here, the code is waiting to see if the API has been loaded before attempting to open the database:

 <gap:plugin name="com.millerjames01.sqlite-plugin" version="1.0.1"/>

This plugin is compatible with both iOS and Android operating systems and also works with Cordova.

The following piece of code is essential to ensure that a check is done, to see if the device is ready and if Cordova is ready to load:

// Wait for Cordova to load document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready function onDeviceReady()
{   var db = window.sqlitePlugin.openDatabase({name: "DB"
}

);   // ... }

Using the preceding plugin, it makes the inclusion of SQL directly into HTML5 easier and faster, as shown in the following:

Db.transaction(function(Tx1) {
  Tx1.executeSql("Create table if not exists" + " test(id integer primary key asc, newcolumn text, []);
});
}

It becomes easy to add the necessary HTML content, and this works with both iOS and Android. The relationship between HTML5, SQLite, and PhoneGap to compile is an advancement of technology.

Not all the aspects of the ALTER TABLE statement are implemented in SQLite, and there is no support for the GRANT or REVOKE statements.