-
Notifications
You must be signed in to change notification settings - Fork 200
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
Refactor pagination SQL queries to use generic paramaters #2021
base: master
Are you sure you want to change the base?
Conversation
Will the empty list not generate a type error? |
No, using the
It will get rid of that error but you may need to annotate it with the type of
to fix that, you can: (users, pagination) <- paginatedSqlQuery @User "SELECT * FROM users" [] Should I add this as well? |
Yes, I think it's best to have a fully working example. |
Changes examples to use [] to match the expected [Action] parameter type.
282a457
to
dbd7bb5
Compare
The type of Line 416 in 17f17b5
|
41fad11
to
08fc538
Compare
@rvarun11 We played with this exact problem recently and ran into lots of weird stuff with the constraints. I believe the I think it seems to be needed here because of the subquery to do the count query. We actually implemented this exact function in our project a few months ago and were able to avoid the need for |
Update: sorry, I got confused. And |
cb1ab44
to
6d30b00
Compare
Change type signatures to use generic `q` type with `ToRow` constraint instead of `[Action]`
6d30b00
to
448caaf
Compare
Changes examples to use [] to match the expected [Action] parameter type.