English | 简体中文

api-docs / me.liuwj.ktorm.schema / ColumnDeclaring

ColumnDeclaring

interface ColumnDeclaring<T : Any> (source code)

Common interface of Column and ScalarExpression.

Properties

NameSummary

sqlType

abstract val sqlType: SqlType<T>

The SqlType of this column or expression.

Functions

NameSummary

aliased

abstract fun aliased(
    label: String?
): ColumnDeclaringExpression<T>

Wrap this instance as a ColumnDeclaringExpression.

asExpression

abstract fun asExpression(): ScalarExpression<T>

Convert this instance to a ScalarExpression.

wrapArgument

abstract fun wrapArgument(
    argument: T?
): ArgumentExpression<T>

Wrap the given argument as an ArgumentExpression using the sqlType.

Extension Functions

NameSummary

and


infix fun ColumnDeclaring<Boolean>.and(
    argument: Boolean
): BinaryExpression<Boolean>

And operator, translated to the and keyword in SQL.

asc

Order this column or expression in ascending order.

between

infix fun <T : Comparable<T>> ColumnDeclaring<T>.between(
    range: ClosedRange<T>
): BetweenExpression<T>

Between operator, translated to between .. and .. in SQL.

cast

fun <T : Any> ColumnDeclaring<*>.cast(
    sqlType: SqlType<T>
): CastingExpression<T>

Cast the current column or expression to the given SqlType.

desc

Order this column or expression in descending order, corresponding to the desc keyword in SQL.

div

infix operator fun <T : Number> ColumnDeclaring<T>.div(
    expr: ColumnDeclaring<T>
): BinaryExpression<T>

infix operator fun <T : Number> ColumnDeclaring<T>.div(
    argument: T
): BinaryExpression<T>

Divide operator, translated to / in SQL.

eq

infix fun <T : Any> ColumnDeclaring<T>.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Any> ColumnDeclaring<T>.eq(
    argument: T
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

greater

infix fun <T : Comparable<T>> ColumnDeclaring<T>.greater(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Comparable<T>> ColumnDeclaring<T>.greater(
    argument: T
): BinaryExpression<Boolean>

Greater operator, translated to > in SQL.

greaterEq

infix fun <T : Comparable<T>> ColumnDeclaring<T>.greaterEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Comparable<T>> ColumnDeclaring<T>.greaterEq(
    argument: T
): BinaryExpression<Boolean>

Greater-eq operator, translated to >= in SQL.

ifNull

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: ColumnDeclaring<T>
): FunctionExpression<T>

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: T?
): FunctionExpression<T>

MySQL ifnull function, translated to ifnull(left, right).

ilike

infix fun ColumnDeclaring<*>.ilike(
    expr: ColumnDeclaring<String>
): ILikeExpression

infix fun ColumnDeclaring<*>.ilike(
    argument: String
): ILikeExpression

ILike operator, translated to the ilike keyword in PostgreSQL.

inList

fun <T : Any> ColumnDeclaring<T>.inList(
    vararg list: T
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.inList(
    list: Collection<T>
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.inList(
    query: Query
): InListExpression<T>

In-list operator, translated to the in keyword in SQL.

isNotNull

Check if the current column or expression is not null, translated to is not null in SQL.

isNull

Check if the current column or expression is null, translated to is null in SQL.

less

infix fun <T : Comparable<T>> ColumnDeclaring<T>.less(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Comparable<T>> ColumnDeclaring<T>.less(
    argument: T
): BinaryExpression<Boolean>

Less operator, translated to < in SQL.

lessEq

infix fun <T : Comparable<T>> ColumnDeclaring<T>.lessEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Comparable<T>> ColumnDeclaring<T>.lessEq(
    argument: T
): BinaryExpression<Boolean>

Less-eq operator, translated to <= in SQL.

like

infix fun ColumnDeclaring<*>.like(
    expr: ColumnDeclaring<String>
): BinaryExpression<Boolean>

infix fun ColumnDeclaring<*>.like(
    argument: String
): BinaryExpression<Boolean>

Like operator, translated to the like keyword in SQL.

minus

infix operator fun <T : Number> ColumnDeclaring<T>.minus(
    expr: ColumnDeclaring<T>
): BinaryExpression<T>

infix operator fun <T : Number> ColumnDeclaring<T>.minus(
    argument: T
): BinaryExpression<T>

Minus operator, translated to - in SQL.

not

Negative operator, translated to the not keyword in SQL.

notBetween

infix fun <T : Comparable<T>> ColumnDeclaring<T>.notBetween(
    range: ClosedRange<T>
): BetweenExpression<T>

Not-between operator, translated to not between .. and .. in SQL.

notEq

infix fun <T : Any> ColumnDeclaring<T>.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Any> ColumnDeclaring<T>.notEq(
    argument: T
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

notInList

fun <T : Any> ColumnDeclaring<T>.notInList(
    vararg list: T
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.notInList(
    list: Collection<T>
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.notInList(
    query: Query
): InListExpression<T>

Not-in-list operator, translated to the not in keyword in SQL.

notLike

infix fun ColumnDeclaring<*>.notLike(
    expr: ColumnDeclaring<String>
): BinaryExpression<Boolean>

infix fun ColumnDeclaring<*>.notLike(
    argument: String
): BinaryExpression<Boolean>

Not like operator, translated to the not like keyword in SQL.

or


infix fun ColumnDeclaring<Boolean>.or(
    argument: Boolean
): BinaryExpression<Boolean>

Or operator, translated to the or keyword in SQL.

plus

infix operator fun <T : Number> ColumnDeclaring<T>.plus(
    expr: ColumnDeclaring<T>
): BinaryExpression<T>

infix operator fun <T : Number> ColumnDeclaring<T>.plus(
    argument: T
): BinaryExpression<T>

Plus operator, translated to + in SQL.

rem

infix operator fun <T : Number> ColumnDeclaring<T>.rem(
    expr: ColumnDeclaring<T>
): BinaryExpression<T>

infix operator fun <T : Number> ColumnDeclaring<T>.rem(
    argument: T
): BinaryExpression<T>

Mod operator, translated to % in SQL.

replace

fun ColumnDeclaring<String>.replace(
    oldValue: String,
    newValue: String
): FunctionExpression<String>

MySQL replace function, translated to replace(str, oldValue, newValue).

times

infix operator fun <T : Number> ColumnDeclaring<T>.times(
    expr: ColumnDeclaring<T>
): BinaryExpression<T>

infix operator fun <T : Number> ColumnDeclaring<T>.times(
    argument: T
): BinaryExpression<T>

Multiply operator, translated to * in SQL.

toDouble

Cast the current column or expression’s type to Double.

toFloat

Cast the current column or expression’s type to Float.

toInt

Cast the current column or expression’s type to Int.

toLong

Cast the current column or expression’s type to Long.

unaryMinus

operator fun <T : Number> ColumnDeclaring<T>.unaryMinus(): UnaryExpression<T>

Unary minus operator, translated to - in SQL.

unaryPlus

operator fun <T : Number> ColumnDeclaring<T>.unaryPlus(): UnaryExpression<T>

Unary plus operator, translated to + in SQL.

xor


infix fun ColumnDeclaring<Boolean>.xor(
    argument: Boolean
): BinaryExpression<Boolean>

Xor operator, translated to the xor keyword in SQL.

Inheritors

NameSummary

Column

data class Column<T : Any> : ColumnDeclaring<T>

Represents database columns.

ScalarExpression

abstract class ScalarExpression<T : Any> : 
    SqlExpression,
    ColumnDeclaring<T>

Base class of scalar expressions. An expression is “scalar” if it has a return value (eg. a + 1).