androidx.core.database

Classes

CursorWindowCompat

Helper for accessing features in android.database.CursorWindow

DatabaseUtilsCompat

Helper for accessing features in android.database.DatabaseUtils.

Extension functions summary

For android.database.Cursor
ByteArray
Cursor.getBlob(columnName: String)

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

Double
Cursor.getDouble(columnName: String)

Returns the value of the requested column as a double.

Float
Cursor.getFloat(columnName: String)

Returns the value of the requested column as a float.

Int
Cursor.getInt(columnName: String)

Returns the value of the requested column as an integer.

Long
Cursor.getLong(columnName: String)

Returns the value of the requested column as a long.

Short
Cursor.getShort(columnName: String)

Returns the value of the requested column as a short.

String
Cursor.getString(columnName: String)

Returns the value of the requested column as a string.

ByteArray?

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

ByteArray?

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

Double?

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

Double?

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

Float?

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

Float?

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

Int?

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

Int?
Cursor.getIntOrNull(columnName: String)

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

Long?

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

Long?

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

Short?

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

Short?

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

String?

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

String?

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

Extension functions

getBlob

inline fun Cursor.getBlob(columnName: String): ByteArray

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

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

getBlobOrNull

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.

getBlobOrNull

inline fun Cursor.getBlobOrNull(columnName: String): 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.

getDouble

inline fun Cursor.getDouble(columnName: String): Double

Returns the value of the requested column as a double.

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

getDoubleOrNull

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.

getDoubleOrNull

inline fun Cursor.getDoubleOrNull(columnName: String): 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.

getFloat

inline fun Cursor.getFloat(columnName: String): Float

Returns the value of the requested column as a float.

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

getFloatOrNull

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.

getFloatOrNull

inline fun Cursor.getFloatOrNull(columnName: String): 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.

getInt

inline fun Cursor.getInt(columnName: String): Int

Returns the value of the requested column as an integer.

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

getIntOrNull

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.

getIntOrNull

inline fun Cursor.getIntOrNull(columnName: String): 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.

getLong

inline fun Cursor.getLong(columnName: String): Long

Returns the value of the requested column as a long.

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

getLongOrNull

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.

getLongOrNull

inline fun Cursor.getLongOrNull(columnName: String): 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.

getShort

inline fun Cursor.getShort(columnName: String): Short

Returns the value of the requested column as a short.

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

getShortOrNull

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.

getShortOrNull

inline fun Cursor.getShortOrNull(columnName: String): 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.

getString

inline fun Cursor.getString(columnName: String): String

Returns the value of the requested column as a string.

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

getStringOrNull

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.

getStringOrNull

inline fun Cursor.getStringOrNull(columnName: String): 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.