Skip to main content

String Operations

Like

val row = ShopTable
.where(ShopTable.name like "%Hardware%")
.where(ShopTable.name notLike "%Groceries%")
.perform(db)
.single()

check(hardwareStoreId == row.getValue(ShopTable.id))

Upper and lower

val (lowerName, upperName) = ShopTable
.where(ShopTable.id eq hardwareStoreId)
.select(
lower(ShopTable.name) as_ label(),
upper(ShopTable.name) as_ label(),
)
.perform(db)
.single()

check("helen's hardware" == lowerName)
check("HELEN'S HARDWARE" == upperName)