-
Notifications
You must be signed in to change notification settings - Fork 539
feat: add initialOffset for OffsetQueryPagingSource #4802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add initialOffset for OffsetQueryPagingSource #4802
Conversation
@MohamadJaara Please run |
These changes will break the ABI. Are we okay with it due to the status of this module? Or do we need a binary compatibility overload? |
@hfhbd i added new functions with the initial value hopfully this will be fine |
I assume we want a default param for initialOffset anyways which we could @jvmoverloads to get binary compatibility |
@AlecKazakova do you mean for the internal class OffsetQueryPagingSource<RowType : Any> @JvmOverloads constructor (
private val queryProvider: (limit: Int, offset: Int) -> Query<RowType>,
private val countQuery: Query<Int>,
private val transacter: TransacterBase,
private val context: CoroutineContext,
private val initialOffset: Int = 0,
) : QueryPagingSource<Int, RowType>() { or for the functions @Suppress("FunctionName")
@JvmName("QueryPagingSourceInt")
@JvmOverloads
fun <RowType : Any> QueryPagingSource(
countQuery: Query<Int>,
transacter: TransacterBase,
context: CoroutineContext,
queryProvider: (limit: Int, offset: Int) -> Query<RowType>,
initialOffset: In = 0,
): PagingSource<Int, RowType> = OffsetQueryPagingSource(
queryProvider,
countQuery,
transacter,
context,
initialOffset,
) |
for ABI compatibility we would need both |
The constructor does not need overloads because nobody except our own code is referencing it. |
cool, just the methods then |
...ions/androidx-paging3/src/commonMain/kotlin/app/cash/sqldelight/paging3/QueryPagingSource.kt
Show resolved
Hide resolved
* feat: add initialOffset for OffsetQueryPagingSource * apply spotless check * binary compatibility overload * typo * add @jvmoverloads for ABI compatibility * add @jvmoverloads for ABI compatibility
* Test against 2023.2 * Update dependency mkdocs-material-extensions to v1.3.1 (#4832) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.squareup:kotlinpoet to v1.15.2 (#4855) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump sql-psi to 0.5.0 (#4794) * Bump sql-psi to 0.5.0-SNAPSHOT * Use published loadFolderFromResources function * Expose HSQL test-fixtures * Expose MySql test-fixtures * Move timber from sql-psi to sqldelight * Expose Sqlite Json test-fixtures * Expose Sqlite 3.18 test-fixtures * Expose Sqlite 3.24 test-fixtures * Expose Sqlite 3.25 test-fixtures * Expose Sqlite 3.30 test-fixtures * Expose Sqlite 3.33 test-fixtures * Expose Sqlite 3.35 test-fixtures * Expose Sqlite 3.38 test-fixtures * Spotless * Adopt changed sql-psi api * Add snapshot repo to test snapshot * Fix Infer between * Add missing snapshot repo * Add missing snapshot repo * Switch to the release version * Use new loadFolderFromResources shortcut --------- Co-authored-by: hfhbd <hfhbd@users.noreply.github.com> * Add TRUNCATE to postgres dialect (#4817) Co-authored-by: Alec Kazakova <1675456+AlecKazakova@users.noreply.github.com> * feat: add initialOffset for OffsetQueryPagingSource (#4802) * feat: add initialOffset for OffsetQueryPagingSource * apply spotless check * binary compatibility overload * typo * add @jvmoverloads for ABI compatibility * add @jvmoverloads for ABI compatibility * Update agp to v8.2.0 (#4861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin intellij to v1.16.1 (#4862) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix compatibility issues --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philip Wedemann <22521688+hfhbd@users.noreply.github.com> Co-authored-by: hfhbd <hfhbd@users.noreply.github.com> Co-authored-by: Bastien de Luca <de-luca@users.noreply.github.com> Co-authored-by: Mohamad Jaara <jaara.moh@gmail.com>
* feat: add initialOffset for OffsetQueryPagingSource * apply spotless check * binary compatibility overload * typo * add @jvmoverloads for ABI compatibility * add @jvmoverloads for ABI compatibility
* Test against 2023.2 * Update dependency mkdocs-material-extensions to v1.3.1 (#4832) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.squareup:kotlinpoet to v1.15.2 (#4855) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump sql-psi to 0.5.0 (#4794) * Bump sql-psi to 0.5.0-SNAPSHOT * Use published loadFolderFromResources function * Expose HSQL test-fixtures * Expose MySql test-fixtures * Move timber from sql-psi to sqldelight * Expose Sqlite Json test-fixtures * Expose Sqlite 3.18 test-fixtures * Expose Sqlite 3.24 test-fixtures * Expose Sqlite 3.25 test-fixtures * Expose Sqlite 3.30 test-fixtures * Expose Sqlite 3.33 test-fixtures * Expose Sqlite 3.35 test-fixtures * Expose Sqlite 3.38 test-fixtures * Spotless * Adopt changed sql-psi api * Add snapshot repo to test snapshot * Fix Infer between * Add missing snapshot repo * Add missing snapshot repo * Switch to the release version * Use new loadFolderFromResources shortcut --------- Co-authored-by: hfhbd <hfhbd@users.noreply.github.com> * Add TRUNCATE to postgres dialect (#4817) Co-authored-by: Alec Kazakova <1675456+AlecKazakova@users.noreply.github.com> * feat: add initialOffset for OffsetQueryPagingSource (#4802) * feat: add initialOffset for OffsetQueryPagingSource * apply spotless check * binary compatibility overload * typo * add @jvmoverloads for ABI compatibility * add @jvmoverloads for ABI compatibility * Update agp to v8.2.0 (#4861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin intellij to v1.16.1 (#4862) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix compatibility issues --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philip Wedemann <22521688+hfhbd@users.noreply.github.com> Co-authored-by: hfhbd <hfhbd@users.noreply.github.com> Co-authored-by: Bastien de Luca <de-luca@users.noreply.github.com> Co-authored-by: Mohamad Jaara <jaara.moh@gmail.com>
Introduces initialOffset parameter to
OffsetQueryPagingSource
, allowing consumers to set a custom starting point. Enhances flexibility and control over data retrieval.