byte Column
Defines a nullable TINYINT column in the table, intended to store a Byte.
This function creates and registers a column with the type TINYINT. While SQLite's INTEGER type can store up to a 64-bit signed integer, this function maps it to Kotlin's 8-bit Byte for cases where a very small integer range is sufficient, such as storing flags or small enumeration-like values. The column is nullable by default.
Example:
object MediaFlags : KQLiteTable("media_flags") {
// A nullable TINYINT column for a media type identifier
val mediaType = byteColumn("media_type") // e.g., 0=image, 1=video, 2=audio
// A non-null column for a status flag
val status = byteColumn("status").notNull().default(0)
}Content copied to clipboard
Return
A KQLiteColumn instance representing the TINYINT 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.