QueryContext

data class QueryContext(val sql: String, val parameters: Map<String, Any?>, val dbSql: String? = null, val dbParameters: List<Any?>? = null)

Context of a database operation execution.

Contains all the information needed to reproduce or debug a failed query, including both the high-level query and the low-level SQL sent to the database.

Attached to an OctaviusException as it propagates out of a query, and rendered into its toString. The two levels differ only for a named query, where the statement is rewritten before it is sent; for a native query they are the same text.

Constructors

Link copied to clipboard
constructor(sql: String, parameters: Map<String, Any?>, dbSql: String? = null, dbParameters: List<Any?>? = null)

Properties

Link copied to clipboard

The values in the positional order they were bound in. null where the failure happened before binding.

Link copied to clipboard

The statement actually sent to the server, with names rewritten to $n. null where the failure happened before that rewriting.

Link copied to clipboard

The values as they were supplied — by name for a named query, by position as "1", "2", … for a native one.

Link copied to clipboard
val sql: String

The statement as it was written, named parameters and all.

Functions

Link copied to clipboard
open override fun toString(): String