Files
mantra-kmp/composeApp/src/commonMain/kotlin/ac/aux/compose/managers/DatabaseManager.kt
T

32 lines
886 B
Kotlin
Raw Normal View History

2026-03-26 02:52:08 +02:00
package ac.aux.compose.managers
import ac.aux.compose.AuxGlobal
import ac.aux.compose.database.AuxDatabaseConstructor
import ac.aux.compose.database.builder.PlatformDatabaseBuilder
import ac.aux.compose.database.builder.getRoomDatabase
2026-03-31 23:37:39 +02:00
import androidx.room.Room
2026-03-26 02:52:08 +02:00
class DatabaseManager(
auxGlobal: AuxGlobal
) {
val auxDatabase by lazy {
getRoomDatabase(
PlatformDatabaseBuilder.getDatabaseBuilder(
auxGlobal.platformContext
)
)
}
2026-03-31 23:37:39 +02:00
/**
* Dynamic data like user feeds and the likes will be in a in-memory db.
*
* We may also decide to just use the normal DB and manage what's saved better...
*/
val inMemoryAuxDatabase by lazy {
getRoomDatabase(
PlatformDatabaseBuilder.getInMemoryDatabaseBuilder(
auxGlobal.platformContext
)
)
}
2026-03-26 02:52:08 +02:00
}