update dependnecies

This commit is contained in:
2025-02-13 10:33:40 +06:00
parent b81af7e1c8
commit 9a20e8155e
4 changed files with 24 additions and 20 deletions

View File

@@ -2,19 +2,19 @@ package dev.inmo.micro_utils.pagination
import org.jetbrains.exposed.sql.*
fun Query.paginate(with: Pagination, orderBy: Pair<Expression<*>, SortOrder>? = null) = limit(
with.size,
with.firstIndex.toLong()
).let {
if (orderBy != null) {
it.orderBy(
orderBy.first,
orderBy.second
)
} else {
it
fun Query.paginate(with: Pagination, orderBy: Pair<Expression<*>, SortOrder>? = null) =
limit(with.size)
.offset(with.firstIndex.toLong())
.let {
if (orderBy != null) {
it.orderBy(
orderBy.first,
orderBy.second
)
} else {
it
}
}
}
fun Query.paginate(with: Pagination, orderBy: Expression<*>?, reversed: Boolean = false) = paginate(
with,