diff --git a/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/onetomany/OneToManyAndroidRepo.kt b/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/onetomany/OneToManyAndroidRepo.kt index 96be3bd2f77..31abcac4e61 100644 --- a/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/onetomany/OneToManyAndroidRepo.kt +++ b/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/onetomany/OneToManyAndroidRepo.kt @@ -143,12 +143,11 @@ class OneToManyAndroidRepo( }.toLong() override suspend fun count(k: Key): Long = helper.blockingReadableTransaction { - select( + selectDistinct( tableName, columns = valueColumnArray, selection = "$idColumnName=?", - selectionArgs = arrayOf(k.keyAsString()), - limit = FirstPagePagination(1).limitClause() + selectionArgs = arrayOf(k.keyAsString()) ).use { it.count }