# androidx.sqlite

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteConnection` | SQLite connection definition. | Cmn android JS |
| `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteDriver` | An interface to open database connections. | Cmn android JS |
| `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteStatement` | SQLite statement definition. | Cmn android JS |

## Exceptions

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteException` | An exception that indicates that something has gone wrong and a error code was produced. | Cmn android N JS |

## Type aliases

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteException` | An exception that indicates that something has gone wrong and a error code was produced. | android |

## Constants summary

|---|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#SQLITE_DATA_BLOB() = 4` The data type for a `BLOB` value, i.e. binary data. | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#SQLITE_DATA_FLOAT() = 2` The data type for a 64-bit IEEE floating point number. | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#SQLITE_DATA_INTEGER() = 1` The data type for a 64-bit signed integer. | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#SQLITE_DATA_NULL() = 5` The data type for a `NULL` value. | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#SQLITE_DATA_TEXT() = 3` The data type for a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html`. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#throwSQLiteException(kotlin.Int,kotlin.String)(errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, errorMsg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Throws a `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteException` with its message formed by the given `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#throwSQLiteException(kotlin.Int,kotlin.String)` amd `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#throwSQLiteException(kotlin.Int,kotlin.String)`. | Cmn |

## Extension functions summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteConnection.https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#(androidx.sqlite.SQLiteConnection).execSQL(kotlin.String)(sql: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Executes a single SQL statement that returns no values. | android |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteConnection.https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#(androidx.sqlite.SQLiteConnection).executeSQL(kotlin.String)(sql: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Executes a single SQL statement asynchronously that returns no values. | Cmn android JS |
| `suspend https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteConnection` | `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteDriver.https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#(androidx.sqlite.SQLiteDriver).open(kotlin.String)(fileName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Opens a new database connection. | Cmn android JS |
| `suspend https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteStatement` | `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteConnection.https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#(androidx.sqlite.SQLiteConnection).prepare(kotlin.String)(sql: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Prepares a new SQL statement asynchronously. | Cmn android JS |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteStatement.https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#(androidx.sqlite.SQLiteStatement).step()()` Executes the statement asynchronously and evaluates the next result row if available. | Cmn android JS |

## Constants

### SQLITE_DATA_BLOB

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+symbol:SQLITE_DATA_BLOB) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
const val SQLITE_DATA_BLOB = 4: Int
```

The data type for a `BLOB` value, i.e. binary data.

### SQLITE_DATA_FLOAT

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+symbol:SQLITE_DATA_FLOAT) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
const val SQLITE_DATA_FLOAT = 2: Int
```

The data type for a 64-bit IEEE floating point number.

### SQLITE_DATA_INTEGER

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+symbol:SQLITE_DATA_INTEGER) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
const val SQLITE_DATA_INTEGER = 1: Int
```

The data type for a 64-bit signed integer.

### SQLITE_DATA_NULL

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+symbol:SQLITE_DATA_NULL) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
const val SQLITE_DATA_NULL = 5: Int
```

The data type for a `NULL` value.

### SQLITE_DATA_TEXT

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+symbol:SQLITE_DATA_TEXT) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
const val SQLITE_DATA_TEXT = 3: Int
```

The data type for a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html`.

## Top-level functions

### throwSQLiteException

Cmn Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.kt+function:throwSQLiteException) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
fun throwSQLiteException(errorCode: Int, errorMsg: String?): Nothing
```

Throws a `https://developer.android.com/reference/kotlin/androidx/sqlite/SQLiteException` with its message formed by the given `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#throwSQLiteException(kotlin.Int,kotlin.String)` amd `https://developer.android.com/reference/kotlin/androidx/sqlite/package-summary#throwSQLiteException(kotlin.Int,kotlin.String)`.

## Extension functions

### SQLiteConnection.execSQL

android Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.nonWeb.kt+function:execSQL) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
fun SQLiteConnection.execSQL(sql: String): Unit
```

Executes a single SQL statement that returns no values.

### SQLiteConnection.executeSQL

Cmn android JS Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.+function:executeSQL) Added in [2.7.0-alpha02](https://developer.android.com/jetpack/androidx/releases/sqlite#2.7.0-alpha02)

```
suspend fun SQLiteConnection.executeSQL(sql: String): Unit
```

Executes a single SQL statement asynchronously that returns no values.

On web targets this function is asynchronous while for non-web it is synchronous.

### SQLiteDriver.open

Cmn android JS Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.+function:open)

```
suspend fun SQLiteDriver.open(fileName: String): SQLiteConnection
```

Opens a new database connection.

On web targets this function is asynchronous while for non-web it is synchronous.

### SQLiteConnection.prepare

Cmn android JS Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.+function:prepare)

```
suspend fun SQLiteConnection.prepare(sql: String): SQLiteStatement
```

Prepares a new SQL statement asynchronously.

On web targets this function is asynchronous while for non-web it is synchronous.

### SQLiteStatement.step

Cmn android JS Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/SQLite.+function:step)

```
suspend fun SQLiteStatement.step(): Boolean
```

Executes the statement asynchronously and evaluates the next result row if available.

On web targets this function is asynchronous while for non-web it is synchronous.