sql

abstract fun sql(sqlId: String, block: SqlBuilder.() -> Unit): KueryClient.FetchSpec(source)

Builds SQL using the received SqlBuilder block and returns a FetchSpec to obtain the execution results.

Note that the statement is not executed until one of the terminal operations on FetchSpec is invoked.

Return

a FetchSpec for retrieving the execution results

Parameters

sqlId

an ID that uniquely identifies the query, used for purposes such as metrics

block

SqlBuilder block that constructs the SQL


abstract fun sql(block: SqlBuilder.() -> Unit): KueryClient.FetchSpec(source)

Builds SQL using the received SqlBuilder block and returns a FetchSpec to obtain the execution results.

Note that the statement is not executed until one of the terminal operations on FetchSpec is invoked.

The sqlId is derived from the enclosing declaration of the call site at compile time by the compiler plugin and used when auto sqlId generation is enabled. "NONE" is used when auto sqlId generation is disabled, when the block is passed via a variable rather than written literally at the call site, or when the call site was not compiled with the compiler plugin.

Return

a FetchSpec for retrieving the execution results

Parameters

block

SqlBuilder block that constructs the SQL