Package-level declarations

Types

Link copied to clipboard
internal class CteClause

The WITH clause, which every builder here can carry and none of them renders differently.

Link copied to clipboard
class DeleteQuery @PublishedApi constructor(provider: SessionProvider, table: String) : RunnableQuery<DeleteQuery>

A DELETE under construction.

Link copied to clipboard
class InsertQuery @PublishedApi constructor(provider: SessionProvider, table: String) : RunnableQuery<InsertQuery>

An INSERT under construction.

Link copied to clipboard

What to do about rows a FOR UPDATE finds already locked.

Link copied to clipboard
class OnConflictClause @PublishedApi constructor

The ON CONFLICT clause of an InsertQuery, configured inside InsertQuery.onConflict.

Link copied to clipboard
class QueryFragment(val sql: String, val params: Map<String, Any?> = emptyMap())

A piece of SQL and the parameters it names, kept together so that neither can be dropped on the way.

Link copied to clipboard
class RawQuery @PublishedApi constructor(provider: SessionProvider, sql: String) : RunnableQuery<RawQuery>

SQL written by hand, with @name parameters, carrying the same terminal methods every builder carries.

Link copied to clipboard
class ResultQuery @PublishedApi constructor(val query: RunnableQuery<*>)

The same query, with every terminal handing back a DataResult instead of throwing.

Link copied to clipboard
abstract class RunnableQuery<T : RunnableQuery<T>> @PublishedApi constructor(val queryProvider: SessionProvider)

Something that knows how to produce a query, and can therefore be run.

Link copied to clipboard
class SelectQuery @PublishedApi constructor(provider: SessionProvider, selectClause: String) : RunnableQuery<SelectQuery>

A SELECT under construction.

Link copied to clipboard
class UpdateQuery @PublishedApi constructor(provider: SessionProvider, table: String) : RunnableQuery<UpdateQuery>

An UPDATE under construction.

Functions

Link copied to clipboard
internal fun StringBuilder.appendClause(keyword: String, body: String?)

Appends a clause where its body carries anything, and does nothing where it does not.

Link copied to clipboard
fun List<QueryFragment>.join(separator: String, prefix: String = "", postfix: String = "", addParenthesis: Boolean = true): QueryFragment

Joins the fragments that carry anything, merging their parameters.

Link copied to clipboard
internal inline fun requireBuildable(value: Boolean, message: () -> String)

Refuses a query the builder cannot render, naming what is missing.

Link copied to clipboard

Pairs this SQL text with one parameter it names.

Link copied to clipboard
infix fun String.withParams(params: Map<String, Any?>): QueryFragment

Pairs this SQL text with the parameters it names.