{"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708113989", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708113989, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODExMzk4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T02:22:40Z", "updated_at": "2020-10-14T02:22:40Z", "author_association": "OWNER", "body": "I've found myself wanting this too.\r\n\r\nIt should respect the allow-sql permission so it doesn't display if the user isn't able to run custom SQL.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708114636", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708114636, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODExNDYzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T02:24:56Z", "updated_at": "2020-10-14T02:24:56Z", "author_association": "OWNER", "body": "So it would appear on this page: https://latest.datasette.io/fixtures/neighborhood_search#fragment-goes-here\r\n\r\nProbably as a blue \"Edit SQL\" link next to those buttons.\r\n\r\n![575FB160-4F75-43B2-B2AB-D75E60F10477](https://user-images.githubusercontent.com/9599/95936143-c2835680-0d89-11eb-9cf3-06f86d923103.jpeg)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708127294", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708127294, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODEyNzI5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T03:08:13Z", "updated_at": "2020-10-14T03:08:13Z", "author_association": "OWNER", "body": "Maybe like this:\r\n\r\n\"fixtures__select_neighborhood__facet_cities_name__state_from_facetable_join_facet_cities_on_facetable_city_id___facet_cities_id_where_neighborhood_like_________text________order_by_neighborhood_\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708128286", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708128286, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODEyODI4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T03:11:33Z", "updated_at": "2020-10-14T03:14:07Z", "author_association": "OWNER", "body": "Another edge-case: https://latest.datasette.io/fixtures/pragma_cache_size (`PRAGMA cache_size;`) isn't an allowed query usually, so linking to \"Edit SQL\" for it would link to an error page: https://latest.datasette.io/fixtures?sql=PRAGMA+cache_size%3B\r\n\r\nCan use `datasette.utils.validate_sql_select(sql)` to check for that - it raises `datasette.utils.InvalidSql` if there's a problem.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708130290", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708130290, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODEzMDI5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T03:17:57Z", "updated_at": "2020-10-14T03:17:57Z", "author_association": "OWNER", "body": "One last edge-case (I think) - magic parameters aren't supported for non-canned-queries, so if a query includes those it shouldn't show an Edit SQL link: https://latest.datasette.io/fixtures/magic_parameters\r\n\r\nI don't have a clean way of detecting if a query contains defined magic parameters, but I can instead do a dumb substring match for `:_` and skip showing the Edit SQL link if that is present.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708139822", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708139822, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODEzOTgyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T03:53:21Z", "updated_at": "2020-10-14T03:53:21Z", "author_association": "OWNER", "body": "Demos:\r\n- https://latest.datasette.io/fixtures/neighborhood_search has the link\r\n- https://latest.datasette.io/fixtures/neighborhood_search?text=ber has the link, and the link passes through the parameter that has already been entered\r\n- https://latest.datasette.io/fixtures/%F0%9D%90%9C%F0%9D%90%A2%F0%9D%90%AD%F0%9D%90%A2%F0%9D%90%9E%F0%9D%90%AC has the link\r\n- https://latest.datasette.io/fixtures/pragma_cache_size does not have the link (`PRAGMA` is not allowed in regular editable queries)\r\n- https://latest.datasette.io/fixtures/magic_parameters does not have the link (magic parameters)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1019#issuecomment-708520800", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1019", "id": 708520800, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODUyMDgwMA==", "user": {"value": 639012, "label": "jsfenfen"}, "created_at": "2020-10-14T16:37:19Z", "updated_at": "2020-10-14T16:37:19Z", "author_association": "CONTRIBUTOR", "body": "\ud83c\udf89 Thanks so much @simonw ! \ud83c\udf89 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721050815, "label": "\"Edit SQL\" button on canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-708669178", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 708669178, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY2OTE3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T21:26:37Z", "updated_at": "2020-10-14T21:26:37Z", "author_association": "OWNER", "body": "One option: add an optional request=... parameter which can be passed the current request, and will use that to populate the mock request with the exception of the bits that are passed explicitly (like the path):\r\n\r\n```python\r\nresponse = await datasette.client.get(\"/db/table.json\", request=request)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-708669778", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 708669778, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY2OTc3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T21:27:58Z", "updated_at": "2020-10-14T21:27:58Z", "author_association": "OWNER", "body": "Maybe these internal requests should have some kind of flag that lets the underlying code tell that it's being called internally.\r\n\r\nOne option: add a `x-internal: 1` request header - and ensure that any requests from outside Datasette have that header stripped.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-708670392", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 708670392, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY3MDM5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T21:29:22Z", "updated_at": "2020-10-14T21:29:22Z", "author_association": "OWNER", "body": "I should also verify (and probably unit-test) that things like the `?_trace=1` mechanism work across the internal request boundary.\r\n\r\n`/-/permissions` appears to work across this boundary, but again a test would be useful confirmation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/182#issuecomment-708693133", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/182", "id": 708693133, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY5MzEzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T22:26:26Z", "updated_at": "2020-10-14T22:26:26Z", "author_association": "OWNER", "body": "I could use https://github.com/chardet/chardet to help here, though I'd rather not add it as a dependency (`sqlite-utils` has very few dependencies at the moment). I could add it as an optional dependency though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 711649325, "label": "Better handling of encodings other than utf-8 for \"sqlite-utils insert\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1022#issuecomment-708693231", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1022", "id": 708693231, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY5MzIzMQ==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2020-10-14T22:26:41Z", "updated_at": "2020-10-14T22:26:41Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=h1) Report\n> Merging [#1022](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=desc) into [main](https://codecov.io/gh/simonw/datasette/commit/7f2edb5dd2074dce0090659021991695a984844b?el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1022/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #1022 +/- ##\n=======================================\n Coverage 84.60% 84.60% \n=======================================\n Files 28 28 \n Lines 3892 3892 \n=======================================\n Hits 3293 3293 \n Misses 599 599 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=footer). Last update [7f2edb5...7cef70a](https://codecov.io/gh/simonw/datasette/pull/1022?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721830990, "label": "Fix table name in spatialite example command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/163#issuecomment-708693290", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/163", "id": 708693290, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY5MzI5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T22:26:50Z", "updated_at": "2020-10-14T22:27:48Z", "author_association": "OWNER", "body": "This could even be exposed as a feature of the CLI tool - similar to how `sqlite-transform` works: https://github.com/simonw/sqlite-transform\r\n\r\n $ sqlite-transform lambda my.db mytable mycolumn --code='str(value).upper()'\r\n\r\nMaybe `sqlite-utils` should absorb all of the functionality from `sqlite-transform` - having two separate tools doesn't necessarily make sense.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 706001517, "label": "Idea: conversions= could take Python functions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/163#issuecomment-708695369", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/163", "id": 708695369, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY5NTM2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T22:32:39Z", "updated_at": "2020-10-14T22:32:39Z", "author_association": "OWNER", "body": "`sqlite-utils convert my.db mytable mycolumn` could become the new `sqlite-transform`. The sub-command could take `--code` but could also take `--parsedate` and `--parsedatetime` options.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 706001517, "label": "Idea: conversions= could take Python functions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/182#issuecomment-708695761", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/182", "id": 708695761, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODY5NTc2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T22:33:55Z", "updated_at": "2020-10-14T22:35:17Z", "author_association": "OWNER", "body": "For the moment I'm going to add a `--encoding` option and some code that catches `UnicodeDecodeError` and shows an error message that suggests using `--encoding`.\r\n\r\nThat error message could detect if the `file` command is available and, if it is, suggest running `file filename.txt` to detect the character encoding.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 711649325, "label": "Better handling of encodings other than utf-8 for \"sqlite-utils insert\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1022#issuecomment-708718475", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1022", "id": 708718475, "node_id": "MDEyOklzc3VlQ29tbWVudDcwODcxODQ3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-14T23:46:38Z", "updated_at": "2020-10-14T23:46:38Z", "author_association": "OWNER", "body": "Good catch, thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721830990, "label": "Fix table name in spatialite example command"}, "performed_via_github_app": null}