Skip to content

feat(editor): show total row count for the current query#410

Open
Davydhh wants to merge 1 commit into
TabularisDB:mainfrom
Davydhh:feat/result-total-count
Open

feat(editor): show total row count for the current query#410
Davydhh wants to merge 1 commit into
TabularisDB:mainfrom
Davydhh:feat/result-total-count

Conversation

@Davydhh

@Davydhh Davydhh commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

The result footer already had a # button that computes the exact row count on demand (an exact COUNT(*) 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 into 12,345 rows once loaded — and fixes two correctness bugs in the existing count along the way.

Changes

  • Show the total count — after loading, the footer reads Page X of Y | 12,345 rows (the # button's slot becomes the count). New i18n key editor.rowCount, added to all 8 locales.
  • Count now respects the filter (bug fix) — loadCount counted the base SELECT * 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).
  • Count resets on query change (bug fix) — the count was preserved across any re-run, so a changed query showed a stale total. It's now preserved only across pagination of the same query and cleared when the query or filter changes.

How to test

  1. Open a table (or run SELECT * FROM <table>).
  2. Type a filter and run.
  3. Click # → exact filtered count appears (e.g. 39,258 rows), matching SELECT count(*) FROM <table> WHERE <condition>.
  4. Change the filter/query and re-run → count clears and # reappears; click it → the new, correct count shows.
  5. Paginate → the count persists across pages.

Notes

  • The count stays on-demand (the # button); the performance-motivated design of skipping COUNT(*) by default is unchanged.
  • Frontend-only — no backend / count_query changes.

- 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)
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.

1 participant