{"html_url": "https://github.com/simonw/datasette/issues/415#issuecomment-473217334", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/415", "id": 473217334, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzIxNzMzNA==", "user": {"value": 36796532, "label": "ad-si"}, "created_at": "2019-03-15T09:30:57Z", "updated_at": "2019-03-15T09:30:57Z", "author_association": "NONE", "body": "Awesome, thanks! \ud83d\ude01 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 418329842, "label": "Add query parameter to hide SQL textarea"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/415#issuecomment-473164038", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/415", "id": 473164038, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE2NDAzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T05:31:21Z", "updated_at": "2019-03-15T05:31:21Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures-dd88475?sql=select+%2A+from+sortable+order+by+pk1%2C+pk2+limit+101\r\n\r\n\"Screen\r\n\r\nv.s. https://latest.datasette.io/fixtures-dd88475?sql=select+%2A+from+sortable+order+by+pk1%2C+pk2+limit+101&_hide_sql=1\r\n\r\n\"Screen\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 418329842, "label": "Add query parameter to hide SQL textarea"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/415#issuecomment-473157770", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/415", "id": 473157770, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE1Nzc3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T04:49:03Z", "updated_at": "2019-03-15T04:49:03Z", "author_association": "OWNER", "body": "Interesting idea. I can see how this would make sense if you are dealing with really long SQL queries.\r\n\r\nMy own example of a long query that might benefit from this: https://russian-ads-demo.herokuapp.com/russian-ads-a42c4e8?sql=select%0D%0A++++target_id%2C%0D%0A++++targets.name%2C%0D%0A++++count(*)+as+n%2C%0D%0A++++json_object(%0D%0A++++++++%22href%22%2C+%22%2Frussian-ads%2Ffaceted-targets%3Ftargets%3D%22+||+%0D%0A++++++++++++json_insert(%3Atargets%2C+%27%24[%27+||+json_array_length(%3Atargets)+||+%27]%27%2C+target_id)%0D%0A++++++++%2C%0D%0A++++++++%22label%22%2C+json_insert(%3Atargets%2C+%27%24[%27+||+json_array_length(%3Atargets)+||+%27]%27%2C+target_id)%0D%0A++++)+as+apply_this_facet%2C%0D%0A++++json_object(%0D%0A++++++++%22href%22%2C+%22%2Frussian-ads%2Fdisplay_ads%3F_targets_json%3D%22+||+%0D%0A++++++++++++json_insert(%3Atargets%2C+%27%24[%27+||+json_array_length(%3Atargets)+||+%27]%27%2C+target_id)%0D%0A++++++++%2C%0D%0A++++++++%22label%22%2C+%22See+%22+||+count(*)+||+%22+ads+matching+%22+||+json_insert(%3Atargets%2C+%27%24[%27+||+json_array_length(%3Atargets)+||+%27]%27%2C+target_id)%0D%0A++++)+as+browse_these_ads%0D%0Afrom+ad_targets%0D%0Ajoin+targets+on+ad_targets.target_id+%3D+targets.id%0D%0Awhere%0D%0A++++json_array_length(%3Atargets)+%3D%3D+0+or%0D%0A++++ad_id+in+(%0D%0A++++++++select+ad_id%0D%0A++++++++from+%22ad_targets%22%0D%0A++++++++where+%22ad_targets%22.target_id+in+(select+value+from+json_each(%3Atargets))%0D%0A++++++++group+by+%22ad_targets%22.ad_id%0D%0A++++++++having+count(distinct+%22ad_targets%22.target_id)+%3D+json_array_length(%3Atargets)%0D%0A++++)%0D%0A++++and+target_id+not+in+(select+value+from+json_each(%3Atargets))%0D%0Agroup+by%0D%0A++++target_id+order+by+n+desc%0D%0A&targets=[%22e6200%22]\r\n\r\nHaving a `show/hide` link would be an easy way to support this in the UI, and those could add/remove a `_hide_sql=1` parameter.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 418329842, "label": "Add query parameter to hide SQL textarea"}, "performed_via_github_app": null}