BundledSQLiteDriver



A SQLiteDriver that uses a bundled version of SQLite included as a native component of this library.

The bundled SQLite used by this driver is compiled in multi-thread mode which means connections opened by the driver are NOT thread-safe. If multiple connections are desired, then a connection pool is required in order for the connections be used in a multi-thread and concurrent environment. If only a single connection is needed then a thread-safe connection can be opened by using the SQLITE_OPEN_FULLMUTEX flag. If the connection usage is exclusively single threaded, then no additional configuration is required.

Summary

Public constructors

Cmn
android

Public functions

open SQLiteConnection
open(fileName: String)

Opens a new database connection.

Cmn
android
SQLiteConnection
open(fileName: String, flags: Int)

Opens a new database connection.

Cmn
android

Public properties

open Boolean

Identifies whether the driver has an internal connection pool or not.

android

Inherited properties

From androidx.sqlite.SQLiteDriver
open Boolean

Identifies whether the driver has an internal connection pool or not.

Cmn

Public constructors

BundledSQLiteDriver

BundledSQLiteDriver()

BundledSQLiteDriver

BundledSQLiteDriver()

Public functions

open

open fun open(fileName: String): SQLiteConnection

Opens a new database connection.

To open an in-memory database use the special name :memory: as the fileName.

Parameters
fileName: String

Name of the database file.

Returns
SQLiteConnection

the database connection.

open

fun open(fileName: String, flags: Int): SQLiteConnection

Opens a new database connection.

See also Opening A New Database Connection

Parameters
fileName: String

Name of the database file.

flags: Int

Connection open flags.

Returns
SQLiteConnection

the database connection.

Public properties

hasConnectionPool

open val hasConnectionPoolBoolean

Identifies whether the driver has an internal connection pool or not.

A driver with an internal pool should be capable of opening connections that are safe to be used in a multi-thread and concurrent environment whereas a driver that does not have an internal pool will require the application to manage connections in a thread-safe manner. A driver might not report containing a connection pool but might still be safe to be used in a multi-thread environment, such behavior will depend on the driver implementation.

The value returned should be used as a signal to higher abstractions in order to determine if the driver and its connections should be managed by an external connection pool or not.