Renamed module scopes

This commit is contained in:
Andrew Golovashevich 2025-05-12 09:06:48 +03:00
parent 633d137bf0
commit cae5567d9d
3 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ public interface Module<mUE : Any, RUNTIME_KEY : Any> {
@get:JvmName("versionKey")
public val versionKey: String
public fun createSchema(context: CreateModuleScope<mUE, RUNTIME_KEY>): mUE
public fun createSchema(context: ModuleConstructorScope<mUE, RUNTIME_KEY>): mUE
public suspend fun initData(ext: mUE, compiler: QueriesCompiler<RUNTIME_KEY>, transaction: Transaction<RUNTIME_KEY>) {}
}
@ -37,7 +37,7 @@ public interface Module<mUE : Any, RUNTIME_KEY : Any> {
@get:JvmName("versionKey")
public val versionKey: String
public fun upgradeSchema(context: UpgradeModuleScope<nmUE, omUE, RUNTIME_KEY>): nmUE
public fun upgradeSchema(context: ModuleUpgradeScope<nmUE, omUE, RUNTIME_KEY>): nmUE
public suspend fun upgradeData(ext: nmUE, compiler: QueriesCompiler<RUNTIME_KEY>, transaction: Transaction<RUNTIME_KEY>) {}
}

View File

@ -9,7 +9,7 @@ import ru.landgrafhomyak.db.skeleton1.api.table.Table
import ru.landgrafhomyak.db.skeleton1.api.runtime.InputRow
public interface CreateModuleScope<mUE : Any, RK : Any> {
public interface ModuleConstructorScope<mUE : Any, RK : Any> {
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("rootNs")
public val rootNs: Namespace<mUE, RK>

View File

@ -7,7 +7,7 @@ import ru.landgrafhomyak.db.skeleton1.api.runtime.InputRow
import ru.landgrafhomyak.db.skeleton1.api.table.Table
public interface UpgradeModuleScope<nmUE : Any, omUE : Any, RK : Any> : CreateModuleScope<nmUE, RK> {
public interface ModuleUpgradeScope<nmUE : Any, omUE : Any, RK : Any> : ModuleConstructorScope<nmUE, RK> {
public fun <tUE : Any> keepTable(table: Table<tUE, omUE, RK>): Table<tUE, nmUE, RK>
public fun <tUE : Any> keepAndRenameTable(table: Table<tUE, omUE, RK>, newName: String): Table<tUE, nmUE, RK>