package eu.friedcutlet.yokan.database.room import androidx.room.Room import eu.friedcutlet.yokan.AndroidAppContext actual fun createYokanRoomDatabase(profileId: eu.friedcutlet.yokan.domain.ProfileId): YokanRoomDatabase { val ctx = AndroidAppContext.appContext ?: error("AndroidAppContext.appContext not initialized; call before opening Room.") val dbFile = ctx.getDatabasePath(eu.friedcutlet.yokan.domain.ProfileStorageNamespace(profileId).databaseRelativePath).apply { parentFile?.mkdirs() } return Room.databaseBuilder( context = ctx.applicationContext, name = dbFile.absolutePath, ).buildYokanRoom() }