Expression builder interface

This commit is contained in:
Andrew Golovashevich 2024-11-29 22:52:08 +03:00
parent ab93292246
commit ef5c277bf1
3 changed files with 11 additions and 5 deletions

View File

@ -2,9 +2,11 @@ package ru.landgrafhomyak.serdha.api.v0
import ru.landgrafhomyak.serdha.api.v0.ddl.ColumnType import ru.landgrafhomyak.serdha.api.v0.ddl.ColumnType
public interface Expression<RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>, OwnerBuilderUserWrapper : Any> { public interface Expression<RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>, OwnerBuilderUserExtension : Any> {
public class Equals<RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>, OwnerBuilderUserWrapper : Any>( public interface Builder<OwnerBuilderUserExtension : Any> {
public val left: Expression<RuntimeType, DatabaseType, OwnerBuilderUserWrapper>, public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>> equals(
public val right: Expression<RuntimeType, DatabaseType, OwnerBuilderUserWrapper>, left: Expression<RuntimeType, DatabaseType, OwnerBuilderUserExtension>,
) : Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserWrapper> right: Expression<RuntimeType, DatabaseType, OwnerBuilderUserExtension>
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
}
} }

View File

@ -4,6 +4,8 @@ import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.Expression import ru.landgrafhomyak.serdha.api.v0.Expression
public interface TableCreator<TableUserExtension : Any> { public interface TableCreator<TableUserExtension : Any> {
public val expressionBuilder: Expression.Builder<TableUserExtension>
/** /**
* Offers column of type [D][type] with `NOT NULL` constraint named [name] and runtime type [RuntimeType]. * Offers column of type [D][type] with `NOT NULL` constraint named [name] and runtime type [RuntimeType].
* *

View File

@ -11,6 +11,8 @@ public interface _CommonQueryMethods<QueryUserExtension : Any> {
public fun <SelectedQueryUserExtension : Any> selectQuery(t: Select<SelectedQueryUserExtension>): SelectedTable<SelectedQueryUserExtension, QueryUserExtension> public fun <SelectedQueryUserExtension : Any> selectQuery(t: Select<SelectedQueryUserExtension>): SelectedTable<SelectedQueryUserExtension, QueryUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>> param(name: String, type: DatabaseType): InputParam<RuntimeType, DatabaseType, QueryUserExtension> public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>> param(name: String, type: DatabaseType): InputParam<RuntimeType, DatabaseType, QueryUserExtension>
public val expressionBuilder: Expression.Builder<QueryUserExtension>
public interface _Returning<QueryUserExtension : Any> { public interface _Returning<QueryUserExtension : Any> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>> returnExpression(expression: Expression<RuntimeType, DatabaseType, QueryUserExtension>): Column<RuntimeType, DatabaseType, QueryUserExtension> public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType & Any>> returnExpression(expression: Expression<RuntimeType, DatabaseType, QueryUserExtension>): Column<RuntimeType, DatabaseType, QueryUserExtension>