feat(editor): show total row count for the current query#410
Open
Davydhh wants to merge 1 commit into
Open
Conversation
- display the exact row count as "{{total}} rows" next to the page
indicator
- count the reconstructed filtered query (loadCount counted the base
table query, ignoring the filter box's WHERE)
- reset the count when the query/filter changes, so a stale count from a
previous query is no longer shown (still preserved across pagination)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The result footer already had a
#button that computes the exact row count on demand (an exactCOUNT(*)is skipped by default because it's expensive on large tables). Until now that count only fed the "Page X of Y" page total. This PR surfaces the actual number — the#button resolves into12,345 rowsonce loaded — and fixes two correctness bugs in the existing count along the way.Changes
Page X of Y | 12,345 rows(the#button's slot becomes the count). New i18n keyeditor.rowCount, added to all 8 locales.loadCountcounted the baseSELECT * FROM <table>, ignoring the WHERE typed in the filter box. It now counts the current table with the same filter (dropping ORDER BY/LIMIT, which are pointless for a count and would otherwise cap it).How to test
SELECT * FROM <table>).#→ exact filtered count appears (e.g.39,258 rows), matchingSELECT count(*) FROM <table> WHERE <condition>.#reappears; click it → the new, correct count shows.Notes
#button); the performance-motivated design of skippingCOUNT(*)by default is unchanged.count_querychanges.