Room Database setup
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user