https://kotlinlang.org logo
#room
Title
b

Brandon Howard

09/02/2022, 12:31 PM
Hey, Is there any way to programmatically set the room db version number programmatically, at runtime? It seems like thats not possible based on the message im getting when i try
An annotation argument must be a compile-time constant
I’m just wondering if there’s another api that could help with this?
m

Michael Marshall

09/02/2022, 2:13 PM
Why do you need to do that?
b

Brandon Howard

09/02/2022, 2:20 PM
Because I need to be able to migrate the database from the server. Obviously Room wont be able to help use access any data that we add this way but I thought it might be ideal to let room manage the migrations still. Doing it with that underlying
SQLiteDatabase
seems like it may work fine though
m

Michael Marshall

09/03/2022, 3:18 AM
I'm still confused. What will determine your database version number? Room does a lot of validation and code generation at compile time, so I'm not sure it's gonna work well for this
b

Brandon Howard

09/06/2022, 1:19 PM
yeah, thats the conclusion i’ve come to as well
3 Views