refact: move db to .flocon folder (#447)
Some checks failed
docs / deploy (push) Has been cancelled

Co-authored-by: Florent Champigny <florent@bere.al>
This commit is contained in:
Florent CHAMPIGNY 2025-12-09 11:32:35 +01:00 committed by GitHub
parent a5d4bbcd81
commit 5ad3e64a31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,9 @@ import androidx.room.RoomDatabase
import java.io.File
actual fun getDatabaseBuilder(): RoomDatabase.Builder<AppDatabase> {
val dbFile = File(System.getProperty("java.io.tmpdir"), "flocon_room.db")
val folder = File(System.getProperty("user.home"), ".flocon")
folder.mkdirs()
val dbFile = File(folder, "flocon_room.db")
// UNCOMMENT TO TEST ON AN EMPTY DB
// dbFile.delete()
return Room.databaseBuilder<AppDatabase>(