From 8a6de9d2fa6d624a0f579a63fae7c12cf83e986b Mon Sep 17 00:00:00 2001 From: Andrew Golovashevich Date: Fri, 31 Jan 2025 20:40:00 +0300 Subject: [PATCH] [history/serdha] Removed constraints from 'ForeignRowReference' RT and DT because it doesn't strictly check at compile-time but allows using virtual types --- .../serdha0/api/table/CreateTableScope.kt | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/serdha0/api/table/CreateTableScope.kt b/src/commonMain/kotlin/ru/landgrafhomyak/serdha0/api/table/CreateTableScope.kt index 38c5f02..b72c5eb 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/serdha0/api/table/CreateTableScope.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/serdha0/api/table/CreateTableScope.kt @@ -20,13 +20,27 @@ public interface CreateTableScope { @Suppress("PropertyName") public val rowId_uniqueConstraint: UniqueIndex - public fun selfRowReference( - onDelete: ForeignRowReference.OnDeleteAction, - ): ForeignRowReference - - public fun foreignRowReference( + public fun selfRowReference( columnName: String, - toTable: Table, - onDelete: ForeignRowReference.OnDeleteAction, - ): ForeignRowReference + onDelete: ForeignRowReference.OnDelete, + ): ForeignRowReference, DatabaseType.ROW_ID> + + public fun > selfRowReference( + columnName: String, + type: DT, + onDelete: ForeignRowReference.OnDelete, + ): ForeignRowReference + + public fun foreignRowReference( + columnName: String, + toTable: Table, + onDelete: ForeignRowReference.OnDelete, + ): ForeignRowReference, DatabaseType.ROW_ID> + + public fun > foreignRowReference( + columnName: String, + type: DT, + toTable: Table, + onDelete: ForeignRowReference.OnDelete, + ): ForeignRowReference } \ No newline at end of file