SupabaseS
Supabase4mo ago
oli

Count in Supabase-kt

Hi, I wanted to ask what's up with the .count() function referenced in the supabase docs. (The countOrNull() functions work without any issues)

        val enrollmentCount = supabaseClient.from("enrollments")
            .select {
                count(Count.EXACT)
                filter {
                    eq("user_id", userId)
                }
            }.count()!! // this prevents it from working


None of the following candidates is applicable:
fun <K, V> Map<out K, V>.count(): Int
fun <K, V> Map<out K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean): Int
fun <T> Array<out T>.count(): Int
fun ByteArray.count(): Int
fun ShortArray.count(): Int
fun IntArray.count(): Int
fun LongArray.count(): Int
fun FloatArray.count(): Int
fun DoubleArray.count(): Int
fun BooleanArray.count(): Int
fun CharArray.count(): Int
fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int
fun ByteArray.count(predicate: (Byte) -> Boolean): Int
fun ShortArray.count(predicate: (Short) -> Boolean): Int
fun IntArray.count(predicate: (Int) -> Boolean): Int
fun LongArray.count(predicate: (Long) -> Boolean): Int
fun FloatArray.count(predicate: (Float) -> Boolean): Int
fun DoubleArray.count(predicate: (Double) -> Boolean): Int
fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int
fun CharArray.count(predicate: (Char) -> Boolean): Int
...
image.png
Was this page helpful?