Fixed too many sql error on selection update

This commit is contained in:
Arty Bishop committed 2020-10-10 21:47:44 +01:00
1 parent c6aae706f9
commit 753a3c823f
1 file changed
+3 -3
@@ -47,12 +47,12 @@ interface EntriesDao {
@Transaction
suspend fun updateEntriesSelection(satIds: List<Int>) {
clearSelection()
updateSelection(satIds)
satIds.forEach { updateSelection(it) }
}
@Query("UPDATE entries SET isSelected = 0")
suspend fun clearSelection()
@Query("UPDATE entries SET isSelected = 1 WHERE catNum IN (:satIds)")
suspend fun updateSelection(satIds: List<Int>)
@Query("UPDATE entries SET isSelected = 1 WHERE catNum = :satId")
suspend fun updateSelection(satId: Int)
}