[history/serdha] Removed constraints from 'ForeignRowReference' RT and DT because it doesn't strictly check at compile-time but allows using virtual types

This commit is contained in:
Andrew Golovashevich 2025-01-31 20:40:00 +03:00
parent e5043320b4
commit 8a6de9d2fa

View File

@ -20,13 +20,27 @@ public interface CreateTableScope<tUE : Any> {
@Suppress("PropertyName") @Suppress("PropertyName")
public val rowId_uniqueConstraint: UniqueIndex<tUE> public val rowId_uniqueConstraint: UniqueIndex<tUE>
public fun <TargetTableUserWrapper : Any> selfRowReference( public fun <ttUE : Any> selfRowReference(
onDelete: ForeignRowReference.OnDeleteAction,
): ForeignRowReference<tUE, tUE>
public fun <TargetTableUserWrapper : Any> foreignRowReference(
columnName: String, columnName: String,
toTable: Table<TargetTableUserWrapper, *>, onDelete: ForeignRowReference.OnDelete,
onDelete: ForeignRowReference.OnDeleteAction, ): ForeignRowReference<tUE, tUE, RowId<tUE>, DatabaseType.ROW_ID<tUE>>
): ForeignRowReference<tUE, TargetTableUserWrapper>
public fun <ttUE : Any, RT, DT : DatabaseType<RT>> selfRowReference(
columnName: String,
type: DT,
onDelete: ForeignRowReference.OnDelete,
): ForeignRowReference<tUE, tUE, RT, DT>
public fun <ttUE : Any> foreignRowReference(
columnName: String,
toTable: Table<ttUE, *>,
onDelete: ForeignRowReference.OnDelete,
): ForeignRowReference<tUE, ttUE, RowId<ttUE>, DatabaseType.ROW_ID<ttUE>>
public fun <ttUE : Any, RT, DT : DatabaseType<RT>> foreignRowReference(
columnName: String,
type: DT,
toTable: Table<ttUE, *>,
onDelete: ForeignRowReference.OnDelete,
): ForeignRowReference<tUE, ttUE, RT, DT>
} }