CustomExpr

open class CustomExpr<T>(val text: String, columnType: IColumnType<T & Any>) : Function<T>

An Exposed Function that embeds raw SQL text as a typed expression in queries.

Security: text is appended to the generated SQL verbatim, with no escaping or parameter binding, so never build it from user input or other request data: anything that reaches it is executed as SQL (SQL injection). Reserve it for fixed SQL fragments such as NOW() or CURRENT_DATE, and use Exposed's parameterized expressions (for example stringParam(...) or a comparison against a column) for anything derived from a request.

Parameters

columnType

the Exposed column type used for result mapping

Type Parameters

T

the Kotlin type this expression evaluates to

Constructors

Link copied to clipboard
constructor(text: String, columnType: IColumnType<T & Any>)

Properties

Link copied to clipboard
open override val columnType: IColumnType<T & Any>
Link copied to clipboard

the raw SQL expression text; a fixed SQL fragment, never user input

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toQueryBuilder(queryBuilder: QueryBuilder)
Link copied to clipboard
open override fun toString(): String