For 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.
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:
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.
I like your reasoning here. And agree this should be easy to implement without any changes to the API (which makes it a much more straightforward change). Is this something you’d like to try? Or shall we leave it for another member of the community?
For now, this forum is the go-to place for support. However if a public slack or a discord channel makes more sense we’d consider it.
Having not looked too deeply into this, the first place I would check is QueryView.jsx. It appears there’s some logic that checks whether the query result returned from the API has a length > 0. If not, the Table visualisation is not rendered. The proposed change is to render the visualisation anyway, since we know the column names.