mohamed rejeb
07/02/2024, 3:25 AMJan
07/02/2024, 5:27 PMmohamed rejeb
07/03/2024, 7:26 AM// Dto
@Serializable
data class SampleDto(
val id: String,
@SerialName("other_id_data")
val other: OtherDto? = null,
)
// Call
fun getColumns() =
Columns.raw(COLUMNS_VALUE)
const val COLUMNS_VALUE = "*, other_id_data: other_id(*)"
supabase.getAll(
page = page,
limit = limit,
columns = SampleDto.getColumns(),
) {
filter {
gte(
"other_id_data.date",
Clock.System.now().toLocalDateTime(TimeZone.UTC).date,
)
}
}
Jan
07/03/2024, 3:59 PMgetAll
method look?mohamed rejeb
07/03/2024, 5:22 PMfilter
after range
can fix this? Did you manage to reproduce it
suspend inline fun <reified T : Any> SupabaseDataSource<T>.getAll(
page: Long,
limit: Int = 10,
columns: Columns = Columns.ALL,
crossinline filter: @PostgrestFilterDSL PostgrestRequestBuilder.() -> Unit = {},
) = handleErrors {
postgrestBuilder
.select(
columns = columns,
request = {
filter()
val from = (page - 1) * limit
val to = page * limit - 1
range(
from = from,
to = to,
)
},
)
.decodeList<T>()
}
Jan
07/04/2024, 11:38 AMrange
?mohamed rejeb
08/04/2024, 8:02 PM