{"html_url": "https://github.com/simonw/sqlite-utils/issues/264#issuecomment-853567861", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/264", "id": 853567861, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MzU2Nzg2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-03T05:12:21Z", "updated_at": "2021-06-03T05:12:21Z", "author_association": "OWNER", "body": "I think this is more likely to happen in Datasette than in sqlite-utils - see https://github.com/simonw/datasette/issues/1356 for thoughts on this.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 907642546, "label": "Supporting additional output formats, like GeoJSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/264#issuecomment-853558741", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/264", "id": 853558741, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MzU1ODc0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-03T04:47:19Z", "updated_at": "2021-06-03T04:47:19Z", "author_association": "OWNER", "body": "This inspired me to re-examine how `--get` works, hence this issue: https://github.com/simonw/datasette/issues/1355", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 907642546, "label": "Supporting additional output formats, like GeoJSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/264#issuecomment-853553754", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/264", "id": 853553754, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MzU1Mzc1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-03T04:32:42Z", "updated_at": "2021-06-03T04:36:36Z", "author_association": "OWNER", "body": "This is a really interesting thought. I've so far resisted the temptation to add plugins to `sqlite-utils`, partly to avoid overlap with Datasette - but I'm open to discussing it.\r\n\r\nThere's actually a way for you to do what you're describing using `datasette` on the command-line, though it's a little obscure - also Datasette doesn't yet have a GeoJSON output extension, though it really should have one.\r\n\r\nHere's an example using [datasette-yaml](https://datasette.io/plugins/datasette-yaml):\r\n\r\n```\r\ndatasette /tmp/covid.db --get='/covid/ny_times_us_counties.yaml'\r\n- rowid: 1\r\n date: '2020-01-21'\r\n county: Snohomish\r\n state: Washington\r\n fips: 53061\r\n cases: 1\r\n deaths: 0\r\n- rowid: 2\r\n date: '2020-01-22'\r\n county: Snohomish\r\n state: Washington\r\n fips: 53061\r\n cases: 1\r\n deaths: 0\r\n```\r\nIt even works with arbitrary SQL queries, though you might have to apply URL encoding to the `--get` string (this seems to work though):\r\n```\r\ndatasette /tmp/covid.db --get='/covid.yaml?sql=select * from ny_times_us_counties limit 2' \r\n- date: '2020-01-21'\r\n county: Snohomish\r\n state: Washington\r\n fips: 53061\r\n cases: 1\r\n deaths: 0\r\n- date: '2020-01-22'\r\n county: Snohomish\r\n state: Washington\r\n fips: 53061\r\n cases: 1\r\n deaths: 0\r\n```\r\nHere's the documentation for `--get`: https://docs.datasette.io/en/latest/getting_started.html#datasette-get", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 907642546, "label": "Supporting additional output formats, like GeoJSON"}, "performed_via_github_app": null}