SELECT 0 query results, it would be nice to have an explicit message displayed instead of the table of results, so that especially on dashboard views it is clear that the query succeeded but there are simply no results.
An empty query result set shows up with just the title, a large white space and the last refreshed timestamp. I think it would be neater if a statement such as: “The query returned no results” was displayed instead.
Redash already does this. If a query has no results a placeholder is displayed.
But “no result” is different from “no rows returned”. And from what I’ve seen: Redash is not unique in displaying this literally as an empty table (see examples from SMSS and TablePlus further down).
This seems a bit like an “off light”. The default assumption in Redash (and any query tool) is that a query executed successfully. If any errors occurred these will be identified with (usually) red indicators:
It may be useful in a narrow-case: but in this situation it would probably be more meaningful to write your query to perform a
COUNT() aggregation and display this with a big counter visualisation, thus granting context to the query result. For example:
Nevertheless, if you want to implement this on your own some things to consider:
- What will be displayed instead? An image? Plain text? Will it be user configurable?
- Will this work for non-table visualisations also? How will you implement this in a backwards compatible form?
- Will the setting apply to all visualisations of a query? Configurable per organisation? Per user?
Thanks for the detailed reply, I appreciate the effort!
My main motivation here is to help the user see that the query has succeeded and there just aren’t any results from the server, so that’s distinct from the Query has no result message which I understand as being a Redash-specific indication.
One thing that stands out to me here especially when comparing the
SELECT 0 result with TablePlus is that they do at least show the column names. I think that already makes it more obvious that the query succeeded and there’s just no data to display.
The column names are returned from
/api/query_results/[id] so this should already be easy to implement!