-
-
Notifications
You must be signed in to change notification settings - Fork 691
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
Custom SQL queries should use new JSON ?_extra= format #2049
Comments
As part of this I should be able to figure out which bits of the new code I wrote for the table view should actually be shared with the query view. That stuff is mostly going to be from this commit: d97e82d Here's the existing QueryView class I need to replace: datasette/datasette/views/database.py Lines 215 to 532 in 4c1e277
|
Two things to consider here: Most of the shapes make sense, with the exception of Looking at the (undocumented) list of extras from the table view, here are the ones I think make sense:
Just the YES ones:
The |
I'd really like to refactor all of the extras functions into a |
The default representation here can be even smaller. For rows it's this: {
"ok": true,
"next": "d,v",
"rows": [...]
} For SQL queries I'm considering this: {
"ok": true,
"rows": [...]
} I considered adding http://localhost:8001/content/releases.json?_size=0&_extra=query {
"ok": true,
"next": null,
"query": {
"sql": "select html_url, id, author, node_id, tag_name, target_commitish, name, draft, prerelease, created_at, published_at, body, repo, reactions, mentions_count from releases order by id limit 1",
"params": {}
},
"rows": []
} |
Related:
I've made the change to the table view, now I need the new format to work for arbitrary SQL queries too.
Note that this incorporates both arbitrary SQL queries and canned queries.
The text was updated successfully, but these errors were encountered: