fun select(columns: List<Column<*>>): Builder
Run a SELECT statement over the given columns. See SelectQuery.Builder for parameters and arguments that can be set. The query is run within the code block given to SelectQuery.Builder.run when that code executes SelectQuery.next.
Usage example:
db.select(People.columns).from(People) + "WHERE " + People.name + " <> " + param run
{ query ->
query[param] = "Bob Dobbs" // Hide Bob, if he's there
while (query.next()) {
println("name: ${query[People.name]}")
println("worried: ${query[People.worried]}")
}
}
fun select(vararg columns: Column<*>): Builder
Run a SELECT statement over the given columns. See SelectQuery.Builder for parameters and arguments that can be set. The query is run within the code block given to SelectQuery.Builder.run when that code executes SelectQuery.next.
Usage example:
db.select(Users.name, Cities.name).from(Users) +
" INNER JOIN " + Cities + " ON " + Cities.id + "=" + Users.cityId +
" ORDER BY " + Users.name run
{ r ->
while (r.next()) {
println("\t${r[Users.name]}\t${r[Cities.name]}")
}
}