db9010 / com.jovial.db9010 / SelectQuery / Builder

Builder

class Builder : TextStatementBuilder<Key>

A builder for a SelectQuery. See Database.select.

Constructors

<init>

A builder for a SelectQuery. See Database.select.

Builder(db: Database, columns: List<Column<*>>)

Functions

forUpdate

Sets this select statement as FOR UPDATE, thereby enabling calls to SelectQuery.update, SelectQuery.delete and SelectQuery.insert.

fun forUpdate(): Builder

from

Specify the tables for the FROM clause of this SELECT statement. Must be called exactly once per statement.

fun from(vararg tables: Table): Builder

getReusable

Gives a reference to a reusable query object. This allows clients to avoid the (small) lookup overhead for a frequently-used select query.

fun getReusable(): ReusableSelectQuery

run

Runs body with a reference to this query. The body should set any needed Parameter values using the appropriate setters, then execute the query by calling SelectQuery.next or SelectQuery.nextOrFail. It can supsequently fetch results by calling the appropriate setters.

infix fun <T> run(body: (SelectQuery) -> T): T