-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
?_where=sql-fragment parameter for table views #429
Comments
I originally thought of this as a plugin but then realized that it's 100% compatible with Datasette's existing arbitrary SQL clauses and would make some of my other projects (especially involving custom queries that still need faceting) a whole lot easier. |
Getting a prototype working was hardly any code at all:
Still needed:
I'm going to leave the |
Keeping track of these and building the "remove" links correctly is going to be a tiny bit fiddly. |
Maybe put this section above the "view and edit SQL" link. |
Documentation is here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments Demo: |
Only available if arbitrary SQL is enabled (the default).
?_where=id in (1,2,3)&_where=id in (select tag_id from tags)
Allows any table (or view) page to have arbitrary additional
extra_where
clauses defined using the URL!This would be extremely useful for building JavaScript applications against the Datasette API that only need on extra tiny bit of SQL but still want to benefit from other table view features like faceting.
Would be nice if this could take
:named
parameters and have them filled in via querystring as well.The text was updated successfully, but these errors were encountered: