Hi all - I'd like to do something that seems like ...
# room
a
Hi all - I'd like to do something that seems like it should be simple but... is not 😕. I have a Dao for a model with nullable fields. That model is created locally and then is subsequently updated via a model coming from the network. The model has some derived foreign keys and therefore those columns are not present coming from the API. I basically just want to update any fields ONLY when the update is nonNull.
I know that you can update only certain columns via a
@Query
using
UPDATE table SET ...
but that would be cumbersome given there are two derived fields in the model so I'd need 3 overloads of that function to account for all cases
I guess I can also do an ugly raw SQL
CASE
but was hoping there is some cleaner way I just don't know about