Skip to content

Conversation

mattusik
Copy link

@mattusik mattusik commented Mar 5, 2025

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests and did you add any new tests needed for your feature?
  2. Did you update all templates (if applicable)?
  3. Did you add the relevant documentation (if applicable)?
  4. Did you test locally to make sure your feature works as intended?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

✨ Enhancement: Cursor Pagination Without Count

Summary

This PR extends the package by enabling cursor pagination to function without requiring a total count. While this feature was already available for simple pagination, it was not implemented for cursor-based pagination.

Problem

Simple pagination and cursor pagination differ in how they retrieve records:

Simple Pagination (Uses LIMIT and OFFSET)

SELECT * FROM table LIMIT x OFFSET y;
  • This approach requires counting total records, which can be slow for large datasets.
  • Using OFFSET can cause performance issues as the database must scan all previous rows.

Cursor Pagination (Uses id > {cursor} and LIMIT)

SELECT * FROM table WHERE id > {cursor} LIMIT x;
  • More efficient because it avoids scanning previous rows.
  • Does not require a total count, making it faster on large datasets.

Solution

  • Added support for cursor pagination without requiring a total count.
  • This allows users to benefit from cursor pagination’s efficiency without unnecessary database load.

Impact

  • Improves performance, especially for large datasets.
  • Maintains backward compatibility with existing implementations.

@lrljoe
Copy link
Collaborator

lrljoe commented Apr 1, 2025

Thanks, I will review this week, apologies but I've been on holiday

Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.90%. Comparing base (d96df8e) to head (ba80e77).
Report is 24 commits behind head on development.

Files with missing lines Patch % Lines
src/Traits/WithData.php 0.00% 7 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@                Coverage Diff                @@
##             development    #2231      +/-   ##
=================================================
- Coverage          89.96%   89.90%   -0.06%     
- Complexity          2154     2156       +2     
=================================================
  Files                242      242              
  Lines               4853     4856       +3     
=================================================
  Hits                4366     4366              
- Misses               487      490       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

stale bot commented May 1, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 1, 2025
@lrljoe lrljoe removed the wontfix This will not be worked on label May 2, 2025
Copy link

stale bot commented Jun 2, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 2, 2025
@lrljoe lrljoe removed the wontfix This will not be worked on label Jun 4, 2025
Copy link

stale bot commented Jul 4, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 4, 2025
@stale stale bot closed this Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants