
io.github.ferhatwi.supabase.database.request.OrderableQuery.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of supabase-database-kt Show documentation
Show all versions of supabase-database-kt Show documentation
Some experiments on Kotlin client for Supabase Database, currently in development phase.
package io.github.ferhatwi.supabase.database.request
import io.github.ferhatwi.supabase.database.Count
import io.github.ferhatwi.supabase.database.Filter
import io.github.ferhatwi.supabase.database.Order
import io.github.ferhatwi.supabase.database.OrderBy
private fun A.order(column: String, orderBy: OrderBy, nullsFirst: Boolean): A =
apply { orders.add(Order(column, orderBy, nullsFirst)) }
open class OrderableQueryR internal constructor(
schema: String,
function: String,
selections: List,
range: Pair?,
count: Count?,
filters: MutableList,
orders: MutableList,
) : LimitableQueryR(schema, function, selections, range, count, filters, orders) {
fun order(column: String, orderBy: OrderBy = OrderBy.Ascending, nullsFirst: Boolean = false) =
order(column, orderBy, nullsFirst)
}
open class OrderableQuery internal constructor(
schema: String,
table: String,
selections: List,
range: Pair?,
count: Count?,
filters: MutableList,
orders: MutableList,
) : LimitableQuery(schema, table, selections, range, count, filters, orders) {
fun order(column: String, orderBy: OrderBy = OrderBy.Ascending, nullsFirst: Boolean = false) =
order(column, orderBy, nullsFirst)
}
open class OrderableQueryX internal constructor(
schema: String,
table: String,
selections: List,
range: Pair?,
count: Count?,
orders: MutableList,
) : LimitableQueryX(schema, table, selections, range, count, orders) {
fun order(column: String, orderBy: OrderBy = OrderBy.Ascending, nullsFirst: Boolean = false) =
order(column, orderBy, nullsFirst)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy