Don Kittle
03/04/2025, 3:37 PMColumn<*>
type, though, which cannot be used in a .where
as there don't seem to be extension functions like .eq
defined for Column<*>
. What is the proper way to do this? My column finder function is:
fun findColumn(table: Table, column: String): Column<*> =
table.columns.find {
it.name.lowercase() == column.lowercase() ||
it.name.lowercase() == column.toSnakeCase() ||
it.name.lowercase() == column.toKebabCase()
} ?: error("Could not find column $column in table ${table.tableName}")
maxmello
03/05/2025, 8:23 AM.castTo(columnType)
which would make sure the operation will work in most cases on da DB level as well as being “available” in Exposed because of proper typing of the column.