# SupportSQLiteDriver

Artifact: [androidx.sqlite:sqlite-framework](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/driver/SupportSQLiteDriver.android.kt+class:androidx.sqlite.driver.SupportSQLiteDriver) Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.6.0)

*** ** * ** ***

Android/JVMNative/C/iOS
- android

  ```
  class SupportSQLiteDriver : SQLiteDriver
  ```

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteDriver` implemented by `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper` and that uses the Android's SQLite through the `SupportSQLite` APIs.

This driver internally has a connection pool and a opened connection from it is safe to be used in a multi-thread and concurrent environment.

This driver can only open connections whose `fileName` match the given `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteDriver#openHelper()` database name (`https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper#databaseName()`) or `:memory:` if the `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteDriver#openHelper()` was configured with a `null` name, indicating an in-memory database.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteDriver#SupportSQLiteDriver(androidx.sqlite.db.SupportSQLiteOpenHelper)(openHelper: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper)` | android |

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteConnection` | `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteDriver#open(kotlin.String)(fileName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Opens a new database connection. | android |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteDriver#hasConnectionPool()` Identifies whether the driver has an internal connection pool or not. | android |

## Public constructors

### SupportSQLiteDriver

android Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.6.0)

```
SupportSQLiteDriver(openHelper: SupportSQLiteOpenHelper)
```

## Public functions

### open

android Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.6.0)

```
open fun open(fileName: String): SupportSQLiteConnection
```

Opens a new database connection.

To open an in-memory database use the special name `:memory:` as the `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteDriver#open(kotlin.String)`.

| Parameters |
|---|---|
| `fileName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of the database file. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/driver/SupportSQLiteConnection` | the database connection. |

## Public properties

### hasConnectionPool

android

```
open val hasConnectionPool: Boolean
```

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.