mirror of
https://github.com/simonw/datasette.git
synced 2026-07-09 09:04:42 +02:00
Expose count truncation in table JSON via count_truncated extra
The count extra is computed with a limit subquery, so a count equal to count_limit + 1 (default 10001) actually means "at least this many" - but only the HTML view knew that. A public count_truncated extra now reports the flag and is implicitly included whenever count is requested, using the same logic the HTML view already used. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GrHZSypDfMnym1tM5XJAFZ
This commit is contained in:
parent
b09dceea88
commit
b958d03c0f
6 changed files with 90 additions and 21 deletions
|
|
@ -302,6 +302,15 @@ The available table extras are listed below.
|
|||
|
||||
15
|
||||
|
||||
``count_truncated``
|
||||
True if the count hit Datasette's counting limit, meaning the real number of matching rows is at least the reported count. (May execute additional queries.)
|
||||
|
||||
``GET /fixtures/facetable.json?_extra=count,count_truncated``
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
false
|
||||
|
||||
``count_sql``
|
||||
SQL query string used to calculate the total count for the current table view, including active filters.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue