selectExpression

suspend fun <T> DatabaseClient<*>.selectExpression(type: KClass<T & Any>, columnSet: ColumnSet, expression: Expression<T>, buildQuery: Query.() -> Query): RowSet<T>(source)
inline suspend fun <T> DatabaseClient<*>.selectExpression(columnSet: ColumnSet, expression: Expression<T>, noinline buildQuery: Query.() -> Query): RowSet<T>(source)

SQL: SELECT <expression> FROM <table>;. Examples: SELECT COUNT(*) FROM <table>;, SELECT SUM(<column>) FROM <table>;.

This function distinguishes from the overload without a columnSet parameter in that it selects from a certain ColumnSet, which may be a Table or a Join.


suspend fun <T> DatabaseClient<*>.selectExpression(type: KClass<T & Any>, expression: Expression<T>): T(source)

SQL: SELECT <expression>; without FROM in the outermost/top-level statement. Example: SELECT EXISTS(<query>).

Also see https://github.com/JetBrains/Exposed/issues/621.

I can't think of a case where this function should return multiple results in a RowSet. If there are any in your use cases, please submit an issue.


inline suspend fun <T> DatabaseClient<*>.selectExpression(expression: Expression<T>): T(source)

SQL: SELECT <expression>; without FROM in the outermost/top-level statement. Example: SELECT EXISTS(<query>).

I can't think of a case where this function should return multiple results in a RowSet. If there are any in your use cases, please submit an issue.


suspend fun <T> DatabaseClient<*>.selectExpression(columnSet: ColumnSet, expression: Expression<T>, buildQuery: Query.() -> Query, getFieldExpressionSetWithExposedTransaction: Boolean = config.autoExposedTransaction): RowSet<T>(source)

Deprecated

Use the overload without the `getFieldExpressionSetWithExposedTransaction` parameter, which is implemented more efficiently.

Replace with

this.selectExpression(columnSet, expression, buildQuery)

SQL: SELECT <expression> FROM <table>;. Examples: SELECT COUNT(*) FROM <table>;, SELECT SUM(<column>) FROM <table>;.

This function distinguishes from the overload without a columnSet parameter in that it selects from a certain ColumnSet, which may be a Table or a Join.

Also see https://github.com/JetBrains/Exposed/issues/621.