doubleColumn

protected fun doubleColumn(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.

Example:

object Products : KQLiteTable("products") {
// A nullable REAL column for the product price
val price = doubleColumn("price")

// A non-null column for a discount rate with a default value
val discountRate = doubleColumn("discount_rate").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