diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedRepo.kt index a31d5d0f82e..e2840eab68e 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedRepo.kt @@ -5,6 +5,4 @@ import org.jetbrains.exposed.sql.Database interface ExposedRepo : Repo { val database: Database - - fun onInit() } \ No newline at end of file diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedKeyValueRepo.kt index 8e5dafc8f5e..d634ff2f58b 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedKeyValueRepo.kt @@ -24,7 +24,7 @@ open class ExposedKeyValueRepo( override val onNewValue: Flow> = onNewValueChannel.asFlow() override val onValueRemoved: Flow = onValueRemovedChannel.asFlow() - override fun onInit() { initTable() } + init { initTable() } override suspend fun set(k: Key, v: Value) { transaction(database) { diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedReadKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedReadKeyValueRepo.kt index f91efecdc5e..926ea41354e 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedReadKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/keyvalue/ExposedReadKeyValueRepo.kt @@ -15,7 +15,7 @@ open class ExposedReadKeyValueRepo( protected val valueColumn: Column = valueColumnAllocator() override val primaryKey: PrimaryKey = PrimaryKey(keyColumn, valueColumn) - override fun onInit() { initTable() } + init { initTable() } override suspend fun get(k: Key): Value? = transaction(database) { select { keyColumn.eq(k) }.limit(1).firstOrNull() ?.getOrNull(valueColumn) diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedOneToManyKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedOneToManyKeyValueRepo.kt index d8202db1ad2..4f73866160b 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedOneToManyKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedOneToManyKeyValueRepo.kt @@ -27,7 +27,7 @@ open class ExposedOneToManyKeyValueRepo( override val onDataCleared: Flow get() = _onDataCleared - override fun onInit() { initTable() } + init { initTable() } override suspend fun add(k: Key, v: Value) { transaction(database) { diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedReadOneToManyKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedReadOneToManyKeyValueRepo.kt index b1039a8363c..15e4fa60acb 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedReadOneToManyKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/ExposedReadOneToManyKeyValueRepo.kt @@ -14,7 +14,7 @@ open class ExposedReadOneToManyKeyValueRepo( protected val keyColumn: Column = keyColumnAllocator() protected val valueColumn: Column = valueColumnAllocator() - override fun onInit() { initTable() } + init { initTable() } override suspend fun count(k: Key): Long = transaction(database) { select { keyColumn.eq(k) }.count() }