diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Expression.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Expression.kt index aa877af..1358cd7 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Expression.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Expression.kt @@ -1,6 +1,6 @@ package ru.landgrafhomyak.serdha.api.v0.misc -public interface Expression, OwnerBuilderUserExtension : Any> { +public interface Expression, OwnerBuilderUserExtension : Any> { public interface Builder { } diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Input.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Input.kt new file mode 100644 index 0000000..13c50a4 --- /dev/null +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/Input.kt @@ -0,0 +1,9 @@ +package ru.landgrafhomyak.serdha.api.v0.misc + +public interface Input, OwnerQueryUserExtension : Any> : Expression { + public val name: String + public val userWrapper: OwnerQueryUserExtension + + public interface QueryParam, OwnerQueryUserExtension : Any> : Expression + public interface Column, OwnerQueryUserExtension : Any> : Expression +} \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/InputParam.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/InputParam.kt deleted file mode 100644 index 7a37fe7..0000000 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/InputParam.kt +++ /dev/null @@ -1,6 +0,0 @@ -package ru.landgrafhomyak.serdha.api.v0.misc - -public interface InputParam, OwnerQueryUserExtension : Any> : Expression { - public val name: String - public val userWrapper: OwnerQueryUserExtension -} \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/RuntimeExpression.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/RuntimeExpression.kt index ce88db5..6818466 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/RuntimeExpression.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/RuntimeExpression.kt @@ -7,7 +7,7 @@ public interface RuntimeExpression { public val userExtension: ExpressionUserExtension public interface RuntimeExpressionInput, ExpressionUserExtension : Any> : Column - public interface RuntimeExpressionOutput, ExpressionUserExtension : Any> : InputParam + public interface RuntimeExpressionOutput, ExpressionUserExtension : Any> : Input.QueryParam public fun interface InputLinker { public fun link(linker: Scope) diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedColumn.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedColumn.kt new file mode 100644 index 0000000..d69d581 --- /dev/null +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedColumn.kt @@ -0,0 +1,3 @@ +package ru.landgrafhomyak.serdha.api.v0.misc + +public interface SelectedColumn, @Suppress("unused") OwnerTableUserExtension : Any, OwnerBuilderUserExtension : Any> : Expression \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedTable.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedTable.kt index 001fdd7..b3a8d30 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedTable.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/misc/SelectedTable.kt @@ -1,5 +1,9 @@ package ru.landgrafhomyak.serdha.api.v0.misc public interface SelectedTable { - public fun > selectColumn(column: Column): Expression + public fun > selectColumn(column: Column): SelectedColumn + + public interface WithParamsRedirect : SelectedTable { + public fun > setParam(subqueryParam: Input.QueryParam, parentParam: Input.QueryParam) + } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/CopyQuery.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/CopyQuery.kt index c3ab0ad..5dc4ccb 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/CopyQuery.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/CopyQuery.kt @@ -9,31 +9,12 @@ import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType public interface CopyQuery { public val userExtension: QueryUserExtension - /** - * Functional interface for creating 'INSERT ... FROM' query. - * - * Can be implemented like a companion object that just calls [QueryUserExtension]'s constructor with the same or similar signature. - * - * @param QueryUserExtension User's type with descriptors related to query. - * @param TargetTableUserExtension User's type with descriptors related to table to which values will be inserted. - * - * @see CreateModuleScope.createCopyQuery - * @see CreateModuleScope.createTemporaryCopyQuery - */ + public interface Creator { - /** - * Scope method that uses [creator] to create a query. - * - * @param table Descriptor of table to which values will be inserted. - * @param creator Object with descriptor providers and factories. - * @return User's object with query-related descriptors for future access. - * - * @see CreateModuleScope.createCopyQuery - * @see CreateModuleScope.createTemporaryCopyQuery - */ + public fun createCopy(table: Table, creator: Scope): QueryUserExtension - public interface Scope : _CreateInsertOrCopyQueryScope { + public interface Scope { public fun > insert(column: Column, expression: Expression) } } diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/DeleteQuery.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/DeleteQuery.kt index d266c75..433174c 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/DeleteQuery.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/DeleteQuery.kt @@ -1,46 +1,40 @@ package ru.landgrafhomyak.serdha.api.v0.queries -import ru.landgrafhomyak.serdha.api.v0.misc.Expression -import ru.landgrafhomyak.serdha.api.v0.module.CreateModuleScope -import ru.landgrafhomyak.serdha.api.v0.table.Table +import ru.landgrafhomyak.serdha.api.v0.misc.Column import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType +import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseTypesProvider +import ru.landgrafhomyak.serdha.api.v0.misc.Input +import ru.landgrafhomyak.serdha.api.v0.misc.SelectedColumn import ru.landgrafhomyak.serdha.api.v0.misc.SelectedTable +import ru.landgrafhomyak.serdha.api.v0.table.Table -public interface DeleteQuery : _CommonCreateQueryScope.CanBeSubquery { +@Suppress("RemoveRedundantQualifierName") +public interface DeleteQuery { public val userExtension: QueryUserExtension - /** - * Functional interface for creating 'DELETE' query. - * - * Can be implemented like a companion object that just calls [QueryUserExtension]'s constructor with the same or similar signature. - * - * @param QueryUserExtension User's type with descriptors related to query. - * @param TargetTableUserExtension User's type with descriptors related to table from which data will be deleted. - * - * @see CreateModuleScope.createDeleteQuery - * @see CreateModuleScope.createTemporaryDeleteQuery - */ - public interface Creator { - /** - * Scope method that uses [creator] to create a query. - * - * @param table Descriptor of table from which data will be deleted. - * @param creator Object with descriptor providers and factories. - * @return User's object with query-related descriptors for future access. - * - * @see CreateModuleScope.createDeleteQuery - * @see CreateModuleScope.createTemporaryDeleteQuery - */ - public fun createDelete(table: Table, creator: Scope): QueryUserExtension + public interface Creator { + public fun createDelete(table: Table, creator: DeleteQuery.Creator.Scope): QueryUserExtension - public interface Scope : _CommonCreateQueryScope { - public val targetTable: SelectedTable + public interface Scope { + public val selector: SelectedTable.WithParamsRedirect - public fun where(expression: Expression) + public var selectorColumn: SelectedColumn<*, DatabaseType.ROW_ID, SelectorTableUserExtension, QueryUserExtension> - public fun limit(size: UInt) + public val types: DatabaseTypesProvider - public val returning: _CommonCreateQueryScope._ReturningClauseScope + public fun > param(name: String, type: DT): Input.QueryParam + } + } + + public interface WithReturning : DeleteQuery, _Selectable { + public interface Creator { + public fun createDelete(table: Table, creator: DeleteQuery.WithReturning.Creator.Scope): QueryUserExtension + + public interface Scope : DeleteQuery.Creator.Scope { + public val removedValues: SelectedTable + + public fun > returnColumn(c: SelectedColumn): Column + } } } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/InsertQuery.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/InsertQuery.kt index 5bb731d..c0e8927 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/InsertQuery.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/InsertQuery.kt @@ -1,52 +1,99 @@ package ru.landgrafhomyak.serdha.api.v0.queries import ru.landgrafhomyak.serdha.api.v0.misc.Expression -import ru.landgrafhomyak.serdha.api.v0.module.CreateModuleScope import ru.landgrafhomyak.serdha.api.v0.misc.Column import ru.landgrafhomyak.serdha.api.v0.table.Table import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType -import ru.landgrafhomyak.serdha.api.v0.misc.InputParam +import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseTypesProvider +import ru.landgrafhomyak.serdha.api.v0.misc.Input +import ru.landgrafhomyak.serdha.api.v0.misc.SelectedColumn +import ru.landgrafhomyak.serdha.api.v0.misc.SelectedTable +import ru.landgrafhomyak.serdha.api.v0.table.UniqueIndex public interface InsertQuery { public val userExtension: QueryUserExtension - /** - * Functional interface for creating 'INSERT ... VALUES' query. - * - * Can be implemented like a companion object that just calls [QueryUserExtension]'s constructor with the same or similar signature. - * - * @param QueryUserExtension User's type with descriptors related to query. - * @param TargetTableUserExtension User's type with descriptors related to table to which values will be inserted. - * - * @see CreateModuleScope.createInsertQuery - * @see CreateModuleScope.createTemporaryInsertQuery - */ - public interface Creator { - /** - * Scope method that uses [creator] to create a query. - * - * @param table Descriptor of table to which values will be inserted. - * @param creator Object with descriptor providers and factories. - * @return User's object with query-related descriptors for future access. - * - * @see CreateModuleScope.createInsertQuery - * @see CreateModuleScope.createTemporaryInsertQuery - */ - public fun createInsert(table: Table, creator: Scope): QueryUserExtension + @Suppress("ClassName") + public interface _UpsertClauseScope { + public fun keepColumn(c: Column<*, *, TargetTableUserExtension>) + public fun overrideColumn(c: Column<*, *, TargetTableUserExtension>) + public fun setConstant(c: Input.QueryParam<*, *, QueryUserExtension>) + } - public interface Scope : _CreateInsertOrCopyQueryScope { - public class DataParam<@Suppress("unused") QueryUserExtension : Any> private constructor() + @Suppress("ClassName") + public interface _CommonInsertCreatorScope { + public val types: DatabaseTypesProvider - public val dataExpressionBuilder: Expression.Builder> + public fun > queryParam(name: String, type: DT): Input.Column - public fun > dataParam(name: String, type: DT): InputParam> + public fun > insertConstant( + column: Column, + paramName: String = column.name, + ): Input.QueryParam - public fun > insertParam( - column: Column, - paramName: String = column.name, - ): InputParam> + public fun onConflictUpdate(u: UniqueIndex, c: (_UpsertClauseScope) -> Unit) - public fun > insert(column: Column, expression: Expression>) + public fun onConflictThrow(u: UniqueIndex) + + public fun onConflictSkip(u: UniqueIndex) + } + + + public interface SingleRow : InsertQuery { + public interface Creator { + public fun createInsertSingleRow(table: Table, creator: Scope): QueryUserExtension + + public interface Scope : _CommonInsertCreatorScope { + } + } + + public interface WithReturning : SingleRow, _Selectable { + public fun createInsertSingleRowWithReturning(table: Table, creator: Scope): QueryUserExtension + + public interface Scope : _CommonInsertCreatorScope { + public val valuesAfterInsert: SelectedTable + + public fun onConflictReturnOnly(u: UniqueIndex) + + public fun > returnColumn(c: SelectedColumn): Column + } + } + } + + + public interface FromSubquery : InsertQuery { + public interface Creator { + public fun createInsertFromQuery(table: Table, creator: Scope): QueryUserExtension + + public interface Scope : _CommonInsertCreatorScope { + public val sourceValues: SelectedTable + + public fun > insertColumn(dst: Column, src: SelectedColumn) + } + } + + public interface WithReturning : FromSubquery, _Selectable { + public fun createInsertSingleRowWithReturning(table: Table, creator: Scope): QueryUserExtension + + public interface Scope : _CommonInsertCreatorScope { + public val valuesAfterInsert: SelectedTable + + public fun onConflictReturnOnly(u: UniqueIndex) + + public fun > returnColumn(c: SelectedColumn): Column + } + } + } + + public interface MultipleRows : InsertQuery { + public interface Creator { + public fun createInsertMultipleRows(table: Table, creator: Scope): QueryUserExtension + + public interface Scope : _CommonInsertCreatorScope { + public fun > inputColumn(name: String, type: DT): Input.Column + + public fun > insertColumn(dst: Column, src: Input.Column) + } } } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/SelectQuery.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/SelectQuery.kt index 68a5bd6..117b25a 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/SelectQuery.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/SelectQuery.kt @@ -2,44 +2,38 @@ package ru.landgrafhomyak.serdha.api.v0.queries import ru.landgrafhomyak.serdha.api.v0.misc.Expression import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType -import ru.landgrafhomyak.serdha.api.v0.module.CreateModuleScope +import ru.landgrafhomyak.serdha.api.v0.misc.SelectedTable -public interface SelectQuery : _CommonCreateQueryScope.CanBeSubquery { +public interface SelectQuery : _Selectable { public val userExtension: QueryUserExtension public enum class Order { ASC, DESC } - /** - * Functional interface for creating 'SELECT' query. - * - * Can be implemented like a companion object that just calls [QueryUserWrapper]'s constructor with the same or similar signature. - * - * @param QueryUserWrapper User's type with descriptors related to query. - * - * @see CreateModuleScope.createSelectQuery - * @see CreateModuleScope.createTemporarySelectQuery - */ - public interface Creator { - /** - * Scope method that uses [creator] to create a query. - * - * @param creator Object with descriptor providers and factories. - * @return User's object with query-related descriptors for future access. - * - * @see CreateModuleScope.createSelectQuery - * @see CreateModuleScope.createTemporarySelectQuery - */ - public fun createSelect(creator: Scope): QueryUserWrapper + @Suppress("ClassName") + public interface _CommonSelectCreatorScope { + public fun where(expression: Expression) - public interface Scope : _CommonCreateQueryScope, _CommonCreateQueryScope._ReturningClauseScope { - public fun where(expression: Expression) + public var limit: UInt - public fun limit(size: UInt) + public var offset: ULong + } - @Suppress("SpellCheckingInspection") - public fun offsetedLimit(offset: ULong, size: UInt) + public interface JoinCreator : _CommonSelectCreatorScope { + public fun createSelectWithJoin(creator: Scope): QueryUserExtension + + public interface Scope { + public val leftTable: SelectedTable + public val rightTable: SelectedTable + } + } + + public interface Creator { + public fun createSelect(creator: Scope): QueryUserExtension + + public interface Scope : _CommonSelectCreatorScope { + public val selectedTable: TableUserExtension } } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/UpdateQuery.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/UpdateQuery.kt index 0123ef8..0dbebbb 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/UpdateQuery.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/UpdateQuery.kt @@ -1,54 +1,39 @@ package ru.landgrafhomyak.serdha.api.v0.queries -import ru.landgrafhomyak.serdha.api.v0.misc.Expression -import ru.landgrafhomyak.serdha.api.v0.module.CreateModuleScope import ru.landgrafhomyak.serdha.api.v0.misc.Column import ru.landgrafhomyak.serdha.api.v0.table.Table import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType +import ru.landgrafhomyak.serdha.api.v0.misc.Input +import ru.landgrafhomyak.serdha.api.v0.misc.SelectedColumn import ru.landgrafhomyak.serdha.api.v0.misc.SelectedTable -public interface UpdateQuery : _CommonCreateQueryScope.CanBeSubquery { +@Suppress("RemoveRedundantQualifierName") +public interface UpdateQuery { public val userExtension: QueryUserExtension - /** - * Functional interface for creating 'UPDATE' query. - * - * Can be implemented like a companion object that just calls [QueryUserWrapper]'s constructor with the same or similar signature. - * - * @param QueryUserWrapper User's type with descriptors related to query. - * @param TableUserExtension User's type with descriptors related to table, whose rows will be updated. - * - * @see CreateModuleScope.createUpdateQuery - * @see CreateModuleScope.createTemporaryUpdateQuery - */ - public interface Creator { - /** - * Scope method that uses [creator] to create a query. - * - * @param table Descriptor of table which rows will be updated. - * @param creator Object with descriptor providers and factories. - * @return User's object with query-related descriptors for future access. - * - * @see CreateModuleScope.createUpdateQuery - * @see CreateModuleScope.createTemporaryUpdateQuery - */ - public fun createUpdate(table: Table, creator: Scope): QueryUserWrapper + public interface Creator { + public fun createUpdate(table: Table, creator: Scope): QueryUserWrapper - public interface Scope : _CommonCreateQueryScope { - public val targetTable: SelectedTable + public interface Scope { + public val oldValues: SelectedTable - public fun > selectOldColumnValue(c: Column): Expression + public val selector: SelectedTable.WithParamsRedirect - public fun > updateColumn(c: Column, e: Expression) + public var selectorColumn: SelectedColumn<*, DatabaseType.ROW_ID, SelectorTableUserExtension, QueryUserExtension> - public fun where(expression: Expression) + public fun > updateColumn(c: Column, e: SelectedColumn) - public fun limit(size: UInt) + public fun > param(name: String, type: DT): Input.QueryParam + } + } - @Suppress("SpellCheckingInspection") - public fun offsetedLimit(offset: ULong, size: UInt) + public interface WithReturning : UpdateQuery, _Selectable { + public interface Creator { + public fun createDelete(table: Table, creator: UpdateQuery.WithReturning.Creator.Scope): QueryUserExtension - public val returning: _CommonCreateQueryScope._ReturningClauseScope + public interface Scope : UpdateQuery.Creator.Scope { + public fun > returnColumn(c: SelectedColumn): Column + } } } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_CommonCreateQueryScope.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_CommonCreateQueryScope.kt index 8a0ff25..6b56665 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_CommonCreateQueryScope.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_CommonCreateQueryScope.kt @@ -1,73 +1,29 @@ package ru.landgrafhomyak.serdha.api.v0.queries import ru.landgrafhomyak.serdha.api.v0.misc.Expression -import ru.landgrafhomyak.serdha.api.v0.LowLevelApi import ru.landgrafhomyak.serdha.api.v0.misc.Column import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseType -import ru.landgrafhomyak.serdha.api.v0.table.Table import ru.landgrafhomyak.serdha.api.v0.misc.DatabaseTypesProvider -import ru.landgrafhomyak.serdha.api.v0.misc.InputParam -import ru.landgrafhomyak.serdha.api.v0.misc.SelectedTable +import ru.landgrafhomyak.serdha.api.v0.misc.Input import ru.landgrafhomyak.serdha.api.v0.runtime.ParametersSetter -import ru.landgrafhomyak.serdha.api.v0.runtime._ParametersSetter @Suppress("ClassName") public interface _CommonCreateQueryScope { public val types: DatabaseTypesProvider - public fun selectTable(t: Table): SelectedTable - - public interface CanBeSubquery<@Suppress("unused") SelectedQueryUserExtension : Any> + public val expressionBuilder: Expression.Builder public interface SubqueryParametersSetter : ParametersSetter { - public operator fun > set(c: InputParam, value: Expression) + public operator fun > set(c: Input.QueryParam, value: Expression) } - public fun selectQuery(q: CanBeSubquery, p: (SubqueryParametersSetter) -> Unit): SelectedTable - - public class SelectedDiff( - public val inserted: SelectedTable, - public val updated: SelectedTable - ) - - public fun selectInsert(q: InsertQuery, p: (SubqueryParametersSetter) -> Unit): SelectedDiff - - @Suppress("FunctionName") - @LowLevelApi - public fun _selectCopy( - q: CopyQuery, - p: (SubqueryParametersSetter) -> Unit, - r: (_ParametersSetter._Multi, Nothing>) -> Unit - ): SelectedDiff - - @OptIn(LowLevelApi::class) - public fun selectCopyOne( - q: CopyQuery, - p: (SubqueryParametersSetter) -> Unit, - r: (ParametersSetter>) -> Unit - ): SelectedDiff = - this._selectCopy(q, p, r) - - @OptIn(LowLevelApi::class) - public fun selectCopyMulti( - q: CopyQuery, - p: (SubqueryParametersSetter) -> Unit, - data: Iterable, - r: (T, ParametersSetter>) -> Unit - ): SelectedDiff = - this._selectCopy(q, p) { rr -> for (e in data) r(e, rr) } - - public fun > param(name: String, type: DT): InputParam - - public val expressionBuilder: Expression.Builder - public interface _ReturningClauseScope { public fun > returnExpression(expression: Expression): Column - public val isDistinct: Boolean + public var isDistinct: Boolean - public fun orderBy(order: SelectQuery.Order, vararg columns: Expression<*, *, QueryUserExtension>) + public fun orderBy(order: SelectQuery.Order, vararg columns: Column<*, *, QueryUserExtension>) - public fun groupBy(vararg columns: Expression<*, *, QueryUserExtension>) + public fun groupBy(vararg columns: Column<*, *, QueryUserExtension>) } } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_Selectable.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_Selectable.kt new file mode 100644 index 0000000..89562dc --- /dev/null +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/queries/_Selectable.kt @@ -0,0 +1,4 @@ +package ru.landgrafhomyak.serdha.api.v0.queries + +@Suppress("ClassName") +public interface _Selectable<@Suppress("unused") QueryUserExtension : Any> \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/ParametersSetter.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/ParametersSetter.kt index 8383d91..4b9a1f2 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/ParametersSetter.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/ParametersSetter.kt @@ -1,18 +1,18 @@ package ru.landgrafhomyak.serdha.api.v0.runtime -import ru.landgrafhomyak.serdha.api.v0.misc.InputParam +import ru.landgrafhomyak.serdha.api.v0.misc.Input -public interface ParametersSetter { - public operator fun set(c: InputParam, value: RuntimeType) +public interface ParametersSetter { + public operator fun set(c: Input, value: RuntimeType) - public operator fun set(c: InputParam, value: Byte): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: UByte): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: Short): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: UShort): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: Int): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: UInt): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: Long): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: ULong): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: Char): Unit = this.set(c, value) - public operator fun set(c: InputParam, value: Boolean): Unit = this.set(c, value) + public operator fun set(c: Input, value: Byte): Unit = this.set(c, value) + public operator fun set(c: Input, value: UByte): Unit = this.set(c, value) + public operator fun set(c: Input, value: Short): Unit = this.set(c, value) + public operator fun set(c: Input, value: UShort): Unit = this.set(c, value) + public operator fun set(c: Input, value: Int): Unit = this.set(c, value) + public operator fun set(c: Input, value: UInt): Unit = this.set(c, value) + public operator fun set(c: Input, value: Long): Unit = this.set(c, value) + public operator fun set(c: Input, value: ULong): Unit = this.set(c, value) + public operator fun set(c: Input, value: Char): Unit = this.set(c, value) + public operator fun set(c: Input, value: Boolean): Unit = this.set(c, value) } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/table/Table.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/table/Table.kt index 96e2f6e..fc70f03 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/table/Table.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/table/Table.kt @@ -1,8 +1,9 @@ package ru.landgrafhomyak.serdha.api.v0.table import ru.landgrafhomyak.serdha.api.v0.module.Module +import ru.landgrafhomyak.serdha.api.v0.queries._Selectable -public interface Table { +public interface Table : _Selectable { public val userExtension: UserExtension public val name: String public val module: Module<*>