realColumn

protected fun realColumn(name: String): KQLiteColumn<Double?>

Defines a nullable REAL column in the table, intended to store a Double.

This function creates and registers a column with the SQL type REAL, which is used to store 8-byte IEEE floating-point numbers (Double in Kotlin). The column is nullable by default. This function is functionally equivalent to doubleColumn.

Example:

object Measurements : KQLiteTable("measurements") {
// A nullable REAL column for a scientific measurement
val value = realColumn("reading_value")

// A non-null REAL column with a default value
val latitude = realColumn("latitude").notNull().default(0.0)
}

Return

A KQLiteColumn instance representing the REAL column, which can be further chained with constraints like notNull(), default(), etc.

Author

MOHAMMAD AZIM ANSARI

Parameters

name

The name of the column in the database.

See also