stringColumn

protected fun stringColumn(name: String): KQLiteColumn<String?>

Defines a nullable TEXT column in the table, intended to store a String.

This function creates and registers a column with the SQL type TEXT, which is used for storing character strings of variable length. The column is nullable by default. This is functionally equivalent to textColumn.

Example:

object Users : KQLiteTable("users") {
// A nullable TEXT column for the user's email
val email = stringColumn("user_email")

// A non-null column with a unique constraint
val username = stringColumn("username").notNull().unique()
}

Return

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

Author

MOHAMMAD AZIM ANSARI

Parameters

name

The name of the column in the database.

See also