Room Database setup

This commit is contained in:
Kgothatso Ngako committed 2026-03-26 00:20:20 +02:00
1 parent f8e7a20b98
commit 3dea688eea
16 files changed
+242 -50

No files matched your search

@@ -0,0 +1,3 @@
package ac.aux.compose
actual class PlatformContext
@@ -0,0 +1,16 @@
package ac.aux.compose.database.builder
import ac.aux.compose.PlatformContext
import ac.aux.compose.database.AuxDatabase
import androidx.room.Room
import androidx.room.RoomDatabase
import java.io.File
actual object PlatformDatabaseBuilder {
actual fun getDatabaseBuilder(platformContext: PlatformContext): RoomDatabase.Builder<AuxDatabase> {
val dbFile = File(System.getProperty("java.io.tmpdir"), "aux.db") // TODO: Stop using tmpDir on desktop...
return Room.databaseBuilder<AuxDatabase>(
name = dbFile.absolutePath,
)
}
}