api-docs / org.ktorm.expression / ScalarExpression
ScalarExpression
abstract class ScalarExpression<T : Any> :
SqlExpression,
ColumnDeclaring<T>
(source code)Base class of scalar expressions. An expression is “scalar” if it has a return value (eg. a + 1
).
Parameters
T
- the return value’s type of this scalar expression.
Constructors
Name | Summary |
---|---|
ScalarExpression() Base class of scalar expressions. An expression is “scalar” if it has a return value (eg. |
Properties
Name | Summary |
---|---|
The SqlType of this column or expression. |
Inherited Properties
Name | Summary |
---|---|
Extra properties of this expression, maybe useful in SqlFormatter to generate some special SQLs. | |
abstract val isLeafNode: Boolean Check if this expression is a leaf node in expression trees. |
Functions
Name | Summary |
---|---|
open fun aliased( Wrap this instance as a ColumnDeclaringExpression. | |
open fun asExpression(): ScalarExpression<T> Convert this instance to a ScalarExpression. | |
open fun wrapArgument(argument: T?): ArgumentExpression<T> Wrap the given argument as an ArgumentExpression using the sqlType. |
Extension Functions
Name | Summary |
---|---|
infix fun ColumnDeclaring<Boolean>.and( infix fun ColumnDeclaring<Boolean>.and( And operator, translated to the | |
fun ColumnDeclaring<*>.asc(): OrderByExpression Order this column or expression in ascending order. | |
fun <T : Any> ColumnDeclaring<*>.cast( Cast the current column or expression to the given SqlType. | |
fun ColumnDeclaring<HStore>.containedIn( fun ColumnDeclaring<HStore>.containedIn( HStore contained-in operator, translated to the <@ operator in PostgreSQL. | |
fun ColumnDeclaring<Cube>.contains( fun ColumnDeclaring<Cube>.contains( fun ColumnDeclaring<Cube>.contains( fun ColumnDeclaring<Cube>.contains( Cube contains operator, translated to the @> operator in PostgreSQL. fun ColumnDeclaring<HStore>.contains( fun ColumnDeclaring<HStore>.contains( HStore contains operator, translated to the @> operator in PostgreSQL. | |
fun ColumnDeclaring<HStore>.containsAll( fun ColumnDeclaring<HStore>.containsAll( HStore contains-all-keys operator, translated to the ?& operator in PostgreSQL. | |
fun ColumnDeclaring<HStore>.containsAny( fun ColumnDeclaring<HStore>.containsAny( HStore contains-any-keys operator, translated to the ?| operator in PostgreSQL. | |
fun ColumnDeclaring<HStore>.containsKey( fun ColumnDeclaring<HStore>.containsKey( HStore contains-key operator, translated to the ? operator in PostgreSQL. | |
fun ColumnDeclaring<*>.desc(): OrderByExpression Order this column or expression in descending order, corresponding to the | |
infix operator fun <T : Number> ColumnDeclaring<T>.div( infix operator fun <T : Number> ColumnDeclaring<T>.div( Divide operator, translated to | |
infix fun <T : Any> ColumnDeclaring<T>.eq( infix fun <T : Any> ColumnDeclaring<T>.eq( infix fun <T : Any> T.eq( Equal operator, translated to | |
operator fun ColumnDeclaring<HStore>.get( operator fun ColumnDeclaring<HStore>.get( HStore get-value-for-key operator, translated to the -> operator in PostgreSQL. operator fun ColumnDeclaring<HStore>.get( operator fun ColumnDeclaring<HStore>.get( HStore get-values-for-keys operator, translated to the -> operator in PostgreSQL. | |
fun <T : Any> ColumnDeclaring<T>.ifNull( fun <T : Any> ColumnDeclaring<T>.ifNull( MySQL ifnull function, translated to | |
fun <T : Any> ColumnDeclaring<T>.ifNull( fun <T : Any> ColumnDeclaring<T>.ifNull( SQLite ifnull function, translated to | |
infix fun ColumnDeclaring<*>.ilike( infix fun ColumnDeclaring<*>.ilike( ILike operator, translated to the | |
fun <T : Any> ColumnDeclaring<T>.inList( infix fun <T : Any> ColumnDeclaring<T>.inList( infix fun ColumnDeclaring<*>.inList( In-list operator, translated to the | |
fun ColumnDeclaring<String>.instr( fun ColumnDeclaring<String>.instr( SQLite instr function, translated to | |
fun ColumnDeclaring<*>.isNotNull(): UnaryExpression<Boolean> Check if the current column or expression is not null, translated to | |
fun ColumnDeclaring<*>.isNull(): UnaryExpression<Boolean> Check if the current column or expression is null, translated to | |
fun <T : Any> ColumnDeclaring<*>.jsonExtract( SQLite json_extract function, translated to | |
fun ColumnDeclaring<*>.jsonPatch( SQLite json_patch function, translated to | |
fun ColumnDeclaring<*>.jsonRemove( SQLite json_remove function, translated to | |
fun ColumnDeclaring<*>.jsonValid(): FunctionExpression<Boolean> SQLite json_valid function, translated to | |
infix fun ColumnDeclaring<*>.like( infix fun ColumnDeclaring<*>.like( Like operator, translated to the | |
infix operator fun <T : Number> ColumnDeclaring<T>.minus( infix operator fun <T : Number> ColumnDeclaring<T>.minus( Minus operator, translated to | |
operator fun ColumnDeclaring<HStore>.minus( operator fun ColumnDeclaring<HStore>.minus( HStore delete-key operator, translated to the - operator in PostgreSQL. operator fun ColumnDeclaring<HStore>.minus( operator fun ColumnDeclaring<HStore>.minus( HStore delete-keys operator, translated to the - operator in PostgreSQL. operator fun ColumnDeclaring<HStore>.minus( operator fun ColumnDeclaring<HStore>.minus( HStore delete-matching-pairs operator, translated to the - operator in PostgreSQL. | |
infix fun <T : Any> ColumnDeclaring<T>.neq( infix fun <T : Any> ColumnDeclaring<T>.neq( infix fun <T : Any> T.neq( Not-equal operator, translated to | |
operator fun ColumnDeclaring<Boolean>.not(): UnaryExpression<Boolean> Negative operator, translated to the | |
infix fun <T : Any> ColumnDeclaring<T>.notEq( infix fun <T : Any> ColumnDeclaring<T>.notEq( infix fun <T : Any> T.notEq( Not-equal operator, translated to | |
fun <T : Any> ColumnDeclaring<T>.notInList( infix fun <T : Any> ColumnDeclaring<T>.notInList( infix fun ColumnDeclaring<*>.notInList( Not-in-list operator, translated to the | |
infix fun ColumnDeclaring<*>.notLike( infix fun ColumnDeclaring<*>.notLike( Not like operator, translated to the | |
infix fun ColumnDeclaring<Boolean>.or( infix fun ColumnDeclaring<Boolean>.or( Or operator, translated to the | |
fun ColumnDeclaring<Cube>.overlaps( fun ColumnDeclaring<Cube>.overlaps( Cube overlap operator, translated to the && operator in PostgreSQL. | |
infix operator fun <T : Number> ColumnDeclaring<T>.plus( infix operator fun <T : Number> ColumnDeclaring<T>.plus( Plus operator, translated to | |
operator fun ColumnDeclaring<HStore>.plus( operator fun ColumnDeclaring<HStore>.plus( HStore concatenate operator, translated to the || operator in PostgreSQL. | |
infix operator fun <T : Number> ColumnDeclaring<T>.rem( infix operator fun <T : Number> ColumnDeclaring<T>.rem( Mod operator, translated to | |
infix operator fun <T : Number> ColumnDeclaring<T>.times( infix operator fun <T : Number> ColumnDeclaring<T>.times( Multiply operator, translated to | |
fun ColumnDeclaring<out Number>.toDouble(): CastingExpression<Double> Cast the current column or expression’s type to Double. | |
fun ColumnDeclaring<out Number>.toFloat(): CastingExpression<Float> Cast the current column or expression’s type to Float. | |
fun ColumnDeclaring<out Number>.toLong(): CastingExpression<Long> Cast the current column or expression’s type to Long. | |
fun ColumnDeclaring<out Number>.toShort(): CastingExpression<Short> Cast the current column or expression’s type to Short. | |
operator fun <T : Number> ColumnDeclaring<T>.unaryMinus(): UnaryExpression<T> Unary minus operator, translated to | |
operator fun <T : Number> ColumnDeclaring<T>.unaryPlus(): UnaryExpression<T> Unary plus operator, translated to | |
infix fun ColumnDeclaring<Boolean>.xor( infix fun ColumnDeclaring<Boolean>.xor( Xor operator, translated to the |
Inheritors
Name | Summary |
---|---|
data class AggregateExpression<T : Any> : ScalarExpression<T> Aggregate expression. | |
data class ArgumentExpression<T : Any> : ScalarExpression<T> Argument expression, wraps an argument passed to the executed SQL. | |
data class BetweenExpression : ScalarExpression<Boolean> Between expression, check if a scalar expression is in the given range. | |
data class BinaryExpression<T : Any> : ScalarExpression<T> Binary expression. | |
data class CaseWhenExpression<T : Any> : ScalarExpression<T> Case-when expression, represents a SQL case-when clause. | |
data class CastingExpression<T : Any> : ScalarExpression<T> Wrap a SQL expression, changing its return type, translated to SQl cast(expr as type). | |
data class ColumnDeclaringExpression<T : Any> : Column declaring expression, represents the selected columns in a SelectExpression. | |
data class ColumnExpression<T : Any> : ScalarExpression<T> Column expression. | |
data class CubeExpression<T : Any> : ScalarExpression<T> Expression class represents PostgreSQL | |
data class DefaultValueExpression<T : Any> : Default value expression, translated to the | |
data class DefaultValueExpression<T : Any> : Default value expression, translated to the | |
data class ExistsExpression : ScalarExpression<Boolean> Exists expression, check if the specific query has at least one result. | |
data class FunctionExpression<T : Any> : ScalarExpression<T> Function expression, represents a normal SQL function call. | |
data class HStoreExpression<T : Any> : ScalarExpression<T> Expression class represents PostgreSQL | |
data class ILikeExpression : ScalarExpression<Boolean> ILike expression, represents PostgreSQL | |
data class InListExpression : ScalarExpression<Boolean> In-list expression, translated to the | |
data class MatchAgainstExpression : ScalarExpression<Boolean> Match against expression, represents an | |
data class UnaryExpression<T : Any> : ScalarExpression<T> Unary expression. | |
data class WindowFunctionExpression<T : Any> : Window function expression, represents a SQL window function call. |