Skip to content

feat: enable pagination for query result previews - #933

Open
DevvoLazza wants to merge 1 commit into
libredb:mainfrom
DevvoLazza:feature/query-result-pagination
Open

DevvoLazza wants to merge 1 commit into
libredb:mainfrom
DevvoLazza:feature/query-result-pagination

Conversation

@DevvoLazza

Copy link
Copy Markdown
Contributor

Description

Sidebar previews currently put LIMIT 50 (or TOP/FETCH) in the editor, so the existing pagination treats the preview as a user-written hard bound and stops at 50 rows. Send the preview size as an execution option instead, allowing subsequent batches to append in both standalone Studio and StudioWorkspace.

This implements the maintainer's scoped design in #816: manual Load More remains; automatic infinite scrolling is deferred.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Test addition or update

Related Issue

Closes #816

Changes Made

  • Reuse the original batch size and offset, preserve loaded rows on failure, and offer Retry. Reject overlapping requests and stale pages after query or connection changes; support retry after embedded cancellation.
  • Keep user-written LIMIT/TOP/FETCH bounds intact. Declare optional supportsResultPagination for every provider, with matching documentation and integration assertions; hide paging for providers that cannot apply an offset. API hasMore requires an automatically applied limit.
  • Show one notice beside AUTO-LIMITED when the executed query has no outer ORDER BY, without adding a sort. Keep the status controls readable on mobile and resolve the newly created tab when embedded sidebar execution starts.
  • Update existing source-line citations shifted by the provider declarations; their drift test passes.

Testing

  • Tested locally

  • Added/updated regression tests, including failing cases before the fixes

  • All executed tests pass

  • Full isolated suite: 546 files passed, 17,603 tests passed, 71 skipped, zero failures. Twelve Helm files were not run because Helm is unavailable.

  • Targeted verification: 553 tests passed. Real SQLite preparation/execution covers disjoint 50 + 50 + 21 pages, preview dispatch, final-page detection, hard bounds, double clicks, failure/retry, cancellation and stale responses in both execution hooks. All 17 provider integration files also pass.

  • Format, lint, typecheck, knip, README, chart, channel-showcase and security checks pass; lint reports 240 existing warnings and zero errors. Production app build, library build and packed-tarball attw checks pass.

  • Browser proof against an isolated production server: sidebar 50 -> 100 -> 121; failed-page retry retains existing rows; explicit LIMIT 50 stays final; mobile controls fit at 390 x 844; ordered query loads 500 + 121 and displays the final row 621.

  • Modified/new source: 13,163/13,163 measured lines covered. Global local coverage is 57,944/57,949 (99.99%): only unchanged src/instrumentation.ts:32-36 are uncovered because the failure-path test requires POSIX non-root permissions and skips Windows. The required 100% gate needs Linux CI confirmation.

Test Environment

  • LibreDB Studio 0.16.0; Windows; Node.js 24.16.0; Bun 1.4.2; SQLite.
  • Browser verification: local production build, desktop and mobile viewport.

Checklist

  • Code follows the project's style guidelines and has been self-reviewed
  • Documentation and effective regression tests are updated
  • No new lint warnings
  • New and existing executed tests pass locally
  • Required CI test job passes the 100% line-coverage gate
  • Provider code, matching documentation and integration tests are updated together

@cevheri cevheri added the loop:needs-info Maintainer-loop task blocked on human-reviewed clarification label Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@DevvoLazza

Copy link
Copy Markdown
Contributor Author

Hi, I won’t be able to work on this today or tomorrow as I’m away from home. As soon as I’m back, I’ll continue and finish the remaining fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loop:needs-info Maintainer-loop task blocked on human-reviewed clarification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add pagination and infinite scroll to query results

2 participants