diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/ModuleCreator.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/ModuleCreator.kt index 2f9d31f..8aef13f 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/ModuleCreator.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/ModuleCreator.kt @@ -55,11 +55,11 @@ public interface ModuleCreator { public fun createSelect(initializer: CreateSelect): Select - public interface CreateInsertParam { + public interface CreateInsertParams { public fun createInsert(table: Table, creator: InsertCreator.InsertParams): QueryUserWrapper } - public fun createInsertParams(table: Table, initializer: CreateInsertParam): Insert.InsertParams + public fun createInsertParams(table: Table, initializer: CreateInsertParams): Insert.InsertParams public interface CreateInsertFromQuery { public fun createInsert(table: Table, creator: InsertCreator.InsertFromQuery): QueryUserWrapper diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/TableCreator.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/TableCreator.kt index be4fd17..1ad1f91 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/TableCreator.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/ddl/TableCreator.kt @@ -20,9 +20,11 @@ public interface TableCreator { public fun unique(name: String, distinctNulls: Boolean, vararg columns: Column<*, *, TableUserExtension>): UniqueConstraint public fun check(name: String, constraint: Expression): CheckConstraint - public fun rowIdColumn(): Column, ColumnType>, TableUserExtension> + @Suppress("PropertyName") + public val rowId_column: Column, ColumnType>, TableUserExtension> - public fun rowIdUniqueConstraint(): UniqueConstraint + @Suppress("PropertyName") + public val rowId_uniqueConstraint: UniqueConstraint public fun > foreignKey( fromColumn: Column<*, ColumnType1, TableUserExtension>, diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/DeleteCreator.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/DeleteCreator.kt index 61ee5b7..684309b 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/DeleteCreator.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/DeleteCreator.kt @@ -10,5 +10,5 @@ public interface DeleteCreator) -> Unit) + public val returning: _CommonQueryMethods._Returning } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/InsertCreator.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/InsertCreator.kt index 93f3362..feda927 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/InsertCreator.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/InsertCreator.kt @@ -21,14 +21,14 @@ public interface InsertCreator) - public fun returningInserted(s: (_CommonQueryMethods._Returning) -> Unit) + public val returningInserted: _CommonQueryMethods._Returning @Suppress("ClassName") - public interface _ReturningUpdated { + public interface _ReturningUpdated : _CommonQueryMethods._Returning { public fun > oldColumnValue(c: Column): Expression } - public fun returningUpdated(s: (_ReturningUpdated) -> Unit) + public val returningUpdated: _ReturningUpdated public interface InsertParams : InsertCreator { public class DataParam<@Suppress("unused") QueryUserExtension : Any> private constructor() @@ -39,7 +39,7 @@ public interface InsertCreator> insertParam( column: Column, - paramName: String = column.name + paramName: String = column.name, ): InputParam> public fun > insert(column: Column, expression: Expression>) diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/UpdateCreator.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/UpdateCreator.kt index 8379df4..c457479 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/UpdateCreator.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/dml/UpdateCreator.kt @@ -19,5 +19,5 @@ public interface UpdateCreator) -> Unit) + public val returning: _CommonQueryMethods._Returning } \ No newline at end of file diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/transaction_methods.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/transaction_methods.kt index 7a23034..639063e 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/transaction_methods.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha/api/v0/runtime/transaction_methods.kt @@ -212,7 +212,7 @@ public suspend inline fun Transaction.selectSingleOr @OptIn(LowLevelApi::class) public suspend inline fun Transaction.selectThenIterate( compiledQuery: Select, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -232,7 +232,7 @@ public suspend inline fun Transaction.selectThenIterate @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedSelectThenIterate( compiledQuery: Select, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -252,7 +252,7 @@ public suspend inline fun SynchronizedDatabase<*>.autoT @OptIn(LowLevelApi::class) public suspend inline fun Transaction.selectThenMap( compiledQuery: Select, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract { @@ -273,7 +273,7 @@ public suspend inline fun Transaction.selectThenMap( @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedSelectThenMap( compiledQuery: Select, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract { @@ -480,7 +480,7 @@ public suspend inline fun Transaction.insertSingle( } @OptIn(LowLevelApi::class) -public suspend inline fun SynchronizedDatabase<*>.autoTransactedInsertSingle( +public suspend inline fun SynchronizedDatabase<*>.autoTransactedInsertSingle( compiledQuery: Insert.InsertParams, parameters: (ParametersSetter) -> Unit = {}, rowData: (ParametersSetter>) -> Unit, @@ -874,7 +874,7 @@ public suspend inline fun SynchronizedDatabase<*>.au @OptIn(LowLevelApi::class) public suspend inline fun Transaction.updateReturningIterate( compiledQuery: Update, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -894,7 +894,7 @@ public suspend inline fun Transaction.updateReturningIt @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedUpdateReturningIterate( compiledQuery: Update, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -914,7 +914,7 @@ public suspend inline fun SynchronizedDatabase<*>.autoT @OptIn(LowLevelApi::class) public suspend inline fun Transaction.updateReturningMap( compiledQuery: Update, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract { @@ -934,7 +934,7 @@ public suspend inline fun Transaction.updateReturnin @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedUpdateReturningMap( compiledQuery: Update, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract { @@ -1031,7 +1031,7 @@ public suspend inline fun SynchronizedDatabase<*>.au @OptIn(LowLevelApi::class) public suspend inline fun Transaction.deleteReturningIterate( compiledQuery: Delete, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -1051,7 +1051,7 @@ public suspend inline fun Transaction.deleteReturningIt @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedDeleteReturningIterate( compiledQuery: Delete, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> Unit ) { contract { @@ -1071,7 +1071,7 @@ public suspend inline fun SynchronizedDatabase<*>.autoT @OptIn(LowLevelApi::class) public suspend inline fun Transaction.deleteReturningMap( compiledQuery: Delete, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract { @@ -1091,7 +1091,7 @@ public suspend inline fun Transaction.deleteReturnin @OptIn(LowLevelApi::class) public suspend inline fun SynchronizedDatabase<*>.autoTransactedDeleteReturningMap( compiledQuery: Delete, - parameters: (ParametersSetter) -> Unit, + parameters: (ParametersSetter) -> Unit = {}, rowsConsumer: (Row) -> R ): List { contract {