Skip to content

Stevenmasley/paged users #1057

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

Closed
wants to merge 3 commits into from
Closed

Stevenmasley/paged users #1057

wants to merge 3 commits into from

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Apr 18, 2022

What this does

Introduces a method to return paginated data using sqlc

SQL linter brekas on sqlc syntax

Emyrk added 2 commits April 12, 2022 17:22
- Currently "before" does not work
- Filters not added yet
@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #1057 (60e0059) into main (4f0f216) will decrease coverage by 5.21%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1057      +/-   ##
==========================================
- Coverage   66.77%   61.56%   -5.22%     
==========================================
  Files         241      107     -134     
  Lines       14668     1137   -13531     
  Branches      115      115              
==========================================
- Hits         9795      700    -9095     
+ Misses       3882      412    -3470     
+ Partials      991       25     -966     
Flag Coverage Δ
unittest-go-macos-latest ?
unittest-go-postgres- ?
unittest-go-ubuntu-latest ?
unittest-go-windows-2022 ?
unittest-js 61.56% <ø> (ø)
Impacted Files Coverage Δ
coderd/coderd.go
coderd/coderdtest/coderdtest.go
coderd/database/queries.sql.go
coderd/httpmw/ratelimit.go
coderd/users.go
codersdk/users.go
coderd/database/pubsub_memory.go
cli/parametercreate.go
provisioner/terraform/serve.go
agent/agent.go
... and 124 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f0f216...60e0059. Read the comment docs.

@BrunoQuaresma
Copy link
Collaborator

Does it conflict with this PR #1028?

@Emyrk
Copy link
Member Author

Emyrk commented Apr 18, 2022

Does it conflict with this PR #1028?

It does yes. We should pop in a call and discuss.

@BrunoQuaresma
Copy link
Collaborator

Sorry, I put the PR in an "auto-merge" mode before lunch 🤦. But please, let me know if you need any help to solve the conflicts.

@Emyrk
Copy link
Member Author

Emyrk commented Apr 18, 2022

I talked with @BrunoQuaresma about this and will be closing this PR.

This PR implements cursor based pagination. Offset pagination is vastly simpler and will be sufficient for the UI. The downside of offset of pagination happens with live data. I can circumvent this by adding a created_after query param to enable cursor based pagination in the forward direction. This means api scripts can use a cursor, while applications like the UI can use an offset.

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.

3 participants