Compare commits

..

9 Commits

18 changed files with 1237 additions and 290 deletions

View File

@ -19,7 +19,7 @@ buildscript {
}
group = "ru.landgrafhomyak.db.serdha"
version = "0.0"
version = "0.1"
repositories {
mavenCentral()

View File

@ -11,7 +11,7 @@ import ru.landgrafhomyak.db.serdha0.api.queries.UpdateQuery
import ru.landgrafhomyak.db.serdha0.api.queries._Query
import ru.landgrafhomyak.db.serdha0.api.table.Table
public class InlineSelectConstructor<qUE : Any, sqUE : Any>(
public open class InlineSelectConstructor<qUE : Any, sqUE : Any>(
override val source: _Selectable<sqUE>,
private val constructor: (SelectQuery.Simple.Constructor.Scope<qUE, sqUE>) -> qUE
) : SelectQuery.Simple.Constructor<qUE, sqUE> {
@ -23,7 +23,7 @@ public fun <qUE : Any, sqUE : Any> _Query.Constructor._SelectsScope.select(
source: _Selectable<sqUE>, constructor: (SelectQuery.Simple.Constructor.Scope<qUE, sqUE>) -> qUE
): SelectQuery.Simple<qUE> = this.select(InlineSelectConstructor(source, constructor))
public class InlineSelectReducingConstructor<qUE : Any, sqUE : Any>(
public open class InlineSelectReducingConstructor<qUE : Any, sqUE : Any>(
override val source: _Selectable<sqUE>,
private val constructor: (SelectQuery.Reducing.Constructor.Scope<qUE, sqUE>) -> qUE
) : SelectQuery.Reducing.Constructor<qUE, sqUE> {
@ -35,7 +35,7 @@ public fun <qUE : Any, sqUE : Any> _Query.Constructor._SelectsScope.selectReduci
source: _Selectable<sqUE>, constructor: (SelectQuery.Reducing.Constructor.Scope<qUE, sqUE>) -> qUE
): SelectQuery.Reducing<qUE> = this.selectReducing(InlineSelectReducingConstructor(source, constructor))
public class InlineSelectFoldingConstructor<qUE : Any, sqUE : Any>(
public open class InlineSelectFoldingConstructor<qUE : Any, sqUE : Any>(
override val source: _Selectable<sqUE>,
private val constructor: (SelectQuery.Folding.Constructor.Scope<qUE, sqUE>) -> qUE
) : SelectQuery.Folding.Constructor<qUE, sqUE> {
@ -48,7 +48,7 @@ public fun <qUE : Any, sqUE : Any> _Query.Constructor._SelectsScope.selectFoldin
): SelectQuery.Folding<qUE> = this.selectFolding(InlineSelectFoldingConstructor(source, constructor))
public class InlineSelectUnionConstructor<qUE : Any, fsqUE : Any, lsqUE : Any>(
public open class InlineSelectUnionConstructor<qUE : Any, fsqUE : Any, lsqUE : Any>(
override val first: _Selectable<fsqUE>, override val last: _Selectable<lsqUE>,
private val constructor: (SelectQuery.Union.Constructor.Scope<qUE, fsqUE, lsqUE>) -> qUE
) : SelectQuery.Union.Constructor<qUE, fsqUE, lsqUE> {
@ -60,7 +60,7 @@ public fun <qUE : Any, fsqUE : Any, lsqUE : Any> _Query.Constructor._SelectsScop
first: _Selectable<fsqUE>, last: _Selectable<lsqUE>, constructor: (SelectQuery.Union.Constructor.Scope<qUE, fsqUE, lsqUE>) -> qUE
): SelectQuery.Union<qUE> = this.selectUnion(InlineSelectUnionConstructor(first, last, constructor))
public class InlineInsertSingleRowConstructor<qUE : Any, ttUE : Any>(
public open class InlineInsertSingleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (InsertQuery.SingleRow.Constructor.Scope<qUE, ttUE>) -> qUE
) : InsertQuery.SingleRow.Constructor<qUE, ttUE> {
@ -73,7 +73,7 @@ public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.insertSingleRow(
): InsertQuery.SingleRow<qUE> = this.insertSingleRow(InlineInsertSingleRowConstructor(targetTable, constructor))
public class InlineInsertFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
public open class InlineInsertFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
override val targetTable: Table<ttUE, *>,
override val selector: _Selectable<sqUE>,
private val constructor: (InsertQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
@ -86,6 +86,11 @@ public fun <qUE : Any, ttUE : Any, sqUE : Any> _Query.Constructor.Scope.insertFr
targetTable: Table<ttUE, *>, selector: _Selectable<sqUE>, constructor: (InsertQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
): InsertQuery.FromSubquery<qUE> = this.insertFromSubquery(InlineInsertFromSubqueryConstructor(targetTable, selector, constructor))
@Deprecated(
"Bad name",
ReplaceWith("InlineInsertMultipleRowsConstructor", "ru.landgrafhomyak.db.serdha0.user_commons.construction.InlineInsertMultipleRowsConstructor"),
DeprecationLevel.HIDDEN
)
public class InlineInsertMultipleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (InsertQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
@ -94,11 +99,19 @@ public class InlineInsertMultipleRowConstructor<qUE : Any, ttUE : Any>(
this.constructor(context)
}
public open class InlineInsertMultipleRowsConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (InsertQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
) : InsertQuery.MultipleRows.Constructor<qUE, ttUE> {
override fun createInsertMultipleRows(context: InsertQuery.MultipleRows.Constructor.Scope<qUE, ttUE>): qUE =
this.constructor(context)
}
public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.insertMultipleRows(
targetTable: Table<ttUE, *>, constructor: (InsertQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
): InsertQuery.MultipleRows<qUE> = this.insertMultipleRows(InlineInsertMultipleRowConstructor(targetTable, constructor))
): InsertQuery.MultipleRows<qUE> = this.insertMultipleRows(InlineInsertMultipleRowsConstructor(targetTable, constructor))
public class InlineUpdateSingleRowConstructor<qUE : Any, ttUE : Any>(
public open class InlineUpdateSingleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (UpdateQuery.SingleRow.Constructor.Scope<qUE, ttUE>) -> qUE
) : UpdateQuery.SingleRow.Constructor<qUE, ttUE> {
@ -111,7 +124,7 @@ public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.updateSingleRow(
): UpdateQuery.SingleRow<qUE> = this.updateSingleRow(InlineUpdateSingleRowConstructor(targetTable, constructor))
public class InlineUpdateFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
public open class InlineUpdateFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
override val targetTable: Table<ttUE, *>,
override val selector: _Selectable<sqUE>,
private val constructor: (UpdateQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
@ -124,6 +137,12 @@ public fun <qUE : Any, ttUE : Any, sqUE : Any> _Query.Constructor.Scope.updateFr
targetTable: Table<ttUE, *>, selector: _Selectable<sqUE>, constructor: (UpdateQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
): UpdateQuery.FromSubquery<qUE> = this.updateFromSubquery(InlineUpdateFromSubqueryConstructor(targetTable, selector, constructor))
@Deprecated(
"Bad name",
ReplaceWith("InlineUpdateMultipleRowsConstructor", "ru.landgrafhomyak.db.serdha0.user_commons.construction.InlineUpdateMultipleRowsConstructor"),
DeprecationLevel.HIDDEN
)
public class InlineUpdateMultipleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (UpdateQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
@ -132,11 +151,19 @@ public class InlineUpdateMultipleRowConstructor<qUE : Any, ttUE : Any>(
this.constructor(context)
}
public open class InlineUpdateMultipleRowsConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (UpdateQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
) : UpdateQuery.MultipleRows.Constructor<qUE, ttUE> {
override fun createUpdateMultipleRows(context: UpdateQuery.MultipleRows.Constructor.Scope<qUE, ttUE>): qUE =
this.constructor(context)
}
public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.updateMultipleRows(
targetTable: Table<ttUE, *>, constructor: (UpdateQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
): UpdateQuery.MultipleRows<qUE> = this.updateMultipleRows(InlineUpdateMultipleRowConstructor(targetTable, constructor))
): UpdateQuery.MultipleRows<qUE> = this.updateMultipleRows(InlineUpdateMultipleRowsConstructor(targetTable, constructor))
public class InlineDeleteSingleRowConstructor<qUE : Any, ttUE : Any>(
public open class InlineDeleteSingleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (DeleteQuery.SingleRow.Constructor.Scope<qUE, ttUE>) -> qUE
) : DeleteQuery.SingleRow.Constructor<qUE, ttUE> {
@ -149,7 +176,7 @@ public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.deleteSingleRow(
): DeleteQuery.SingleRow<qUE> = this.deleteSingleRow(InlineDeleteSingleRowConstructor(targetTable, constructor))
public class InlineDeleteFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
public open class InlineDeleteFromSubqueryConstructor<qUE : Any, ttUE : Any, sqUE : Any>(
override val targetTable: Table<ttUE, *>,
override val selector: _Selectable<sqUE>,
private val constructor: (DeleteQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
@ -162,6 +189,11 @@ public fun <qUE : Any, ttUE : Any, sqUE : Any> _Query.Constructor.Scope.deleteFr
targetTable: Table<ttUE, *>, selector: _Selectable<sqUE>, constructor: (DeleteQuery.FromSubquery.Constructor.Scope<qUE, ttUE, sqUE>) -> qUE
): DeleteQuery.FromSubquery<qUE> = this.deleteFromSubquery(InlineDeleteFromSubqueryConstructor(targetTable, selector, constructor))
@Deprecated(
"Bad name",
ReplaceWith("InlineDeleteMultipleRowsConstructor", "ru.landgrafhomyak.db.serdha0.user_commons.construction.InlineDeleteMultipleRowsConstructor"),
DeprecationLevel.HIDDEN
)
public class InlineDeleteMultipleRowConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (DeleteQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
@ -170,7 +202,15 @@ public class InlineDeleteMultipleRowConstructor<qUE : Any, ttUE : Any>(
this.constructor(context)
}
public open class InlineDeleteMultipleRowsConstructor<qUE : Any, ttUE : Any>(
override val targetTable: Table<ttUE, *>,
private val constructor: (DeleteQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
) : DeleteQuery.MultipleRows.Constructor<qUE, ttUE> {
override fun createMultipleRows(context: DeleteQuery.MultipleRows.Constructor.Scope<qUE, ttUE>): qUE =
this.constructor(context)
}
public fun <qUE : Any, ttUE : Any> _Query.Constructor.Scope.deleteMultipleRows(
targetTable: Table<ttUE, *>, constructor: (DeleteQuery.MultipleRows.Constructor.Scope<qUE, ttUE>) -> qUE
): DeleteQuery.MultipleRows<qUE> = this.deleteMultipleRows(InlineDeleteMultipleRowConstructor(targetTable, constructor))
): DeleteQuery.MultipleRows<qUE> = this.deleteMultipleRows(InlineDeleteMultipleRowsConstructor(targetTable, constructor))

View File

@ -1,4 +1,4 @@
@file:JvmName("_QueryParamKt")
@file:JvmName("_QueryParamKt") // todo query_param_like
package ru.landgrafhomyak.db.serdha0.user_commons.construction
@ -47,6 +47,11 @@ public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> InsertQuery.Single
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
@JvmName("queryParamLike\$target")
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> InsertQuery.FromSubquery.Constructor.Scope<qUE, ocUE, *>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> InsertQuery.FromSubquery.Constructor.Scope<qUE, *, ocUE>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
@ -59,6 +64,11 @@ public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> UpdateQuery.Single
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
@JvmName("queryParamLike\$target")
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> UpdateQuery.FromSubquery.Constructor.Scope<qUE, ocUE, *>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> UpdateQuery.FromSubquery.Constructor.Scope<qUE, *, ocUE>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
@ -71,6 +81,10 @@ public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> DeleteQuery.Single
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
@JvmName("queryParamLike\$target")
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> DeleteQuery.FromSubquery.Constructor.Scope<qUE, ocUE, *>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> DeleteQuery.FromSubquery.Constructor.Scope<qUE, *, ocUE>.queryParamLike(
name: String, column: Column<RT, DT, ocUE>
): QueryParam<RT, DT, qUE> = this.queryParam(name, column.type)

View File

@ -17,4 +17,8 @@ public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> SelectQuery.WithJo
public fun <qUE : Any, ocUE : Any, RT, DT : DatabaseType<RT>> SelectQuery.WithJoin.Constructor.Scope<qUE, *, ocUE>.returnColumnFromRight(
name: String, column: Column<RT, DT, ocUE>
): Column<RT, DT, qUE> = this.returnColumn(name, this.selectColumnFromRight(column))
): Column<RT, DT, qUE> = this.returnColumn(name, this.selectColumnFromRight(column))
public fun <qUE : Any, ocUE : Any, RT : Any, DT : DatabaseType<RT>> SelectQuery.WithJoin.Constructor.Scope<qUE, *, ocUE>.returnColumnFromRightAsNullable(
name: String, column: Column<RT, DT, ocUE>
): Column<RT?, DatabaseType.Nullable<RT, DT>, qUE> = this.returnColumn(name, this.selectColumnFromRightAsNullable(column))

View File

@ -0,0 +1,25 @@
@file:JvmName("_RowReferenceKt")
package ru.landgrafhomyak.db.serdha0.user_commons.construction
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
import ru.landgrafhomyak.db.serdha0.api.table.ForeignRowReference
import ru.landgrafhomyak.db.serdha0.api.table.RowId
import ru.landgrafhomyak.db.serdha0.api.table.Table
import ru.landgrafhomyak.db.serdha0.api.table.TableConstructor
public fun <tUE : Any> TableConstructor.Scope<tUE>.nullableSelfRowReference(
columnName: String,
onDelete: ForeignRowReference.OnDelete,
): ForeignRowReference<tUE, tUE, RowId<tUE>?, DatabaseType.Nullable<RowId<tUE>, DatabaseType.ROW_ID<tUE>>> =
this.selfRowReference(columnName, this.types.nullableOf(this.rowIdColumn.type), onDelete)
public fun <tUE : Any, ttUE : Any> TableConstructor.Scope<tUE>.nullableForeignRowReference(
columnName: String,
toTable: Table<ttUE, *>,
onDelete: ForeignRowReference.OnDelete,
): ForeignRowReference<tUE, ttUE, RowId<ttUE>?, DatabaseType.Nullable<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>>> =
this.foreignRowReference(columnName, this.types.nullableOf(this.types.ROW_ID(toTable)), toTable, onDelete)

View File

@ -0,0 +1,503 @@
@file:JvmName("_TableInlineConstructorsKt")
package ru.landgrafhomyak.db.serdha0.user_commons.construction
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.module.CreateModuleScope
import ru.landgrafhomyak.db.serdha0.api.module.Module
import ru.landgrafhomyak.db.serdha0.api.module.Namespace
import ru.landgrafhomyak.db.serdha0.api.table.Table
import ru.landgrafhomyak.db.serdha0.api.table.TableConstructor
public open class InlineTableConstructor0<tUE : Any>(
private val constructor: (TableConstructor.Scope<tUE>) -> tUE
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context)
}
}
public fun <tUE : Any> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor0(constructor))
public fun <tUE : Any> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor0(constructor))
public fun <tUE : Any> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor0(constructor))
public fun <tUE : Any> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor0(constructor))
public fun <tUE : Any> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor0(constructor))
public fun <tUE : Any> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>) -> tUE
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor0(constructor))
public open class InlineTableConstructor1<tUE : Any, A1>(
private val constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
private val a1: A1
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1)
}
}
public fun <tUE : Any, A1> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor1(constructor, a1))
public fun <tUE : Any, A1> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor1(constructor, a1))
public fun <tUE : Any, A1> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor1(constructor, a1))
public fun <tUE : Any, A1> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor1(constructor, a1))
public fun <tUE : Any, A1> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor1(constructor, a1))
public fun <tUE : Any, A1> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1) -> tUE,
a1: A1
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor1(constructor, a1))
public open class InlineTableConstructor2<tUE : Any, A1, A2>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
private val a1: A1, private val a2: A2,
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2)
}
}
public fun <tUE : Any, A1, A2> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor2(constructor, a1, a2))
public fun <tUE : Any, A1, A2> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor2(constructor, a1, a2))
public fun <tUE : Any, A1, A2> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor2(constructor, a1, a2))
public fun <tUE : Any, A1, A2> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor2(constructor, a1, a2))
public fun <tUE : Any, A1, A2> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor2(constructor, a1, a2))
public fun <tUE : Any, A1, A2> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2) -> tUE,
a1: A1, a2: A2
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor2(constructor, a1, a2))
public open class InlineTableConstructor3<tUE : Any, A1, A2, A3>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3,
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3)
}
}
public fun <tUE : Any, A1, A2, A3> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor3(constructor, a1, a2, a3))
public fun <tUE : Any, A1, A2, A3> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor3(constructor, a1, a2, a3))
public fun <tUE : Any, A1, A2, A3> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor3(constructor, a1, a2, a3))
public fun <tUE : Any, A1, A2, A3> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor3(constructor, a1, a2, a3))
public fun <tUE : Any, A1, A2, A3> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor3(constructor, a1, a2, a3))
public fun <tUE : Any, A1, A2, A3> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3) -> tUE,
a1: A1, a2: A2, a3: A3
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor3(constructor, a1, a2, a3))
public open class InlineTableConstructor4<tUE : Any, A1, A2, A3, A4>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4)
}
}
public fun <tUE : Any, A1, A2, A3, A4> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public fun <tUE : Any, A1, A2, A3, A4> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public fun <tUE : Any, A1, A2, A3, A4> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public fun <tUE : Any, A1, A2, A3, A4> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public fun <tUE : Any, A1, A2, A3, A4> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public fun <tUE : Any, A1, A2, A3, A4> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor4(constructor, a1, a2, a3, a4))
public open class InlineTableConstructor5<tUE : Any, A1, A2, A3, A4, A5>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public fun <tUE : Any, A1, A2, A3, A4, A5> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public fun <tUE : Any, A1, A2, A3, A4, A5> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public fun <tUE : Any, A1, A2, A3, A4, A5> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public fun <tUE : Any, A1, A2, A3, A4, A5> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public fun <tUE : Any, A1, A2, A3, A4, A5> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor5(constructor, a1, a2, a3, a4, a5))
public open class InlineTableConstructor6<tUE : Any, A1, A2, A3, A4, A5, A6>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5, private val a6: A6
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5, this.a6)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor6(constructor, a1, a2, a3, a4, a5, a6))
public open class InlineTableConstructor7<tUE : Any, A1, A2, A3, A4, A5, A6, A7>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5, private val a6: A6, private val a7: A7
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5, this.a6, this.a7)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor7(constructor, a1, a2, a3, a4, a5, a6, a7))
public open class InlineTableConstructor8<tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5, private val a6: A6, private val a7: A7, private val a8: A8
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5, this.a6, this.a7, this.a8)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor8(constructor, a1, a2, a3, a4, a5, a6, a7, a8))
public open class InlineTableConstructor9<tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5, private val a6: A6, private val a7: A7, private val a8: A8, private val a9: A9
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5, this.a6, this.a7, this.a8, this.a9)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor9(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9))
public open class InlineTableConstructor10<tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>(
private val constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
private val a1: A1, private val a2: A2, private val a3: A3, private val a4: A4, private val a5: A5, private val a6: A6, private val a7: A7, private val a8: A8, private val a9: A9, private val a10: A10
) : TableConstructor<tUE> {
override fun createTable(context: TableConstructor.Scope<tUE>): tUE {
return this.constructor(context, this.a1, this.a2, this.a3, this.a4, this.a5, this.a6, this.a7, this.a8, this.a9, this.a10)
}
}
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> CreateModuleScope.createTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createTable(namespace, name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> CreateModuleScope.createSessionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(namespace, name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> CreateModuleScope.createTransactionScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(namespace, name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> CreateModuleScope.createModuleConfiguringScopeTemporaryTable(
namespace: Namespace = this.rootNs, name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createModuleConfiguringScopeTemporaryTable(namespace, name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Module<*>.createSessionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createSessionScopeTemporaryTable(name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
public fun <tUE : Any, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Module<*>.createTransactionScopeTemporaryTable(
name: String, constructor: (TableConstructor.Scope<tUE>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> tUE,
a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10
): Table<tUE, Nothing> =
this.createTransactionScopeTemporaryTable(name, InlineTableConstructor10(constructor, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))

View File

@ -2,6 +2,6 @@ package ru.landgrafhomyak.db.serdha0.user_commons.executors
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
public fun interface RowConsumer0<qUE : Any, R> {
public interface RowConsumer0<qUE : Any, R> {
public fun transformRow(row: OutputRow<qUE>): R
}

View File

@ -2,6 +2,6 @@ package ru.landgrafhomyak.db.serdha0.user_commons.executors
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
public fun interface RowConsumer1<qUE : Any, R> {
public interface RowConsumer1<qUE : Any, R> {
public fun transformRow(row: OutputRow<qUE>, index: Int): R
}

View File

@ -5,25 +5,100 @@ package ru.landgrafhomyak.db.serdha0.user_commons.executors
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.LowLevelApi
import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
@Suppress("FunctionName")
@PublishedApi
internal inline fun <R> _safeAutoClose(onAbort: () -> Unit = {}, action: () -> R): R {
internal inline fun <R> _safeAutoClose(onAbort: () -> Unit = {}, onSuccess: () -> Unit = {}, action: () -> R): R {
contract {
callsInPlace(action, InvocationKind.EXACTLY_ONCE)
callsInPlace(onAbort, InvocationKind.AT_MOST_ONCE)
callsInPlace(onSuccess, InvocationKind.EXACTLY_ONCE)
}
val ret: R
var wasError = false
try {
ret = action()
} catch (e1: Throwable) {
wasError = true
try {
onAbort()
} catch (e2: Throwable) {
e1.addSuppressed(e2)
}
throw e1
} finally {
if (!wasError)
onSuccess()
}
return ret
}
@Suppress("ClassName")
public class _ReturnFromInputError : Error("Returning from outer function from input row initializer block is undefined behaviour")
@Suppress("FunctionName", "REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
@LowLevelApi
public suspend inline fun <I : InputRow._Scope<*, O>, O : OutputRow._Iterator<*, Unit>> _safeAutoClose_IO(
iRow: I,
inputAction: suspend (I) -> Unit,
outputAction: suspend (O) -> Unit,
) {
contract {
callsInPlace(inputAction, InvocationKind.EXACTLY_ONCE)
callsInPlace(outputAction, InvocationKind.EXACTLY_ONCE)
}
@Suppress("VARIABLE_WITH_REDUNDANT_INITIALIZER")
var crossReturned = true
_safeAutoClose(
onAbort = { iRow._abort() },
action = { inputAction(iRow); crossReturned = false },
onSuccess = {
if (crossReturned) throw _ReturnFromInputError()
val oRow = iRow._finish()
_safeAutoClose(
onAbort = { oRow._abort() },
action = { outputAction(oRow) },
onSuccess = { oRow._finish() }
)
}
)
}
@Suppress("FunctionName", "REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
@LowLevelApi
public suspend inline fun <I : InputRow._Scope<*, Unit>> _safeAutoClose_I(
iRow: I,
inputAction: suspend (I) -> Unit,
) {
contract {
callsInPlace(inputAction, InvocationKind.EXACTLY_ONCE)
}
_safeAutoClose(
onAbort = { iRow._abort() },
action = { inputAction(iRow) },
onSuccess = { iRow._finish() }
)
}
@Suppress("FunctionName", "REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
@LowLevelApi
public suspend inline fun <O : OutputRow._Iterator<*, Unit>> _safeAutoClose_O(
oRow: O,
outputAction: suspend (O) -> Unit,
) {
contract {
callsInPlace(outputAction, InvocationKind.EXACTLY_ONCE)
}
_safeAutoClose(
onAbort = { oRow._abort() },
action = { outputAction(oRow) },
onSuccess = { oRow._finish() }
)
}
public fun test() {
}

View File

@ -4,9 +4,12 @@
package ru.landgrafhomyak.db.serdha0.user_commons.executors
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.LowLevelApi
import ru.landgrafhomyak.db.serdha0.api.queries._Query
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.Transaction
public class ExpectedOneRowException : Error("Expected at least one row, but table is empty")
@ -15,154 +18,195 @@ public class TooManyRowsException : Error("Expected exactly one row, but got mor
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrError(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: RowConsumer0<qUE, R>
result: (OutputRow<qUE>) -> R
): R {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(result, InvocationKind.EXACTLY_ONCE)
}
val oRow = iRow._finish()
val ret: R
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next())
throw ExpectedOneRowException()
ret = result.transformRow(oRow)
if (oRow._next())
throw TooManyRowsException()
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
if (!oRow._next())
throw ExpectedOneRowException()
_safeAutoClose(onSuccess = { if (oRow._next()) throw TooManyRowsException() }) {
return result(oRow)
}
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrError(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: RowConsumer0<qUE, R>
): R = this.selectExactlyOneOrError(compiledQuery, params, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrError(
compiledQuery: _Query.Void2Table<qUE>,
result: (OutputRow<qUE>) -> R
): R {
contract {
callsInPlace(result, InvocationKind.EXACTLY_ONCE)
}
oRow._finish()
return ret
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
if (!oRow._next())
throw ExpectedOneRowException()
_safeAutoClose(onSuccess = { if (oRow._next()) throw TooManyRowsException() }) {
return result(oRow)
}
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrError(
compiledQuery: _Query.Void2Table<qUE>,
result: RowConsumer0<qUE, R>
): R {
val oRow = this._executeQuery(compiledQuery)
val ret: R
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next())
throw ExpectedOneRowException()
ret = result.transformRow(oRow)
if (oRow._next())
throw TooManyRowsException()
): R = this.selectExactlyOneOrError(compiledQuery, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrNull(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: (OutputRow<qUE>) -> R
): R? {
contract {
callsInPlace(result, InvocationKind.AT_MOST_ONCE)
}
oRow._finish()
return ret
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
if (!oRow._next())
return null
_safeAutoClose(onSuccess = { if (oRow._next()) throw TooManyRowsException() }) {
return result(oRow)
}
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrNull(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: RowConsumer0<qUE, R>
): R? = this.selectExactlyOneOrNull(compiledQuery, params, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrNull(
compiledQuery: _Query.Void2Table<qUE>,
result: (OutputRow<qUE>) -> R
): R? {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(result, InvocationKind.AT_MOST_ONCE)
}
val oRow = iRow._finish()
val ret: R?
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next()) {
ret = null
return@_safeAutoClose
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
if (!oRow._next())
return null
_safeAutoClose(onSuccess = { if (oRow._next()) throw TooManyRowsException() }) {
return result(oRow)
}
}
ret = result.transformRow(oRow)
if (oRow._next())
throw TooManyRowsException()
}
oRow._finish()
return ret
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectExactlyOneOrNull(
compiledQuery: _Query.Void2Table<qUE>,
result: RowConsumer0<qUE, R>
): R? {
val oRow = this._executeQuery(compiledQuery)
val ret: R?
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next()) {
ret = null
return@_safeAutoClose
}
ret = result.transformRow(oRow)
if (oRow._next())
throw TooManyRowsException()
): R? = this.selectExactlyOneOrNull(compiledQuery, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrError(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: (OutputRow<qUE>) -> R
): R {
contract {
callsInPlace(result, InvocationKind.EXACTLY_ONCE)
}
oRow._finish()
return ret
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
if (!oRow._next())
throw ExpectedOneRowException()
return result(oRow)
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrError(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: RowConsumer0<qUE, R>
): R = this.selectFirstOrError(compiledQuery, params, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrError(
compiledQuery: _Query.Void2Table<qUE>,
result: (OutputRow<qUE>) -> R
): R {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(result, InvocationKind.EXACTLY_ONCE)
}
val oRow = iRow._finish()
val ret: R
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next())
throw ExpectedOneRowException()
ret = result.transformRow(oRow)
}
oRow._finish()
return ret
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
if (!oRow._next())
throw ExpectedOneRowException()
return result(oRow)
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrError(
compiledQuery: _Query.Void2Table<qUE>,
result: RowConsumer0<qUE, R>
): R {
val oRow = this._executeQuery(compiledQuery)
val ret: R
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next())
throw ExpectedOneRowException()
ret = result.transformRow(oRow)
): R = this.selectFirstOrError(compiledQuery, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrNull(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: (OutputRow<qUE>) -> R
): R? {
contract {
callsInPlace(result, InvocationKind.AT_MOST_ONCE)
}
oRow._finish()
return ret
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
if (!oRow._next())
return null
return result(oRow)
}
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrNull(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
result: RowConsumer0<qUE, R>
): R? = this.selectFirstOrNull(compiledQuery, params, result::transformRow)
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrNull(
compiledQuery: _Query.Void2Table<qUE>,
result: (OutputRow<qUE>) -> R
): R? {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(result, InvocationKind.AT_MOST_ONCE)
}
val oRow = iRow._finish()
val ret: R?
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next()) {
ret = null
return@_safeAutoClose
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
if (!oRow._next())
return null
return result(oRow)
}
ret = result.transformRow(oRow)
}
oRow._finish()
return ret
)
}
public suspend inline fun <qUE : Any, R> Transaction.selectFirstOrNull(
compiledQuery: _Query.Void2Table<qUE>,
result: RowConsumer0<qUE, R>
): R? {
val oRow = this._executeQuery(compiledQuery)
val ret: R?
_safeAutoClose(onAbort = { oRow._abort() }) {
if (!oRow._next()) {
ret = null
return@_safeAutoClose
}
ret = result.transformRow(oRow)
}
oRow._finish()
return ret
}
): R? = this.selectFirstOrNull(compiledQuery, result::transformRow)

View File

@ -4,71 +4,128 @@
package ru.landgrafhomyak.db.serdha0.user_commons.executors
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.LowLevelApi
import ru.landgrafhomyak.db.serdha0.api.queries._Query
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.Transaction
public suspend inline fun <qUE : Any> Transaction.select(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
transform: RowConsumer0<qUE, Unit>
transform: (OutputRow<qUE>) -> Unit
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
transform.transformRow(oRow)
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
while (oRow._next())
transform(oRow)
}
)
}
public suspend inline fun <qUE : Any> Transaction.select(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
transform: RowConsumer0<qUE, Unit>
): Unit = this.select(compiledQuery, params, transform::transformRow)
public suspend inline fun <qUE : Any> Transaction.select(
compiledQuery: _Query.Void2Table<qUE>,
transform: (OutputRow<qUE>) -> Unit
) {
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
while (oRow._next())
transform(oRow)
}
)
}
public suspend inline fun <qUE : Any> Transaction.select(
compiledQuery: _Query.Void2Table<qUE>,
transform: RowConsumer0<qUE, Unit>
) {
val oRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
transform.transformRow(oRow)
): Unit = this.select(compiledQuery, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRows(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
transform: (OutputRow<qUE>) -> E
): List<E> {
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
val dst = ArrayList<E>()
while (oRow._next())
dst.add(transform(oRow))
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRows(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
transform: RowConsumer0<qUE, E>
): List<E> = this.mapRows(compiledQuery, params, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRows(
compiledQuery: _Query.Void2Table<qUE>,
transform: (OutputRow<qUE>) -> E
): List<E> {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
val out = ArrayList<E>()
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
out.add(transform.transformRow(oRow))
}
oRow._finish()
return out
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
val dst = ArrayList<E>()
while (oRow._next())
dst.add(transform(oRow))
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRows(
compiledQuery: _Query.Void2Table<qUE>,
transform: RowConsumer0<qUE, E>
): List<E> = this.mapRows(compiledQuery, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRowsIndexed(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
firstIndex: Int = 0,
transform: (OutputRow<qUE>, Int) -> E
): List<E> {
val oRow = this._executeQuery(compiledQuery)
val out = ArrayList<E>()
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
out.add(transform.transformRow(oRow))
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
return out
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
val dst = ArrayList<E>()
var i = firstIndex
while (oRow._next())
dst.add(transform(oRow, i++))
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRowsIndexed(
@ -76,36 +133,52 @@ public suspend inline fun <qUE : Any, E> Transaction.mapRowsIndexed(
params: RowProducer0<qUE>,
firstIndex: Int = 0,
transform: RowConsumer1<qUE, E>
): List<E> = this.mapRowsIndexed(compiledQuery, params, firstIndex, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRowsIndexed(
compiledQuery: _Query.Void2Table<qUE>,
firstIndex: Int = 0,
transform: (OutputRow<qUE>, Int) -> E
): List<E> {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
val out = ArrayList<E>()
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = firstIndex
while (oRow._next())
out.add(transform.transformRow(oRow, i++))
}
oRow._finish()
return out
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
val dst = ArrayList<E>()
var i = firstIndex
while (oRow._next())
dst.add(transform(oRow, i++))
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRowsIndexed(
compiledQuery: _Query.Void2Table<qUE>,
firstIndex: Int = 0,
transform: RowConsumer1<qUE, E>
): List<E> {
val oRow = this._executeQuery(compiledQuery)
val out = ArrayList<E>()
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = firstIndex
while (oRow._next())
out.add(transform.transformRow(oRow, i++))
): List<E> = this.mapRowsIndexed(compiledQuery, firstIndex, transform::transformRow)
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsTo(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
dst: C,
transform: (OutputRow<qUE>) -> E
): C {
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
return out
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
while (oRow._next())
dst.add(transform(oRow))
return dst
}
)
}
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsTo(
@ -113,32 +186,51 @@ public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.m
params: RowProducer0<qUE>,
dst: C,
transform: RowConsumer0<qUE, E>
): C = this.mapRowsTo(compiledQuery, params, dst, transform::transformRow)
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: C,
transform: (OutputRow<qUE>) -> E
): C {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
dst.add(transform.transformRow(oRow))
}
oRow._finish()
return dst
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
while (oRow._next())
dst.add(transform(oRow))
return dst
}
)
}
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: C,
transform: RowConsumer0<qUE, E>
): C = this.mapRowsTo(compiledQuery, dst, transform::transformRow)
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsIndexedTo(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
dst: C, firstIndex: Int = 0,
transform: (OutputRow<qUE>, Int) -> E
): C {
val oRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { oRow._abort() }) {
while (oRow._next())
dst.add(transform.transformRow(oRow))
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
return dst
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
var i = firstIndex
while (oRow._next())
dst.add(transform(oRow, i++))
return dst
}
)
}
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsIndexedTo(
@ -146,34 +238,52 @@ public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.m
params: RowProducer0<qUE>,
dst: C, firstIndex: Int = 0,
transform: RowConsumer1<qUE, E>
): C = this.mapRowsIndexedTo(compiledQuery, params, dst, firstIndex, transform::transformRow)
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsIndexedTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: C, firstIndex: Int = 0,
transform: (OutputRow<qUE>, Int) -> E
): C {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = firstIndex
while (oRow._next())
dst.add(transform.transformRow(oRow, i++))
}
oRow._finish()
return dst
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
var i = firstIndex
while (oRow._next())
dst.add(transform(oRow, i++))
return dst
}
)
}
public suspend inline fun <qUE : Any, E, C : MutableCollection<E>> Transaction.mapRowsIndexedTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: C, firstIndex: Int = 0,
transform: RowConsumer1<qUE, E>
): C {
val oRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = firstIndex
while (oRow._next())
dst.add(transform.transformRow(oRow, i++))
): C = this.mapRowsIndexedTo(compiledQuery, dst, firstIndex, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRowsTo(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>,
dst: Array<E>, dstOffset: Int = 0,
transform: (OutputRow<qUE>) -> E
): Array<E> {
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
oRow._finish()
return dst
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = { oRow ->
var i = dstOffset
while (oRow._next())
dst[i++] = transform(oRow)
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRowsTo(
@ -181,32 +291,29 @@ public suspend inline fun <qUE : Any, E> Transaction.mapRowsTo(
params: RowProducer0<qUE>,
dst: Array<E>, dstOffset: Int = 0,
transform: RowConsumer0<qUE, E>
): Array<E> = this.mapRowsTo(compiledQuery, params, dst, dstOffset, transform::transformRow)
public suspend inline fun <qUE : Any, E> Transaction.mapRowsTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: Array<E>, dstOffset: Int = 0,
transform: (OutputRow<qUE>) -> E
): Array<E> {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
contract {
callsInPlace(transform, InvocationKind.UNKNOWN)
}
val oRow = iRow._finish()
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = dstOffset
while (oRow._next())
dst[i++] = transform.transformRow(oRow)
}
oRow._finish()
return dst
_safeAutoClose_O(
oRow = this._executeQuery(compiledQuery),
outputAction = { oRow ->
var i = dstOffset
while (oRow._next())
dst[i++] = transform(oRow)
return dst
}
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapRowsTo(
compiledQuery: _Query.Void2Table<qUE>,
dst: Array<E>, dstOffset: Int = 0,
transform: RowConsumer0<qUE, E>
): Array<E> {
val oRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { oRow._abort() }) {
var i = dstOffset
while (oRow._next())
dst[i++] = transform.transformRow(oRow)
}
oRow._finish()
return dst
}
): Array<E> = this.mapRowsTo(compiledQuery, dst, dstOffset, transform::transformRow)

View File

@ -13,20 +13,19 @@ public suspend inline fun <qUE : Any> Transaction.executeWithParams(
compiledQuery: _Query.Params2Void<qUE>,
params: RowProducer0<qUE>
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
}
iRow._finish()
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow
)
}
public suspend inline fun <qUE : Any> Transaction.executeWithParams(
compiledQuery: _Query.Params2Table<qUE>,
params: RowProducer0<qUE>
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
params.initializeRow(iRow)
}
iRow._finish()._finish()
_safeAutoClose_IO(
iRow = this._executeQuery(compiledQuery),
inputAction = params::initializeRow,
outputAction = {}
)
}

View File

@ -4,7 +4,6 @@
package ru.landgrafhomyak.db.serdha0.user_commons.executors
import kotlin.contracts.contract
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.LowLevelApi
import ru.landgrafhomyak.db.serdha0.api.queries._Query
@ -15,14 +14,15 @@ public suspend inline fun <qUE : Any, E> Transaction.mapToRows(
collection: Iterable<E>,
transform: RowProducer1<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in collection) {
iRow._next()
transform.transformToRow(iRow, elem)
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
for (elem in collection) {
iRow._next()
transform.transformToRow(iRow, elem)
}
}
}
iRow._finish()
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapToRowsIndexed(
@ -31,16 +31,16 @@ public suspend inline fun <qUE : Any, E> Transaction.mapToRowsIndexed(
firstIndex: Int = 0,
transform: RowProducer2<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
var index = firstIndex
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in collection) {
iRow._next()
transform.transformToRow(iRow, index, elem)
index++
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
var index = firstIndex
for (elem in collection) {
iRow._next()
transform.transformToRow(iRow, index++, elem)
}
}
}
iRow._finish()
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapToRows(
@ -48,14 +48,15 @@ public suspend inline fun <qUE : Any, E> Transaction.mapToRows(
sequence: Sequence<E>,
transform: RowProducer1<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, elem)
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, elem)
}
}
}
iRow._finish()
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapToRowsIndexed(
@ -64,47 +65,48 @@ public suspend inline fun <qUE : Any, E> Transaction.mapToRowsIndexed(
firstIndex: Int = 0,
transform: RowProducer2<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
var index = firstIndex
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, index, elem)
index++
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
var index = firstIndex
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, index++, elem)
}
}
}
iRow._finish()
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapToRows(
compiledQuery: _Query.Table2Void<qUE>,
sequence: Array<E>,
array: Array<E>,
transform: RowProducer1<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, elem)
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
for (elem in array) {
iRow._next()
transform.transformToRow(iRow, elem)
}
}
}
iRow._finish()
)
}
public suspend inline fun <qUE : Any, E> Transaction.mapToRowsIndexed(
compiledQuery: _Query.Table2Void<qUE>,
sequence: Array<E>,
array: Array<E>,
firstIndex: Int = 0,
transform: RowProducer2<qUE, E>
) {
val iRow = this._executeQuery(compiledQuery)
var index = firstIndex
_safeAutoClose(onAbort = { iRow._abort() }) {
for (elem in sequence) {
iRow._next()
transform.transformToRow(iRow, index, elem)
index++
_safeAutoClose_I(
iRow = this._executeQuery(compiledQuery),
inputAction = { iRow ->
var index = firstIndex
for (elem in array) {
iRow._next()
transform.transformToRow(iRow, index++, elem)
}
}
}
iRow._finish()
)
}

View File

@ -0,0 +1,37 @@
@file:OptIn(LowLevelApi::class)
@file:JvmName("_TransactionsKt")
package ru.landgrafhomyak.db.serdha0.user_commons.executors
import kotlin.jvm.JvmName
import ru.landgrafhomyak.db.serdha0.api.LowLevelApi
import ru.landgrafhomyak.db.serdha0.api.runtime.Executor
import ru.landgrafhomyak.db.serdha0.api.runtime.Transaction
public suspend inline fun <R> Executor.transaction(scope: (Transaction) -> R): R {
val transaction = this._startTransaction()
var e1: Throwable? = null
try {
return scope(transaction)
} catch (e: Throwable) {
e1 = e
throw e
} finally {
try {
transaction._assertTransactionFinishedAndReleaseResources()
} catch (e2: Throwable) {
if (e1 == null) {
throw e2
} else {
e1.addSuppressed(e2)
}
}
}
}
public suspend inline fun <R> Executor.autoCommittedTransaction(scope: (Transaction) -> R): R =
this.transaction { transaction ->
_safeAutoClose(onAbort = { transaction.rollback() }, onSuccess = { transaction.commit() }) {
return@transaction scope(transaction)
}
}

View File

@ -0,0 +1,20 @@
package ru.landgrafhomyak.db.serdha0.user_commons.reducers
import ru.landgrafhomyak.db.serdha0.api.misc.Reducer
import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
import ru.landgrafhomyak.db.serdha0.user_commons.types.U_INT_64
public class Count private constructor(context: Reducer.Constructor.Scope<Count>) : Reducer.Action<Count> {
@Suppress("PropertyName", "MemberVisibilityCanBePrivate")
public val C_Counter: Reducer.OutputColumn<ULong, U_INT_64, Count> = context.outputColumn("counter", context.types.U_INT_64, 0u)
override fun calculate(acc: OutputRow<Count>, row: OutputRow<Count>, newAcc: InputRow<Count>) {
newAcc[this.C_Counter] = acc[this.C_Counter] + 1u
}
public object Constructor : Reducer.Constructor<Count> {
override fun createReducer(context: Reducer.Constructor.Scope<Count>): Reducer.Action<Count> =
Count(context)
}
}

View File

@ -0,0 +1,21 @@
package ru.landgrafhomyak.db.serdha0.user_commons.reducers
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
import ru.landgrafhomyak.db.serdha0.api.misc.Reducer
import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
public class HasRows private constructor(context: Reducer.Constructor.Scope<HasRows>) : Reducer.Action<HasRows> {
@Suppress("PropertyName", "MemberVisibilityCanBePrivate")
public val C_HasRows: Reducer.OutputColumn<Boolean, DatabaseType.BOOLEAN, HasRows> =
context.outputColumn("flag", context.types.BOOLEAN, false)
override fun calculate(acc: OutputRow<HasRows>, row: OutputRow<HasRows>, newAcc: InputRow<HasRows>) {
newAcc[this.C_HasRows] = true
}
public object Constructor : Reducer.Constructor<HasRows> {
override fun createReducer(context: Reducer.Constructor.Scope<HasRows>): Reducer.Action<HasRows> =
HasRows(context)
}
}

View File

@ -0,0 +1,28 @@
package ru.landgrafhomyak.db.serdha0.user_commons.reducers
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
import ru.landgrafhomyak.db.serdha0.api.misc.Reducer
import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
public class Max<RT, DT : DatabaseType._VirtualType<RT, *, *>> private constructor(
context: Reducer.Constructor.Scope<Max<RT, DT>>,
private val _type: DT
) : Reducer.Action<Max<RT, DT>> {
@Suppress("PropertyName", "MemberVisibilityCanBePrivate")
public val C_MaxValue: Reducer.BidirectionalColumn<RT, DT, Max<RT, DT>> = context.bidirectionalColumn("max_value", this._type)
override fun calculate(acc: OutputRow<Max<RT, DT>>, row: OutputRow<Max<RT, DT>>, newAcc: InputRow<Max<RT, DT>>) {
val accumulatedValue = acc[this.C_MaxValue]
val newValue = row[this.C_MaxValue]
if (this._type._compare(accumulatedValue, newValue) < 0)
newAcc[this.C_MaxValue] = newValue
else
newAcc[this.C_MaxValue] = accumulatedValue
}
public class Constructor<RT, DT : DatabaseType._VirtualType<RT, *, *>>(private val type: DT) : Reducer.Constructor<Max<RT, DT>> {
override fun createReducer(context: Reducer.Constructor.Scope<Max<RT, DT>>): Reducer.Action<Max<RT, DT>> =
Max(context, this.type)
}
}

View File

@ -0,0 +1,28 @@
package ru.landgrafhomyak.db.serdha0.user_commons.reducers
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
import ru.landgrafhomyak.db.serdha0.api.misc.Reducer
import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
import ru.landgrafhomyak.db.serdha0.api.runtime.OutputRow
public class Min<RT, DT : DatabaseType._VirtualType<RT, *, *>> private constructor(
context: Reducer.Constructor.Scope<Min<RT, DT>>,
private val _type: DT
) : Reducer.Action<Min<RT, DT>> {
@Suppress("PropertyName", "MemberVisibilityCanBePrivate")
public val C_MinValue: Reducer.BidirectionalColumn<RT, DT, Min<RT, DT>> = context.bidirectionalColumn("min_value", this._type)
override fun calculate(acc: OutputRow<Min<RT, DT>>, row: OutputRow<Min<RT, DT>>, newAcc: InputRow<Min<RT, DT>>) {
val accumulatedValue = acc[this.C_MinValue]
val newValue = row[this.C_MinValue]
if (this._type._compare(accumulatedValue, newValue) > 0)
newAcc[this.C_MinValue] = newValue
else
newAcc[this.C_MinValue] = accumulatedValue
}
public class Constructor<RT, DT : DatabaseType._VirtualType<RT, *, *>>(private val type: DT) : Reducer.Constructor<Min<RT, DT>> {
override fun createReducer(context: Reducer.Constructor.Scope<Min<RT, DT>>): Reducer.Action<Min<RT, DT>> =
Min(context, this.type)
}
}