SQLDelight: Would it be possible for `Query<......
# squarelibraries
i
SQLDelight: Would it be possible for
Query<...>.asFlow().mapToList()
to be cached somehow when the related tables haven't changed? Right now this uses a cold flow and reads from the DB on each collect. Is something like this on the roadmap currently?
k
You could keep reference to the property in the class and use
StateFlow
by applying
stateIn
operator
i
Thanks, that's what I was thinking of doing, I was just wondering if such functionality is planned to be integrated in the library itself
j
No. The library knows nothing about the lifecycles within your usage in which it would make sense to cache flow collection. I would go so far as to say no library should do this automatically