{"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-1692322342", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 1692322342, "node_id": "IC_kwDOBm6k_c5k3som", "user": {"value": 52261150, "label": "publicmatt"}, "created_at": "2023-08-24T19:56:15Z", "updated_at": "2023-08-24T20:09:52Z", "author_association": "NONE", "body": "Something to think about, but I hate how long the url is when sharing a custom SQL query. Would it be possible to hash the query and state of a page instead so the url is more manageable? The mapping from hash to query would have to be stored in order to recover/lookup the page after sharing.\r\n\r\nIt's not uncommon to have things like this currently:\r\n\r\n```https://global-power-plants.datasettes.com/global-power-plants?sql=select+rowid%2C+country%2C+country_long%2C+name%2C+gppd_idnr%2C+capacity_mw%2C+latitude%2C+longitude%2C+primary_fuel%2C+other_fuel1%2C+other_fuel2%2C+other_fuel3%2C+commissioning_year%2C+owner%2C+source%2C+url%2C+geolocation_source%2C+wepp_id%2C+year_of_capacity_data%2C+generation_gwh_2013%2C+generation_gwh_2014%2C+generation_gwh_2015%2C+generation_gwh_2016%2C+generation_gwh_2017%2C+generation_gwh_2018%2C+generation_gwh_2019%2C+generation_data_source%2C+estimated_generation_gwh_2013%2C+estimated_generation_gwh_2014%2C+estimated_generation_gwh_2015%2C+estimated_generation_gwh_2016%2C+estimated_generation_gwh_2017%2C+estimated_generation_note_2013%2C+estimated_generation_note_2014%2C+estimated_generation_note_2015%2C+estimated_generation_note_2016%2C+estimated_generation_note_2017+from+%5Bglobal-power-plants%5D+order+by+rowid+limit+101```\r\n\r\nI'm thinking a plugin like [https://datasette.io/plugins/datasette-query-files](https://datasette.io/plugins/datasette-query-files), but could be created and managed from the UI (with the right permissions).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-889539227", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 889539227, "node_id": "IC_kwDOBm6k_c41BUqb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-07-30T00:15:26Z", "updated_at": "2021-07-30T00:15:26Z", "author_association": "OWNER", "body": "One possible treatment:\r\n\r\n\"fixtures__sortable__201_rows\"\r\n\r\n```html\r\n\r\n

\r\n {% if query.sql and allow_execute_sql %}\r\n \r\n View and edit SQL\r\n \r\n {% endif %}\r\n Copy and share link\r\n

\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-784567547", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 784567547, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NDU2NzU0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-23T22:45:56Z", "updated_at": "2021-02-23T22:46:12Z", "author_association": "OWNER", "body": "I really like the way the Share feature on Stack Overflow works: https://stackoverflow.com/questions/18934149/how-can-i-use-postgresqls-text-column-type-in-django\r\n", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-784347646", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 784347646, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NDM0NzY0Ng==", "user": {"value": 7107523, "label": "Kabouik"}, "created_at": "2021-02-23T16:55:26Z", "updated_at": "2021-02-23T16:57:39Z", "author_association": "NONE", "body": "> I think it's possible that many users these days no longer assume they can paste a URL from the browser address bar (if they ever understood that at all) because to many apps are SPAs with broken URLs.\r\n\r\nAbsolutely, that's why I thought my corner case with `iframe` preventing access to the datasette URL could actually be relevant in more general situations.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-784334931", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 784334931, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NDMzNDkzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-23T16:37:26Z", "updated_at": "2021-02-23T16:37:26Z", "author_association": "OWNER", "body": "A \"Share link\" button would only be needed on the table page and the arbitrary query page I think - and maybe on the row page, especially as that page starts to grow more features in the future.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1241#issuecomment-784333768", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1241", "id": 784333768, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NDMzMzc2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-23T16:35:51Z", "updated_at": "2021-02-23T16:35:51Z", "author_association": "OWNER", "body": "This can definitely be done with a plugin.\r\n\r\nAdding to Datasette itself is an interesting idea. I think it's possible that many users these days no longer assume they can paste a URL from the browser address bar (if they ever understood that at all) because to many apps are SPAs with broken URLs.\r\n\r\nThe shareable URLs are actually a key feature of Datasette - so maybe they should be highlighted in the default UI?\r\n\r\nI built a \"copy to clipboard\" feature for `datasette-copyable` and wrote up how that works here: https://til.simonwillison.net/javascript/copy-button", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814595021, "label": "Share button for copying current URL"}, "performed_via_github_app": null}