[+] Check sqlite before application start

This commit is contained in:
Azalea
2024-03-20 17:54:16 -04:00
parent 9155bfb886
commit 59b17aa47e
2 changed files with 19 additions and 0 deletions

View File

@@ -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)
}
}
}