Skip to content

Commit f55c335

Browse files
committed
chore: release v0.5.0
1 parent 11e5064 commit f55c335

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ThisBuild / makePomConfiguration := makePomConfiguration.value.withConfiguration
3030
)
3131

3232
// Version and Scala settings
33-
val slickSeekerVersion = "0.4.0"
33+
val slickSeekerVersion = "0.5.0"
3434

3535
val scala3Version = "3.3.5"
3636
val scala213Version = "2.13.16"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package io.github.devnico.slickseeker.pagination
2+
3+
import io.github.devnico.slickseeker.cursor.CursorEnvironment
4+
import slick.jdbc.JdbcProfile
5+
6+
import scala.concurrent.ExecutionContext
7+
8+
/** Common base trait for all seeker implementations.
9+
*
10+
* Provides a unified interface for cursor-based pagination across different seeker variants.
11+
*
12+
* @tparam U
13+
* The unpacked type of query results
14+
* @tparam CVE
15+
* The cursor value encoding type
16+
*/
17+
trait Seeker[U, CVE] {
18+
19+
/** Execute a paginated query with cursor-based navigation.
20+
*
21+
* @param limit
22+
* Maximum number of items to return
23+
* @param cursor
24+
* Optional cursor for pagination navigation
25+
* @param maxLimit
26+
* Maximum allowed limit
27+
* @param profile
28+
* JDBC profile for database operations
29+
* @param cursorEnvironment
30+
* Environment for encoding/decoding cursors
31+
* @param ec
32+
* Execution context for async operations
33+
* @return
34+
* Database action that returns a paginated result
35+
*/
36+
def page[Profile <: JdbcProfile](
37+
limit: Int,
38+
cursor: Option[String],
39+
maxLimit: Int
40+
)(implicit
41+
profile: Profile,
42+
cursorEnvironment: CursorEnvironment[CVE],
43+
ec: ExecutionContext
44+
): profile.api.DBIOAction[PaginatedResult[U], profile.api.NoStream, profile.api.Effect.Read]
45+
}

slick-seeker/src/main/scala/io/github/devnico/slickseeker/pagination/SlickPgTupleSeeker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final case class SlickPgTupleSeeker[E, U, CVE, C, CU, D <: Ordering.Direction](
2929
columns: Vector[PgTupleSeekColumn[E, U, CVE]],
3030
qwc: QueryWithCursor[E, U, C, CU, CVE],
3131
direction: D
32-
)(implicit shape: lifted.Shape[lifted.FlatShapeLevel, E, U, E]) {
32+
)(implicit shape: lifted.Shape[lifted.FlatShapeLevel, E, U, E]) extends Seeker[U, CVE] {
3333

3434
import SlickSeeker._
3535

slick-seeker/src/main/scala/io/github/devnico/slickseeker/pagination/SlickSeeker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final case class SlickSeeker[E, U, CVE, C, CU](
2222
baseQuery: lifted.Query[E, U, Seq],
2323
columns: Vector[SeekColumn[E, U, CVE]],
2424
qwc: QueryWithCursor[E, U, C, CU, CVE]
25-
)(implicit shape: lifted.Shape[lifted.FlatShapeLevel, E, U, E]) {
25+
)(implicit shape: lifted.Shape[lifted.FlatShapeLevel, E, U, E]) extends Seeker[U, CVE] {
2626
import ColumnSeekFilterTypes._
2727
import SlickSeeker._
2828

0 commit comments

Comments
 (0)