https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
v

Vaibhav Jaiswal

03/26/2024, 1:30 PM
I have this query
Copy code
updateLike:
UPDATE NewsEntity
SET likesCount = likesCount + :likesDelta , isLiked = :isLiked
WHERE id = :id;
This is how I have defined my columns
Copy code
likesCount INTEGER NOT NULL,
isLiked INTEGER AS Boolean NOT NULL,
and I am observing it from db like
Copy code
fun observeById(id: String) = queries.findById(id).asFlow().mapToOneNotNull(Dispatchers.IO)
But i get the updated isLiked only, likesCount is still the old one