BlackBerry Dynamics for .NET Maui  12.0.0.9
Runtime library for .NET Maui applications
Secure SQL Database programming interface⁩

The secure SQL database is part of the BlackBerry Dynamics secure storage feature.

Data stored in the secure SQL database is encrypted on the device by the BlackBerry Dynamics Runtime.

The BlackBerry Dynamics secure SQL database is based on the SQLite library. Encryption is added transparently to the application by BlackBerry Dynamics.

The secure SQL database cannot be accessed until BlackBerry Dynamics authorization processing is complete. The BlackBerry Dynamics secure store also includes a secure file system

See also
https://github.com/praeclarum/sqlite-net, the home page of the SQLite-net project.

Overview of the programming interface

BlackBerry Dynamics .NET Maui applications can access the secure database using the replacements for the SQLite-net (SQLite namespace) programming interface with a number of additional functions (see below).

To access the replacement classes instead of the original classes, change SQLite to BBDXamarinForms.Common.Library.SecureDatabase wherever it occurs in the application code. For example, utilize the following using statement:

The replacement packages support the same programming interface as the original SQLite-net, with the following exceptions:

  • See the exceptions noted for the underlying BlackBerry Dynamics SDKs: iOS Secure SQL Database and Android Secure SQL Database.
  • There are additional functions, ImportDatabase and RawQuery (see below for more details).
  • Paths of database files are interpreted relative to the root of the BlackBerry Dynamics secure file system. The root of the secure file system is within the application's data directory. This means that there is no need to utilize functions to generate database file paths.
See also
https://github.com/praeclarum/sqlite-net/blob/master/README.md, for the reference documentation of the normal SQLite-net programming interface.

Additional Functions

ImportDatabase - BBDXamarinForms.Common.Library.SecureDatabase.SQLiteConnection.ImportDatabase

RawQuery - BBDXamarinForms.Common.Library.SecureDatabase.SQLiteConnection.RawQuery

Code Snippets

The following code snippets illustrate some common tasks.

Open database

using (var db = new SQLiteConnection("contacts.db"))
{
//DB operations
}

This snippet shows how to open the database in the contacts.db file in the secure file system. The database is created if it does not already exist.

BBDXamarinForms.Common
Definition: BBDICCForegroundOptions.cs:6
BBDXamarinForms
Definition: BBDICCForegroundOptions.cs:6
BBDXamarinForms.Common.Library.SecureDatabase
Definition: SQLite.ImportDatabase.cs:10
BBDXamarinForms.Common.Library
Definition: SQLite.ImportDatabase.cs:10