forColumn

inline fun <reified T, reified R> forColumn(columnName: String, crossinline convert: (T) -> R)

Register a converter for a specific column by name. Column-name overrides take precedence over type-name overrides registered via forType.

Type Parameters

T

the storage class of the raw stored value.

R

the target Kotlin type for the resulting DataFrame column.


inline fun <reified T> forColumn(columnName: String)

Register an identity converter for a specific column by name: values pass through unchanged, but the DataFrame column type is fixed to T (resolved via typeOf<T>()). Column-name overrides take precedence over type-name overrides.

Useful for a single column whose declared SQL type is misleading — either because SQLite's type affinity picks the wrong bucket or because you want a stricter type than the shared declared type would give.

Type Parameters

T

the target Kotlin type for the resulting DataFrame column — must be one of the storage-class types the driver actually returns (String, Int, Long, Double, or ByteArray or their nullable variants).

Example

Sqlite.withCustomConverters {
forColumn<String>("uuid") // treat the `uuid` column as raw text
forColumn<ByteArray?>("payload")
}