-
Notifications
You must be signed in to change notification settings - Fork 510
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
Allow construction of OffsetQueryPagingSource with Long #3409
Conversation
* @see toInt | ||
*/ | ||
@Suppress("FunctionName") | ||
fun <RowType : Any> QueryPagingSourceLong( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
No description provided.