From 4342e04e3f7d01601800aafa3cdf3ea7c3664af5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 22 Sep 2024 19:39:45 +0600 Subject: [PATCH] replace database extension into externded file --- .../dev/inmo/plagubot/KoinDatabaseExtensions.kt | 11 +++++++++++ .../main/kotlin/dev/inmo/plagubot/KoinExtensions.kt | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 plugin/src/main/kotlin/dev/inmo/plagubot/KoinDatabaseExtensions.kt diff --git a/plugin/src/main/kotlin/dev/inmo/plagubot/KoinDatabaseExtensions.kt b/plugin/src/main/kotlin/dev/inmo/plagubot/KoinDatabaseExtensions.kt new file mode 100644 index 0000000..d3ed49d --- /dev/null +++ b/plugin/src/main/kotlin/dev/inmo/plagubot/KoinDatabaseExtensions.kt @@ -0,0 +1,11 @@ +package dev.inmo.plagubot + +import org.jetbrains.exposed.sql.Database +import org.koin.core.Koin +import org.koin.core.scope.Scope + +val Scope.database: Database + get() = get() + +val Koin.database: Database + get() = get() diff --git a/plugin/src/main/kotlin/dev/inmo/plagubot/KoinExtensions.kt b/plugin/src/main/kotlin/dev/inmo/plagubot/KoinExtensions.kt index 33a4cae..18585df 100644 --- a/plugin/src/main/kotlin/dev/inmo/plagubot/KoinExtensions.kt +++ b/plugin/src/main/kotlin/dev/inmo/plagubot/KoinExtensions.kt @@ -11,12 +11,6 @@ import org.koin.core.module.Module import org.koin.core.scope.Scope import kotlin.reflect.KClass -val Scope.database: Database - get() = get() - -val Koin.database: Database - get() = get() - /** * Using [single] to register `T` with serializer [configSerializer] *