Das135
11/04/2020, 11:35 AMSELECT 'custom1' as custom, id, name, address FROM persons
Bogdan
11/04/2020, 4:34 PMobject Persons : IntIdTable() {
val name = varchar("name", 255)
val address = varchar("address", 500)
}
fun main() {
Database.connect("jdbc:h2:mem:regular;DB_CLOSE_DELAY=-1;", "org.h2.Driver")
transaction {
SchemaUtils.create(Persons)
Persons.insert {
it[name] = "Name"
it[address] = "Addresss"
}
Persons.selectAll().forEach(::println)
val custom = stringParam("custom1").alias("custom")
Persons.slice(Persons.columns + custom)
// or .slice(listOf(custom) + Persons.columns) first custom
.selectAll()
.forEach { println(it[custom]) }
}
}
Das135
11/05/2020, 8:56 AMstringParam
is exactly what I need 🙂