charColumn

protected fun charColumn(name: String): KQLiteColumn<Char?>

Defines a nullable CHAR(1) column in the table, intended to store a single Char.

This function creates and registers a column with the type CHAR(1). KQLite will handle the conversion between a single-character string in the database and a Kotlin Char type in your application. The column is nullable by default.

Important: Stored value in this column must either be NULL or exactly one character.

Example:

object UserProfiles : KQLiteTable("user_profiles") {
// A nullable CHAR(1) column for a user's initial
val middleInitial = charColumn("middle_initial")

// A non-null column for a status code (e.g., 'A' for Active, 'I' for Inactive)
val status = charColumn("status").notNull().default('A')
}

Return

A KQLiteColumn instance representing the CHAR(1) 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