-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count queries #29
Comments
Most queries in webstore have an "X-Count" header, just pass along _limit=0 to get the count only. TODO here is to make sure the raw SQL endpoint has it. |
OK. Couldn't see this anywhere in the docs hence the ticket :-) Have to say X-Count header does not seem the most helpful method -- e.g. means that in javascript i have do do something special with my jqXHR object to get at headers rather than processing the usual returned json data. I'm wondering whether all of this is pointing to thinking of a slightly more general response format (think of the response objects from sqlalchemy queries). |
As mentioned during our skype conversation yesterday, I'm still hesistant to adopt a proper results format: this would kill the easy transition from export to API which I think is the key to making this thing useful. If needed, I think _count=true may be the better option. |
We accept _count=true and _count=1. Counting will only happen then and the header nor the json will be populated otherwise. |
@kindly: I thought plan was for count to always be in results but to be null if not computed. I think this is nicer. For HTML I'm less sure but for simplicity it would be the same. That said this does not seem to matter much either way ... |
I want a way to just get back a total count for a given query:
Could change so total/count is returned on every query but this would require result set object to change from just being a list of results to something like:
IMO you are probably going to want something like this going forward anyway but that is just my 2c.
Details
Update or json and html view (no change to csv). Change re json format is already part of #40.
The text was updated successfully, but these errors were encountered: