Hello,
I’m finding the web DBA functionality of BaseX more and more useful but one thing I really miss from the GUI is the display of the number of results in the top right corner. Many times when I’m running a quick query I want to know how many results there are and see at least an example of the results (as often the full set is too long to be displayed). I know I could add count() round the query and run it again but I’m lazy. :)
So, I’m thinking it would be good to add the total results to the DBA Queries page
I was about to start putting some code together when I realised I don’t know what would be the most efficient way to do this - so I’m turning to the list to see if a) other people think this would be useful, and b) what suggestions people have of the best way to do it.
I’m thinking of returning the total count as an HTTP header so there’s no impact on any code currently using the result.
What’s the best way of getting the count though? The naive solution is to run each query twice, once to get the count and once to get the results but that seems less than ideal. I think there’s something with caching of queries that may help. Is that how it’s done in the GUI?
Any pointers gratefully received and of course I’ll share any code back to the project.
Thanks, James