refactor(build, dependencies): introduce SQLDelight WebWorker setup, update Spring Boot dependencies, and align versions
Configured `sqlite.worker.js` for OPFS-backed SQLite WASM operations in the frontend build pipeline. Added new Spring Boot dependency bundles including secure service configurations. Integrated updated database utilities with enhanced error handling. Removed outdated circuit breaker tests and replaced them with modern unit and integration test setups.
This commit is contained in:
+1
-1
@@ -3,6 +3,6 @@ package at.mocode.frontend.core.localdb
|
||||
import app.cash.sqldelight.db.SqlDriver
|
||||
|
||||
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
|
||||
expect class DatabaseDriverFactory {
|
||||
expect class DatabaseDriverFactory() {
|
||||
suspend fun createDriver(): SqlDriver
|
||||
}
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package at.mocode.frontend.core.localdb
|
||||
|
||||
import org.koin.dsl.module
|
||||
|
||||
/**
|
||||
* Thin wrapper around SQLDelight `AppDatabase` creation.
|
||||
*
|
||||
* The platform-specific part is the `DatabaseDriverFactory` (expect/actual),
|
||||
* which provides the appropriate SQLDelight driver (JVM sqlite driver, JS WebWorkerDriver, ...).
|
||||
*/
|
||||
class DatabaseProvider(
|
||||
private val driverFactory: DatabaseDriverFactory
|
||||
) {
|
||||
suspend fun createDatabase(): AppDatabase {
|
||||
val driver = driverFactory.createDriver()
|
||||
return AppDatabase(driver)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Koin module to provide the SQLDelight database for all frontend targets.
|
||||
*/
|
||||
val localDbModule = module {
|
||||
single<DatabaseDriverFactory> { DatabaseDriverFactory() }
|
||||
single<DatabaseProvider> { DatabaseProvider(get()) }
|
||||
}
|
||||
Reference in New Issue
Block a user