# androidx.core.database

*** ** * ** ***

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/database/CursorWindowCompat` | Helper for accessing features in `https://developer.android.com/reference/android/database/CursorWindow.html` |
| `https://developer.android.com/reference/kotlin/androidx/core/database/DatabaseUtilsCompat` | **This class is deprecated.** Use `https://developer.android.com/reference/android/database/DatabaseUtils.html` directly. <br /> |

## Extension functions summary

|---|---|
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getBlobOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable byte array. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getDoubleOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable double. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getFloatOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable float. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getIntOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable integer. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getLongOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable long. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getShortOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable short. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/android/database/Cursor.html.https://developer.android.com/reference/kotlin/androidx/core/database/package-summary#(android.database.Cursor).getStringOrNull(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the value of the requested column as a nullable string. |

## Extension functions

### Cursor.getBlobOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getBlobOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getBlobOrNull(index: Int): ByteArray?
```

Returns the value of the requested column as a nullable byte array.

The result and whether this method throws an exception when the column type is not a blob type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getBlob(int)` |   |

### Cursor.getDoubleOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getDoubleOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getDoubleOrNull(index: Int): Double?
```

Returns the value of the requested column as a nullable double.

The result and whether this method throws an exception when the column type is not a floating-point type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getDouble(int)` |   |

### Cursor.getFloatOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getFloatOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getFloatOrNull(index: Int): Float?
```

Returns the value of the requested column as a nullable float.

The result and whether this method throws an exception when the column type is not a floating-point type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getFloat(int)` |   |

### Cursor.getIntOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getIntOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getIntOrNull(index: Int): Int?
```

Returns the value of the requested column as a nullable integer.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getInt(int)` |   |

### Cursor.getLongOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getLongOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getLongOrNull(index: Int): Long?
```

Returns the value of the requested column as a nullable long.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getLong(int)` |   |

### Cursor.getShortOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getShortOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getShortOrNull(index: Int): Short?
```

Returns the value of the requested column as a nullable short.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getShort(int)` |   |

### Cursor.getStringOrNull

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/database/Cursor.kt+function:getStringOrNull) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun Cursor.getStringOrNull(index: Int): String?
```

Returns the value of the requested column as a nullable string.

The result and whether this method throws an exception when the column type is not a string type is implementation-defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/database/Cursor.html#isNull(int)` |   |
| `https://developer.android.com/reference/android/database/Cursor.html#getString(int)` |   |