lib/Ext/device/sqlite/Sencha.js
function(config) {
        if (config.name == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `name` of the database.');
            return null;
        }

        if (config.version == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `version` of the database.');
            return null;
        }

        if (config.displayName == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `displayName` of the database.');
            return null;
        }

        if (config.estimatedSize == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `estimatedSize` of the database.');
            return null;
        }

        var database = null;

        var result = Ext.device.Communicator.send({
            command: 'SQLite#openDatabase',
            sync: true,
            name: config.name,
            version: config.version,
            displayName: config.displayName,
            estimatedSize: config.estimatedSize,
            callbacks: {
                // `creationCallback != null` is checked for internal logic in native plugin code
                creationCallback: !config.creationCallback ? null : function() {
                    config.creationCallback.call(config.scope || this, database);
                }
            },
            scope: config.scope || this
        });

        if (result) {
            if (result.error) {
                Ext.Logger.error(result.error);
                return null;
            }

            database = Ext.create('Ext.device.sqlite.Database', result.id, result.version);

            return database;
        }

        return null;
    }
function(config) {
        if (config.name == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `name` of the database.');
            return null;
        }

        if (config.version == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `version` of the database.');
            return null;
        }

        if (config.displayName == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `displayName` of the database.');
            return null;
        }

        if (config.estimatedSize == null) {
            Ext.Logger.error('Ext.device.SQLite#openDatabase: You must specify a `estimatedSize` of the database.');
            return null;
        }

        var database = null;

        var result = Ext.device.Communicator.send({
            command: 'SQLite#openDatabase',
            sync: true,
            name: config.name,
            version: config.version,
            displayName: config.displayName,
            estimatedSize: config.estimatedSize,
            callbacks: {
                // `creationCallback != null` is checked for internal logic in native plugin code
                creationCallback: !config.creationCallback ? null : function() {
                    config.creationCallback.call(config.scope || this, database);
                }
            },
            scope: config.scope || this
        });

        if (result) {
            if (result.error) {
                Ext.Logger.error(result.error);
                return null;
            }

            database = Ext.create('Ext.device.sqlite.Database', result.id, result.version);

            return database;
        }

        return null;
    }
Returns a {@link Ext.device.sqlite.Database} instance.
If the database with specified name does not exist, it will be created.
If the creationCallback is provided,
the database is created with the empty string as its version regardless of the specified version.

@param {Object} config
The object which contains the following config options:

@param {String} config.name This is required.
The name of the database to open.

@param {String} config.version This is required.
The version of the database to open.

@param {String} config.displayName This is required.
The display name of the database to open.

@param {Number} config.estimatedSize This is required.
The estimated size of the database to open.

@param {Function} config.creationCallback This is optional.
The callback to be called when the database has been created.

@param {Ext.device.sqlite.Database} config.creationCallback.database
The created database with the empty string as its version regardless of the specified version.

@param {Object} config.scope This is optional.
The scope object.

@return {Ext.device.sqlite.Database}
The opened database, null if an error occured.