Hi all! I use SqlDelight multiplatform and I have a problem where a column is triggered via
.asFlow()
when another column is updated. What is the reason for this trigger and how to avoid it?
j
jw
01/19/2024, 12:43 AM
Currently all mutator operations on a table trigger all queries on that table
jw
01/19/2024, 12:43 AM
Making the notification system more granular is hard, and also implementation detail
jw
01/19/2024, 12:43 AM
It's better to requery too much than miss one
n
Nuru Nabiyev
01/19/2024, 5:25 AM
Thanks! Interestingly, only the individual columns of affected row are updated when asFlow is used, but not the whole
select *
row
Nuru Nabiyev
01/19/2024, 5:29 AM
Which is again also confusing because if I look at generated queries then they are triggered to update by that ID.
h
hfhbd
01/19/2024, 8:47 AM
You could write your own driver and match the id of the query to you logic notifying only a part of your tables, but the id is autogenerated based on the sql string hashcode (and some more to avoid collusions) so I doubt you want to implement it but get more update.
But using views could be a better idea.