mirror of https://github.com/hykilpikonna/AquaDX
[+] Check sqlite before application start
parent
9155bfb886
commit
59b17aa47e
|
@ -14,6 +14,7 @@ plugins {
|
|||
id("io.freefair.lombok") version "8.6"
|
||||
id("org.springframework.boot") version "3.2.3"
|
||||
id("com.github.ben-manes.versions") version "0.51.0"
|
||||
application
|
||||
}
|
||||
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package icu.samnyan.aqua.spring
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import java.lang.System.err
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
@Configuration
|
||||
class DataSourceConfig(@Value("\${spring.datasource.url}") val databaseUrl: String) {
|
||||
init {
|
||||
if (databaseUrl.lowercase().contains("jdbc:sqlite:", ignoreCase = true)) {
|
||||
err.println("!!! ERROR !!!\n" +
|
||||
"SQLite isn't supported in the v1 development branch yet.\n" +
|
||||
"Please either switch to MariaDB or wait for the stable v1 release.\n")
|
||||
exitProcess(1)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue