Skip to content
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

Allow construction of OffsetQueryPagingSource with Long #3409

Merged

Conversation

veyndan
Copy link
Collaborator

@veyndan veyndan commented Aug 4, 2022

No description provided.

* @see toInt
*/
@Suppress("FunctionName")
fun <RowType : Any> QueryPagingSourceLong(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer having this be the same name as the other function (QueryPagingSource) but we get a Platform declaration clash when doing so. Open to better names

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just switch them so the Int one has a fancy name since SQLDelight users will pretty much only use this one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using @JvmName should let you keep the names the same in Kotlin

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just renamed it to QueryPagingSource after specifying @JvmName.

@AlecStrong I just suffixed the type to each one for consistency in the @JvmName. I'm assuming that no one's using SQLDelight with Java.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, perfect

@@ -629,14 +629,40 @@ class OffsetQueryPagingSourceTest {
assertTrue(pagingSource.jumpingSupported)
}

private fun query(limit: Int, offset: Int) = object : Query<TestItem>(
@Test
fun load_initialEmptyLoad_QueryPagingSourceLong() = runTest {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted a test to ensure that the constructor works as expected. This test is a copy of load_initialEmptyLoad, just using Long instead of Int.

* @see toInt
*/
@Suppress("FunctionName")
fun <RowType : Any> QueryPagingSourceLong(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just switch them so the Int one has a fancy name since SQLDelight users will pretty much only use this one?

@veyndan veyndan force-pushed the veyndan/2022-08-04/QueryPagingSourceLong branch from 00740af to 35f38e6 Compare August 4, 2022 16:15
@veyndan veyndan merged commit 8741341 into cashapp:master Aug 4, 2022
@veyndan veyndan deleted the veyndan/2022-08-04/QueryPagingSourceLong branch August 4, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants