{"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790369076", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790369076, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM2OTA3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T06:54:46Z", "updated_at": "2021-03-04T06:54:46Z", "author_association": "MEMBER", "body": "The Rich-powered progress bar is pretty:\r\n\r\n![rich](https://user-images.githubusercontent.com/9599/109923307-71f69200-7c73-11eb-9ee2-8f0a240f3994.gif)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790312268", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790312268, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDMxMjI2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T05:48:16Z", "updated_at": "2021-03-04T05:48:16Z", "author_association": "MEMBER", "body": "Wow, my mbox is a 10.35 GB download!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1243#issuecomment-790311215", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1243", "id": 790311215, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDMxMTIxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T05:45:57Z", "updated_at": "2021-03-04T05:45:57Z", "author_association": "OWNER", "body": "Thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 815955014, "label": "fix small typo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1247#issuecomment-787616446", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1247", "id": 787616446, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzYxNjQ0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-01T03:50:37Z", "updated_at": "2021-03-01T03:50:37Z", "author_association": "OWNER", "body": "I like the `.add_memory_database()` option. I also like that it makes it more obvious that this is a capability of Datasette, since I'm excited to see more plugins, features and tests that take advantage of it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 818430405, "label": "datasette.add_memory_database() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1247#issuecomment-787616158", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1247", "id": 787616158, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzYxNjE1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-01T03:49:27Z", "updated_at": "2021-03-01T03:49:27Z", "author_association": "OWNER", "body": "A couple of options:\r\n```python\r\ndatasette.add_memory_database(\"test_json_array\")\r\n# or make that first argument to add_database() optional and support:\r\ndatasette.add_database(memory_name=\"test_json_array\")\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 818430405, "label": "datasette.add_memory_database() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1246#issuecomment-787611153", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1246", "id": 787611153, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzYxMTE1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-01T03:30:57Z", "updated_at": "2021-03-01T03:30:57Z", "author_association": "OWNER", "body": "I'm going to try a new pattern for testing this, enabled by #1151 - the test will create a new named in-memory database, write some records to it and then run some test facets against that. This will save me from having to add yet another fixtures table for this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817597268, "label": "Suggest for ArrayFacet possibly confused by blank values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1005#issuecomment-787536267", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1005", "id": 787536267, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzUzNjI2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-28T22:30:37Z", "updated_at": "2021-02-28T22:30:37Z", "author_association": "OWNER", "body": "It's out! https://github.com/encode/httpx/releases/tag/0.17.0", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718259202, "label": "Remove xfail tests when new httpx is released"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787532279", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787532279, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzUzMjI3OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-28T22:09:37Z", "updated_at": "2021-02-28T22:09:37Z", "author_association": "OWNER", "body": "Microsoft's playwright Python library solves this problem by code generating both their sync AND their async libraries https://github.com/microsoft/playwright-python/tree/master/scripts", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787198202", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787198202, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE5ODIwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T22:33:58Z", "updated_at": "2021-02-27T22:33:58Z", "author_association": "OWNER", "body": "Hah or use this trick, which genuinely rewrites the code at runtime using a class decorator! https://github.com/python-happybase/aiohappybase/blob/0990ef45cfdb720dc987afdb4957a0fac591cb99/aiohappybase/sync/_util.py#L19-L32", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787195536", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787195536, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE5NTUzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T22:13:24Z", "updated_at": "2021-02-27T22:13:24Z", "author_association": "OWNER", "body": "Some other interesting background reading: https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html - in particular see how SQLALchemy has a `await conn.run_sync(meta.drop_all)` mechanism for running methods that haven't themselves been provided in an async version", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787190562", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787190562, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE5MDU2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T22:04:00Z", "updated_at": "2021-02-27T22:04:00Z", "author_association": "OWNER", "body": "From the poster here: https://github.com/sethmlarson/pycon-async-sync-poster/blob/master/poster.pdf\r\n\r\n\"pycon-async-sync-poster_poster_pdf_at_master_\u00b7_sethmlarson_pycon-async-sync-poster\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787186826", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787186826, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE4NjgyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T22:01:54Z", "updated_at": "2021-02-27T22:01:54Z", "author_association": "OWNER", "body": "`unasync` is an implementation of the exact pattern I was talking about above - it uses the `tokenize` module from the Python standard library to apply some clever rules to transform an async codebase into a sync one. https://unasync.readthedocs.io/en/latest/ - implementation here: https://github.com/python-trio/unasync/blob/v0.5.0/src/unasync/__init__.py", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787175126", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787175126, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE3NTEyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T21:55:05Z", "updated_at": "2021-02-27T21:55:05Z", "author_association": "OWNER", "body": "\"how to use some new tools to more easily maintain a codebase that supports both async and synchronous I/O and multiple async libraries\" - yeah that's exactly what I need, thank you!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787144523", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787144523, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE0NDUyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T21:18:46Z", "updated_at": "2021-02-27T21:18:46Z", "author_association": "OWNER", "body": "Here's a really wild idea: I wonder if it would be possible to run a source transformation against either the sync or the async versions of the code to produce the equivalent for the other paradigm?\r\n\r\nCould that even be as simple as a set of regular expressions against the `await ...` version that strips out or replaces the `await` and `async def` and `async for` statements?\r\n\r\nIf so... I could maintain just the async version, generate the sync version with a script and rely on robust unit testing to guarantee that this actually works.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787142066", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787142066, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE0MjA2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T21:17:10Z", "updated_at": "2021-02-27T21:17:10Z", "author_association": "OWNER", "body": "I have a hunch this is actually going to be quite difficult, due to the internal complexity of some of the `sqlite-utils` API methods.\r\n\r\nConsider `db[table].extract(...)` for example. It does a whole bunch of extra queries inside the method - each of those would need to be turned into an `await` call for the async version. Here's the method body today:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/09c3386f55f766b135b6a1c00295646c4ae29bec/sqlite_utils/db.py#L1060-L1152\r\n\r\nWriting this method twice - looking similar but with `await ...` tucked in before every internal method it calls that needs to execute SQL - is going to be pretty messy.\r\n\r\nOne thing that would help a LOT is figuring out how to share the majority of the test code. If the exact same tests could run against both the sync and async versions with a bit of test trickery, maintaining parallel implementations would at least be a bit more feasible.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787120136", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787120136, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzEyMDEzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T19:04:47Z", "updated_at": "2021-02-27T19:04:47Z", "author_association": "OWNER", "body": "Another option here would be to add https://github.com/omnilib/aiosqlite/blob/main/aiosqlite/core.py as a dependency - it's four years old now and actively marinated, and the code is pretty small so it looks like a solid, stable, reliable dependency.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787118691", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787118691, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzExODY5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-27T18:53:23Z", "updated_at": "2021-02-27T18:53:23Z", "author_association": "OWNER", "body": "Datasette has its own implementation of a write queue for exactly this purpose - and there's no reason at all that should stay in Datasette rather than being extracted out and moved over here to `sqlite-utils`.\r\n\r\nOne small concern I have is around the API design. I'd want to keep supporting the existing synchronous API while also providing a similar API with await-based methods.\r\n\r\nWhat are some good examples of libraries that do this? I like how https://www.python-httpx.org/ handles it, maybe that's a good example to imitate?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-786925280", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 786925280, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjkyNTI4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T22:23:10Z", "updated_at": "2021-02-26T22:23:10Z", "author_association": "MEMBER", "body": "Thanks!\r\n\r\nI requested my Gmail export from takeout - once that arrives I'll test it against this and then merge the PR.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1238#issuecomment-786849095", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1238", "id": 786849095, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njg0OTA5NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T19:29:38Z", "updated_at": "2021-02-26T19:29:38Z", "author_association": "OWNER", "body": "Here's the test I wrote:\r\n```diff\r\ngit diff tests/test_custom_pages.py\r\ndiff --git a/tests/test_custom_pages.py b/tests/test_custom_pages.py\r\nindex 6a23192..5a71f56 100644\r\n--- a/tests/test_custom_pages.py\r\n+++ b/tests/test_custom_pages.py\r\n@@ -2,11 +2,19 @@ import pathlib\r\n import pytest\r\n from .fixtures import make_app_client\r\n \r\n+TEST_TEMPLATE_DIRS = str(pathlib.Path(__file__).parent / \"test_templates\")\r\n+\r\n \r\n @pytest.fixture(scope=\"session\")\r\n def custom_pages_client():\r\n+ with make_app_client(template_dir=TEST_TEMPLATE_DIRS) as client:\r\n+ yield client\r\n+\r\n+\r\n+@pytest.fixture(scope=\"session\")\r\n+def custom_pages_client_with_base_url():\r\n with make_app_client(\r\n- template_dir=str(pathlib.Path(__file__).parent / \"test_templates\")\r\n+ template_dir=TEST_TEMPLATE_DIRS, config={\"base_url\": \"/prefix/\"}\r\n ) as client:\r\n yield client\r\n \r\n@@ -23,6 +31,12 @@ def test_request_is_available(custom_pages_client):\r\n assert \"path:/request\" == response.text\r\n \r\n \r\n+def test_custom_pages_with_base_url(custom_pages_client_with_base_url):\r\n+ response = custom_pages_client_with_base_url.get(\"/prefix/request\")\r\n+ assert 200 == response.status\r\n+ assert \"path:/prefix/request\" == response.text\r\n+\r\n+\r\n def test_custom_pages_nested(custom_pages_client):\r\n response = custom_pages_client.get(\"/nested/nest\")\r\n assert 200 == response.status\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813899472, "label": "Custom pages don't work with base_url setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1238#issuecomment-786848654", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1238", "id": 786848654, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njg0ODY1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T19:28:48Z", "updated_at": "2021-02-26T19:28:48Z", "author_association": "OWNER", "body": "I added a debug line just before `for regex, wildcard_template` here:\r\n\r\nhttps://github.com/simonw/datasette/blob/afed51b1e36cf275c39e71c7cb262d6c5bdbaa31/datasette/app.py#L1148-L1155\r\n\r\nAnd it showed that for some reason `request.path` is `/prefix/prefix/request` here - the prefix got doubled somehow.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813899472, "label": "Custom pages don't work with base_url setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1238#issuecomment-786841261", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1238", "id": 786841261, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njg0MTI2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T19:13:44Z", "updated_at": "2021-02-26T19:13:44Z", "author_association": "OWNER", "body": "Sounds like a bug - thanks for reporting this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813899472, "label": "Custom pages don't work with base_url setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1246#issuecomment-786840734", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1246", "id": 786840734, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njg0MDczNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T19:12:39Z", "updated_at": "2021-02-26T19:12:47Z", "author_association": "OWNER", "body": "Could I take this part:\r\n```python\r\n suggested_facet_sql = \"\"\" \r\n select distinct json_type({column}) \r\n from ({sql}) \r\n \"\"\".format( \r\n column=escape_sqlite(column), sql=self.sql \r\n ) \r\n```\r\nAnd add `where {column} is not null and {column} != ''` perhaps?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817597268, "label": "Suggest for ArrayFacet possibly confused by blank values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1246#issuecomment-786840425", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1246", "id": 786840425, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njg0MDQyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T19:11:56Z", "updated_at": "2021-02-26T19:11:56Z", "author_association": "OWNER", "body": "Relevant code: https://github.com/simonw/datasette/blob/afed51b1e36cf275c39e71c7cb262d6c5bdbaa31/datasette/facets.py#L271-L295", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817597268, "label": "Suggest for ArrayFacet possibly confused by blank values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-786830832", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 786830832, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjgzMDgzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T18:52:40Z", "updated_at": "2021-02-26T18:52:40Z", "author_association": "OWNER", "body": "Could this handle lists of objects too? That would be pretty amazing - if the column has a `[{...}, {...}]` list in it could turn that into a many-to-many.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1240#issuecomment-786813506", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1240", "id": 786813506, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjgxMzUwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T18:19:46Z", "updated_at": "2021-02-26T18:19:46Z", "author_association": "OWNER", "body": "Linking to rows from custom queries is a lot harder - because given an arbitrary string of SQL it's difficult to analyze it and figure out which (if any) of the returned columns represent a primary key.\r\n\r\nIt's possible to manually write a SQL query that returns a column that will be treated as a link to another page using this plugin, but it's not particularly straight-forward: https://datasette.io/plugins/datasette-json-html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814591962, "label": "Allow facetting on custom queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1240#issuecomment-786812716", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1240", "id": 786812716, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjgxMjcxNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T18:18:18Z", "updated_at": "2021-02-26T18:18:18Z", "author_association": "OWNER", "body": "Agreed, this would be extremely useful. I'd love to be able to facet against custom queries. It's a fair bit of work to implement but it's not impossible. Closing this as a duplicate of #972.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 814591962, "label": "Allow facetting on custom queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-786795132", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 786795132, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njc5NTEzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T17:45:53Z", "updated_at": "2021-02-26T17:45:53Z", "author_association": "OWNER", "body": "If there's no primary key in the JSON could use the `hash_id` mechanism.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-786794435", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 786794435, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njc5NDQzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T17:44:38Z", "updated_at": "2021-02-26T17:44:38Z", "author_association": "OWNER", "body": "This came up in office hours!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1244#issuecomment-786786645", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1244", "id": 786786645, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Njc4NjY0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T17:30:38Z", "updated_at": "2021-02-26T17:30:38Z", "author_association": "OWNER", "body": "New paragraph at the top of https://docs.datasette.io/en/latest/writing_plugins.html\r\n\r\n> Want to start by looking at an example? The [Datasette plugins directory](https://datasette.io/plugins) lists more than 50 open source plugins with code you can explore. The [plugin hooks](https://docs.datasette.io/en/latest/plugin_hooks.html#plugin-hooks) page includes links to example plugins for each of the documented hooks.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817528452, "label": "Plugin tip: look at the examples linked from the hooks page"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/237#issuecomment-786050562", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/237", "id": 786050562, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjA1MDU2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:57:56Z", "updated_at": "2021-02-25T16:57:56Z", "author_association": "OWNER", "body": "`sqlite-utils create-view` currently has a `--ignore` option, so adding that to `sqlite-utils drop-view` and `sqlite-utils drop-table` makes sense as well.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 815554385, "label": "db[\"my_table\"].drop(ignore=True) parameter, plus sqlite-utils drop-table --ignore and drop-view --ignore"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/237#issuecomment-786049686", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/237", "id": 786049686, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjA0OTY4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:56:42Z", "updated_at": "2021-02-25T16:56:42Z", "author_association": "OWNER", "body": "So:\r\n```python\r\n db[\"my_table\"].drop(ignore=True)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 815554385, "label": "db[\"my_table\"].drop(ignore=True) parameter, plus sqlite-utils drop-table --ignore and drop-view --ignore"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/237#issuecomment-786049394", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/237", "id": 786049394, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjA0OTM5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:56:14Z", "updated_at": "2021-02-25T16:56:14Z", "author_association": "OWNER", "body": "Other methods (`db.create_view()` for example) have `ignore=True` to mean \"don't throw an error if this causes a problem\", so I'm good with adding that to `.drop_view()`.\r\n\r\nI don't like using it as the default partly because that would be a very minor breaking API change, but mainly because I don't want to hide mistakes people make - e.g. if you mistype the name of the table you are trying to drop.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 815554385, "label": "db[\"my_table\"].drop(ignore=True) parameter, plus sqlite-utils drop-table --ignore and drop-view --ignore"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786037219", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786037219, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAzNzIxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:39:23Z", "updated_at": "2021-02-25T16:39:23Z", "author_association": "OWNER", "body": "Example from the docs:\r\n```pycon\r\n>>> db = sqlite_utils.Database(memory=True)\r\n>>> db[\"dogs\"].insert({\"name\": \"Cleo\"})\r\n>>> for pk, row in db[\"dogs\"].pks_and_rows_where():\r\n... print(pk, row)\r\n1 {'rowid': 1, 'name': 'Cleo'}\r\n\r\n>>> db[\"dogs_with_pk\"].insert({\"id\": 5, \"name\": \"Cleo\"}, pk=\"id\")\r\n>>> for pk, row in db[\"dogs_with_pk\"].pks_and_rows_where():\r\n... print(pk, row)\r\n5 {'id': 5, 'name': 'Cleo'}\r\n\r\n>>> db[\"dogs_with_compound_pk\"].insert(\r\n... {\"species\": \"dog\", \"id\": 3, \"name\": \"Cleo\"},\r\n... pk=(\"species\", \"id\")\r\n... )\r\n>>> for pk, row in db[\"dogs_with_compound_pk\"].pks_and_rows_where():\r\n... print(pk, row)\r\n('dog', 3) {'species': 'dog', 'id': 3, 'name': 'Cleo'}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786036355", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786036355, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAzNjM1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:38:07Z", "updated_at": "2021-02-25T16:38:07Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/python-api.html#listing-rows-with-their-primary-keys", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-786035142", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 786035142, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAzNTE0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:36:17Z", "updated_at": "2021-02-25T16:36:17Z", "author_association": "OWNER", "body": "WIP in a pull request.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786016380", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786016380, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAxNjM4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T16:10:01Z", "updated_at": "2021-02-25T16:10:01Z", "author_association": "OWNER", "body": "I prototyped this and I like it:\r\n```\r\nIn [1]: import sqlite_utils\r\nIn [2]: db = sqlite_utils.Database(\"/Users/simon/Dropbox/Development/datasette/fixtures.db\")\r\nIn [3]: list(db[\"compound_primary_key\"].pks_and_rows_where())\r\nOut[3]: [(('a', 'b'), {'pk1': 'a', 'pk2': 'b', 'content': 'c'})]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786007209", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786007209, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAwNzIwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:57:50Z", "updated_at": "2021-02-25T15:57:50Z", "author_association": "OWNER", "body": "`table.pks_and_rows_where(...)` is explicit and I think less ambiguous than the other options.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786006794", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786006794, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAwNjc5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:57:17Z", "updated_at": "2021-02-25T15:57:28Z", "author_association": "OWNER", "body": "I quite like `pks_with_rows_where(...)` - but grammatically it suggests it will return the primary keys that exist where their rows match the criteria - \"pks with rows\" can be interpreted as \"pks for the rows that...\" as opposed to \"pks accompanied by rows\"", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786005078", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786005078, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAwNTA3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:54:59Z", "updated_at": "2021-02-25T15:56:16Z", "author_association": "OWNER", "body": "Is `pk_rows_where()` a good name? It sounds like it returns \"primary key rows\" which isn't a thing. It actually returns rows along with their primary key.\r\n\r\nOther options:\r\n\r\n- `table.rows_with_pk_where(...)` - should this return `(row, pk)` rather than `(pk, row)`?\r\n- `table.rows_where_pk(...)`\r\n- `table.pk_and_rows_where(...)`\r\n- `table.pk_with_rows_where(...)`\r\n- `table.pks_with_rows_where(...)` - because rows is pluralized, so pks should be pluralized too?\r\n- `table.pks_rows_where(...)`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/240#issuecomment-786001768", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/240", "id": 786001768, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjAwMTc2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:50:28Z", "updated_at": "2021-02-25T15:52:12Z", "author_association": "OWNER", "body": "One option: `.rows_where()` could grow a `ensure_pk=True` option which checks to see if the table is a `rowid` table and, if it is, includes that in the `select`.\r\n\r\nOr... how about you can call `.rows_where(..., pks=True)` and it will yield `(pk, rowdict)` tuple pairs instead of just returning the sequence of dictionaries?\r\n\r\nI'm always a little bit nervous of methods that vary their return type based on their arguments. Maybe this would be a separate method instead?\r\n```python\r\n for pk, row in table.pk_rows_where(...):\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": 816560819, "label": "table.pks_and_rows_where() method returning primary keys along with the rows"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785992158", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785992158, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk5MjE1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:37:04Z", "updated_at": "2021-02-25T15:37:04Z", "author_association": "OWNER", "body": "Here's the current implementation of `.extract()`: https://github.com/simonw/sqlite-utils/blob/806c21044ac8d31da35f4c90600e98115aade7c6/sqlite_utils/db.py#L1049-L1074\r\n\r\nTricky detail here: I create the lookup table first, based on the types of the columns that are being extracted.\r\n\r\nI need to do this because extraction currently uses unique tuples of values, so the table has to be created in advance.\r\n\r\nBut if I'm using these new expand functions to figure out what's going to be extracted, I don't know the names of the columns and their types in advance. I'm only going to find those out during the transformation.\r\n\r\nThis may turn out to be incompatible with how `.extract()` works at the moment. I may need a new method, `.extract_expand()` perhaps? It could be simpler - work only against a single column for example.\r\n\r\nI can still use the existing `sqlite-utils extract` CLI command though, with a `--json` flag and a rule that you can't run it against multiple columns.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785983837", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785983837, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk4MzgzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:25:21Z", "updated_at": "2021-02-25T15:28:57Z", "author_association": "OWNER", "body": "Problem with calling this argument `transform=` is that the term \"transform\" already means something else in this library.\r\n\r\nI could use `convert=` instead.\r\n\r\n... but that doesn't instantly make me think of turning a value into multiple columns.\r\n\r\nHow about `expand=`? I've not used that term anywhere yet.\r\n\r\n db[\"Reports\"].extract([\"Reported by\"], expand={\"Reported by\": json.loads})\r\n\r\nI think that works. You're expanding a single value into several columns of information.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785983070", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785983070, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk4MzA3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:24:17Z", "updated_at": "2021-02-25T15:24:17Z", "author_association": "OWNER", "body": "I'm going to go with last-wins - so if multiple transform functions return the same key the last one will over-write the others.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785980813", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785980813, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk4MDgxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:21:02Z", "updated_at": "2021-02-25T15:23:47Z", "author_association": "OWNER", "body": "Maybe the Python version takes an optional dictionary mapping column names to transformation functions? It could then merge all of those results together - and maybe throw an error if the same key is produced by more than one column.\r\n\r\n```python\r\n db[\"Reports\"].extract([\"Reported by\"], transform={\"Reported by\": json.loads})\r\n```\r\nOr it could have an option for different strategies if keys collide: first wins, last wins, throw exception, add a prefix to the new column name. That feels a bit too complex for an edge-case though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785980083", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785980083, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk4MDA4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:20:02Z", "updated_at": "2021-02-25T15:20:02Z", "author_association": "OWNER", "body": "It would be OK if the CLI version only allows you to specify a single column if you are using the `--json` option.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785979769", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785979769, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk3OTc2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:19:37Z", "updated_at": "2021-02-25T15:19:37Z", "author_association": "OWNER", "body": "For the Python version I'd like to be able to provide a transformation callback function - which can be `json.loads` but could also be anything else which accepts the value of the current column and returns a Python dictionary of columns and their values to use in the new table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785979192", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785979192, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk3OTE5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:18:46Z", "updated_at": "2021-02-25T15:18:46Z", "author_association": "OWNER", "body": "Likewise the `sqlite-utils extract` command takes one or more columns:\r\n```\r\nUsage: sqlite-utils extract [OPTIONS] PATH TABLE COLUMNS...\r\n\r\n Extract one or more columns into a separate table\r\n\r\nOptions:\r\n --table TEXT Name of the other table to extract columns to\r\n --fk-column TEXT Name of the foreign key column to add to the table\r\n --rename ... Rename this column in extracted table\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/239#issuecomment-785978689", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239", "id": 785978689, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk3ODY4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:18:03Z", "updated_at": "2021-02-25T15:18:03Z", "author_association": "OWNER", "body": "The Python `.extract()` method currently starts like this:\r\n```python\r\ndef extract(self, columns, table=None, fk_column=None, rename=None):\r\n rename = rename or {}\r\n if isinstance(columns, str):\r\n columns = [columns]\r\n if not set(columns).issubset(self.columns_dict.keys()):\r\n raise InvalidColumns(\r\n \"Invalid columns {} for table with columns {}\".format(\r\n columns, list(self.columns_dict.keys())\r\n )\r\n )\r\n ...\r\n```\r\nNote that it takes a list of columns (and treats a string as a single item list). That's because it can be called with a list of columns and it will use them to populate another table of unique tuples of those column values.\r\n\r\nSo a new mechanism that can instead read JSON values from a single column needs to be compatible with that existing design.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816526538, "label": "sqlite-utils extract could handle nested objects"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/238#issuecomment-785972074", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/238", "id": 785972074, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NTk3MjA3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-25T15:08:36Z", "updated_at": "2021-02-25T15:08:36Z", "author_association": "OWNER", "body": "I bet the bug is in here: https://github.com/simonw/sqlite-utils/blob/806c21044ac8d31da35f4c90600e98115aade7c6/sqlite_utils/db.py#L593-L602", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 816523763, "label": ".add_foreign_key() corrupts database if column contains a space"}, "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-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} {"html_url": "https://github.com/simonw/datasette/issues/1239#issuecomment-783774084", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1239", "id": 783774084, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mzc3NDA4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-23T00:18:56Z", "updated_at": "2021-02-23T00:19:18Z", "author_association": "OWNER", "body": "Bug is here: https://github.com/simonw/datasette/blob/42caabf7e9e6e4d69ef6dd7de16f2cd96bc79d5b/datasette/filters.py#L149-L165\r\n\r\nThose `json_each` lines should be:\r\n\r\n select {t}.rowid from {t}, json_each([{t}].[{c}]) j", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813978858, "label": "JSON filter fails if column contains spaces"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1237#issuecomment-783676548", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1237", "id": 783676548, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MzY3NjU0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-22T21:10:19Z", "updated_at": "2021-02-22T21:10:25Z", "author_association": "OWNER", "body": "This is another change which is a little bit hard to figure out because I haven't solved #878 yet.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812704869, "label": "?_pretty=1 option for pretty-printing JSON output"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1234#issuecomment-783674659", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1234", "id": 783674659, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MzY3NDY1OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-22T21:06:28Z", "updated_at": "2021-02-22T21:06:28Z", "author_association": "OWNER", "body": "I'm not going to work on this for a while, but if anyone has needs or ideas around that they can add them to this issue.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811505638, "label": "Runtime support for ATTACHing multiple databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-783674038", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 783674038, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MzY3NDAzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-22T21:05:21Z", "updated_at": "2021-02-22T21:05:21Z", "author_association": "OWNER", "body": "It's good on mobile - iOS at least. Going to close this open new issues if anyone reports bugs.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 1, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782789598", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782789598, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc4OTU5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-21T03:30:02Z", "updated_at": "2021-02-21T03:30:02Z", "author_association": "OWNER", "body": "Another benefit to default:object - I could include a key that shows a list of available extras. I could then use that to power an interactive API explorer.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782765665", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782765665, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc2NTY2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T23:34:41Z", "updated_at": "2021-02-20T23:34:41Z", "author_association": "OWNER", "body": "OK, I'm back to the \"top level object as the default\" side of things now - it's pretty much unanimous at this point, and it's certainly true that it's not a decision you'll even regret.", "reactions": "{\"total_count\": 2, \"+1\": 2, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782748501", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782748501, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0ODUwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:58:18Z", "updated_at": "2021-02-20T20:58:18Z", "author_association": "OWNER", "body": "Yet another option: support a `?_path=x` option which returns a nested path from the result. So you could do this:\r\n\r\n`/github/commits.json?_path=rows` - to get back a top-level array pulled from the `\"rows\"` key.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782748093", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782748093, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0ODA5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:54:52Z", "updated_at": "2021-02-20T20:54:52Z", "author_association": "OWNER", "body": "> Have you given any thought as to whether to pretty print (format with spaces) the output or not? Can be useful for debugging/exploring in a browser or other basic tools which don\u2019t parse the JSON. Could be default (can\u2019t be much bigger with gzip?) or opt-in.\r\n\r\nAdding a `?_pretty=1` option that does that is a great idea, I'm filing a ticket for it: #1237", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782747878", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782747878, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0Nzg3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:53:11Z", "updated_at": "2021-02-20T20:53:11Z", "author_association": "OWNER", "body": "... though thinking about this further, I could re-implement the `select * from commits` (but only return a max of 10 results) feature using a nested `select * from (select * from commits) limit 10` query.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782747743", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782747743, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0Nzc0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:52:10Z", "updated_at": "2021-02-20T20:52:10Z", "author_association": "OWNER", "body": "> Minor suggestion: rename `size` query param to `limit`, to better reflect that it\u2019s a maximum number of rows returned rather than a guarantee of getting that number, and also for consistency with the SQL keyword?\r\n\r\nThe problem there is that `?_size=x` isn't actually doing the same thing as the SQL `limit` keyword. Consider this query:\r\n\r\nhttps://latest-with-plugins.datasette.io/github?sql=select+*+from+commits - `select * from commits`\r\n\r\nDatasette returns 1,000 results, and shows a \"Custom SQL query returning more than 1,000 rows\" message at the top. That's the `size` kicking in - I only fetch the first 1,000 results from the cursor to avoid exhausting resources. In the JSON version of that at https://latest-with-plugins.datasette.io/github.json?sql=select+*+from+commits there's a `\"truncated\": true` key to let you know what happened.\r\n\r\nI find myself using `?_size=2` against Datasette occasionally if I know the rows being returned are really big and I don't want to load 10+MB of HTML.\r\n\r\nThis is only really a concern for arbitrary SQL queries though - for table pages such as https://latest-with-plugins.datasette.io/github/commits?_size=10 adding `?_size=10` actually puts a `limit 10` on the underlying SQL query.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782747164", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782747164, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0NzE2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:47:16Z", "updated_at": "2021-02-20T20:47:16Z", "author_association": "OWNER", "body": "(I started a thread on Twitter about this: https://twitter.com/simonw/status/1363220355318358016)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782746633", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782746633, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0NjYzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:43:07Z", "updated_at": "2021-02-20T20:43:07Z", "author_association": "OWNER", "body": "Another option: `.json` always returns an object with a list of keys that gets increased through adding `?_extra=` parameters.\r\n\r\n`.jsona` always returns a JSON array of objects\r\n\r\nI had something similar to this in Datasette a few years ago - a `.jsono` extension, which still redirects to the `shape=array` version.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782742233", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782742233, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MjIzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:09:16Z", "updated_at": "2021-02-20T20:09:16Z", "author_association": "OWNER", "body": "I just noticed that https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=total&_size=0&_trace=1 executes 35 SQL queries at the moment! A great reminder that a big improvement from this change will be a reduction in queries through not calculating things like suggested facets unless they are explicitly requested.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782741719", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782741719, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MTcxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:05:04Z", "updated_at": "2021-02-20T20:05:04Z", "author_association": "OWNER", "body": "> The only advantage of headers is that you don\u2019t need to do .rows, but that\u2019s actually good as a data validation step anyway\u2014if .rows is missing assume there\u2019s an error and do your error handling path instead of parsing the rest.\r\n\r\nThis is something I've not thought very hard about. If there's an error, I need to return a top-level object, not a top-level array, so I can provide details of the error.\r\n\r\nBut this means that client code will have to handle this difference - it will have to know that the returned data can be array-shaped if nothing went wrong, and object-shaped if there's an error.\r\n\r\nThe HTTP status code helps here - calling client code can know that a 200 status code means there will be an array, but an error status code means an object.\r\n\r\nIf developers really hate that the shape could be different, they can always use `?_extra=next` to ensure that the top level item is an object whether or not an error occurred. So I think this is OK.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782741107", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782741107, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MTEwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T20:00:22Z", "updated_at": "2021-02-20T20:00:22Z", "author_association": "OWNER", "body": "A really exciting opportunity this opens up is for parallel execution - the `facets()` and `suggested_facets()` and `total()` async functions could be called in parallel, which could speed things up if I'm confident the SQLite thread pool can execute on multiple CPU cores (it should be able to because the Python `sqlite3` module releases the GIL while it's executing C code).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782740985", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782740985, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MDk4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T19:59:21Z", "updated_at": "2021-02-20T19:59:21Z", "author_association": "OWNER", "body": "This design should be influenced by how it's implemented.\r\n\r\nOne implementation that could be nice is that each of the keys that can be requested - `next_url`, `total` etc - maps to an `async def` function which can do the work. So that expensive `count(*)` will only be executed by the `async def total` function if it is requested.\r\n\r\nThis raises more questions: Both `next` and `next_url` work off the same underlying data, so if they are both requested can we re-use the work that `next` does somehow? Maybe by letting these functions depend on each other (so `next_url()` knows to first call `next()`, but only if it hasn't been called already.\r\n\r\nI think I need to flesh out the full default collection of `?_extra=` parameters in order to design how they will work under the hood.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782740604", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782740604, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MDYwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T19:56:21Z", "updated_at": "2021-02-20T19:56:33Z", "author_association": "OWNER", "body": "I think I want to support `?_extra=next_url,total` in addition to `?_extra=next_url&_extra=total` - partly because it's less characters to type, and also because I know there exist URL handling library that don't know how to handle the same parameter multiple times (though they're going to break against Datasette already, so it's not a big deal).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782740488", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782740488, "node_id": "MDEyOklzc3VlQ29tbWVudDc4Mjc0MDQ4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T19:55:23Z", "updated_at": "2021-02-20T19:55:23Z", "author_association": "OWNER", "body": "Am I saying you won't get back a key in the response unless you explicitly request it, either by name or by specifying a bundle of extras (e.g. `all` or `paginated`)?\r\n\r\nThe `\"truncated\": true` key that tells you that your arbitrary query returned more than X results but was truncated is pretty important, do I really want people to have to opt-in to that one?\r\n\r\nAlso: having bundles like `all` or `paginated` live in the same namespace as single keys like `next_url` or `total` is a little odd - you can't tell by looking at them if they'll add a key called `all` or if they'll add a bunch of other stuff.\r\n\r\nMaybe bundles could be prefixed with something, perhaps an underscore? `?_extra=_all` and `?_extra=_paginated` for example.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782739926", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782739926, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjczOTkyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T19:51:30Z", "updated_at": "2021-02-20T19:52:19Z", "author_association": "OWNER", "body": "Demos:\r\n\r\n- https://latest-with-plugins.datasette.io/github/commits.json-preview\r\n- https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=next_url\r\n- https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=total\r\n- https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=next_url&_extra=total\r\n- https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=total&_size=0", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782709425", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782709425, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjcwOTQyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T16:24:54Z", "updated_at": "2021-02-20T16:24:54Z", "author_association": "OWNER", "body": "Having shortcuts means I could support `?_extra=all` for returning ALL possible keys.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782709270", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782709270, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjcwOTI3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T16:23:51Z", "updated_at": "2021-02-20T16:24:11Z", "author_association": "OWNER", "body": "Also how would you opt out of returning the `\"rows\"` key? I sometimes want to do this - if I want to get back just the count or just the facets for example.\r\n\r\nSome options:\r\n\r\n* `/fixtures/roadside_attractions.json?_extra=total&_extra=-rows`\r\n* `/fixtures/roadside_attractions.json?_extra=total&_skip=rows`\r\n* `/fixtures/roadside_attractions.json?_extra=total&_size=0`\r\n\r\nI quite like that last one with `?_size=0`. I think it would still return `\"rows\": []` but that's OK.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-782708938", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 782708938, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjcwODkzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-20T16:22:14Z", "updated_at": "2021-02-20T16:22:14Z", "author_association": "OWNER", "body": "I'm leaning back in the direction of a flat JSON array of objects as the default - this:\r\n\r\n`/fixtures/roadside_attractions.json`\r\n\r\nWould return:\r\n\r\n```json\r\n[\r\n {\r\n \"pk\": 1,\r\n \"name\": \"The Mystery Spot\",\r\n \"address\": \"465 Mystery Spot Road, Santa Cruz, CA 95065\",\r\n \"latitude\": 37.0167,\r\n \"longitude\": -122.0024\r\n },\r\n {\r\n \"pk\": 2,\r\n \"name\": \"Winchester Mystery House\",\r\n \"address\": \"525 South Winchester Boulevard, San Jose, CA 95128\",\r\n \"latitude\": 37.3184,\r\n \"longitude\": -121.9511\r\n },\r\n {\r\n \"pk\": 3,\r\n \"name\": \"Burlingame Museum of PEZ Memorabilia\",\r\n \"address\": \"214 California Drive, Burlingame, CA 94010\",\r\n \"latitude\": 37.5793,\r\n \"longitude\": -122.3442\r\n },\r\n {\r\n \"pk\": 4,\r\n \"name\": \"Bigfoot Discovery Museum\",\r\n \"address\": \"5497 Highway 9, Felton, CA 95018\",\r\n \"latitude\": 37.0414,\r\n \"longitude\": -122.0725\r\n }\r\n]\r\n```\r\nTo get the version that includes pagination information you would use the `?_extra=` parameter. For example:\r\n\r\n`/fixtures/roadside_attractions.json?_extra=total&_extra=next_url`\r\n\r\n```json\r\n{\r\n \"rows\": [\r\n {\r\n \"pk\": 1,\r\n \"name\": \"The Mystery Spot\",\r\n \"address\": \"465 Mystery Spot Road, Santa Cruz, CA 95065\",\r\n \"latitude\": 37.0167,\r\n \"longitude\": -122.0024\r\n },\r\n {\r\n \"pk\": 2,\r\n \"name\": \"Winchester Mystery House\",\r\n \"address\": \"525 South Winchester Boulevard, San Jose, CA 95128\",\r\n \"latitude\": 37.3184,\r\n \"longitude\": -121.9511\r\n },\r\n {\r\n \"pk\": 3,\r\n \"name\": \"Burlingame Museum of PEZ Memorabilia\",\r\n \"address\": \"214 California Drive, Burlingame, CA 94010\",\r\n \"latitude\": 37.5793,\r\n \"longitude\": -122.3442\r\n },\r\n {\r\n \"pk\": 4,\r\n \"name\": \"Bigfoot Discovery Museum\",\r\n \"address\": \"5497 Highway 9, Felton, CA 95018\",\r\n \"latitude\": 37.0414,\r\n \"longitude\": -122.0725\r\n }\r\n ],\r\n \"total\": 4,\r\n \"next_url\": null\r\n}\r\n```\r\nANY usage of the `?_extra=` parameter would turn the list into an object with a `\"rows\"` key.\r\n\r\nOpting in to the `total` is nice because it's actually expensive to run a count, so only doing a count if the user requests it feels good.\r\n\r\nBut... having to add `?_extra=total&_extra=next_url` for the common case of wanting both the total count and the URL to get the next page of results is a bit verbose. So maybe support aliases, like `?_extra=paginated` which is a shortcut for `?_extra=total&_extra=next_url`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782464306", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782464306, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ2NDMwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:57:32Z", "updated_at": "2021-02-19T23:57:32Z", "author_association": "OWNER", "body": "Need to test this on mobile.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782464215", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782464215, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ2NDIxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:57:13Z", "updated_at": "2021-02-19T23:57:13Z", "author_association": "OWNER", "body": "Now live on https://latest.datasette.io/_memory", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782462049", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782462049, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ2MjA0OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:51:12Z", "updated_at": "2021-02-19T23:51:12Z", "author_association": "OWNER", "body": "![resize-demo](https://user-images.githubusercontent.com/9599/108573758-4914eb00-72ca-11eb-989c-e642eee68021.gif)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782459550", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782459550, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ1OTU1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:45:30Z", "updated_at": "2021-02-19T23:45:30Z", "author_association": "OWNER", "body": "Encoded using https://meyerweb.com/eric/tools/dencoder/\r\n\r\n`%3Csvg%20aria-labelledby%3D%22cm-drag-to-resize%22%20role%3D%22img%22%20fill%3D%22%23ccc%22%20stroke%3D%22%23ccc%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216%22%20height%3D%2216%22%3E%0A%20%20%3Ctitle%20id%3D%22cm-drag-to-resize%22%3EDrag%20to%20resize%3C%2Ftitle%3E%0A%20%20%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M1%202.75A.75.75%200%20011.75%202h12.5a.75.75%200%20110%201.5H1.75A.75.75%200%20011%202.75zm0%205A.75.75%200%20011.75%207h12.5a.75.75%200%20110%201.5H1.75A.75.75%200%20011%207.75zM1.75%2012a.75.75%200%20100%201.5h12.5a.75.75%200%20100-1.5H1.75z%22%3E%3C%2Fpath%3E%0A%3C%2Fsvg%3E`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782459405", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782459405, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ1OTQwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:45:02Z", "updated_at": "2021-02-19T23:45:02Z", "author_association": "OWNER", "body": "I'm going to use a variant of the Datasette menu icon. Here it is in `#ccc` with an ARIA label:\r\n\r\n```svg\r\n\r\n Drag to resize\r\n \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": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782458983", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782458983, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ1ODk4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:43:34Z", "updated_at": "2021-02-19T23:43:34Z", "author_association": "OWNER", "body": "I only want it to resize up and down, not left to right - so I'm not keen on the default resize handle:\r\n\r\n\"cm-resize_demo\"\r\n\r\nhttps://rawgit.com/Sphinxxxx/cm-resize/master/demo/index.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1236#issuecomment-782458744", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1236", "id": 782458744, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjQ1ODc0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T23:42:42Z", "updated_at": "2021-02-19T23:42:42Z", "author_association": "OWNER", "body": "I can use https://github.com/Sphinxxxx/cm-resize for this", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 812228314, "label": "Ability to increase size of the SQL editor window"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/619#issuecomment-782246111", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/619", "id": 782246111, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MjI0NjExMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T18:11:22Z", "updated_at": "2021-02-19T18:11:22Z", "author_association": "OWNER", "body": "Big usability improvement, see also #1236", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520655983, "label": "\"Invalid SQL\" page should let you edit the SQL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/236#issuecomment-781825726", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/236", "id": 781825726, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTgyNTcyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T05:10:41Z", "updated_at": "2021-02-19T05:10:41Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/cli.html#attaching-additional-databases", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811680502, "label": "--attach command line option for attaching extra databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/113#issuecomment-781825187", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/113", "id": 781825187, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTgyNTE4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T05:09:12Z", "updated_at": "2021-02-19T05:09:12Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/python-api.html#attaching-additional-databases", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621286870, "label": "Syntactic sugar for ATTACH DATABASE"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781764561", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781764561, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTc2NDU2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T02:10:21Z", "updated_at": "2021-02-19T02:10:21Z", "author_association": "OWNER", "body": "This feature is now released! https://docs.datasette.io/en/stable/changelog.html#v0-55", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 1, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1235#issuecomment-781736855", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1235", "id": 781736855, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTczNjg1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T00:52:47Z", "updated_at": "2021-02-19T01:47:53Z", "author_association": "OWNER", "body": "I bumped the two lines in the `Dockerfile` to `FROM python:3.7.10-slim-stretch as build` and ran this to build it:\r\n\r\n docker build -f Dockerfile -t datasetteproject/datasette:python-3-7-10 .\r\n\r\nThen I ran it with:\r\n\r\n docker run -p 8001:8001 -v `pwd`:/mnt datasetteproject/datasette:python-3-7-10 datasette -p 8001 -h 0.0.0.0 /mnt/fixtures.db\r\n\r\nhttp://0.0.0.0:8001/-/versions confirmed that it was now running Python 3.7.10", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811589344, "label": "Upgrade Python version used by official Datasette Docker image"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1235#issuecomment-781735887", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1235", "id": 781735887, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTczNTg4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-19T00:50:21Z", "updated_at": "2021-02-19T00:50:55Z", "author_association": "OWNER", "body": "I'll bump to `3.7.10` for the moment - the fix for 3.8 isn't out until March 1st according to https://news.ycombinator.com/item?id=26186434\r\n\r\nhttps://www.python.org/downloads/release/python-3710/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811589344, "label": "Upgrade Python version used by official Datasette Docker image"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781670827", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781670827, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTY3MDgyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T22:16:46Z", "updated_at": "2021-02-18T22:16:46Z", "author_association": "OWNER", "body": "Demo is now live here: https://latest.datasette.io/_memory\r\n\r\nThe documentation is at https://docs.datasette.io/en/latest/sql_queries.html#cross-database-queries - it links to this example query: https://latest.datasette.io/_memory?sql=select%0D%0A++%27fixtures%27+as+database%2C+*%0D%0Afrom%0D%0A++%5Bfixtures%5D.sqlite_master%0D%0Aunion%0D%0Aselect%0D%0A++%27extra_database%27+as+database%2C+*%0D%0Afrom%0D%0A++%5Bextra_database%5D.sqlite_master", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781665560", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781665560, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTY2NTU2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T22:06:14Z", "updated_at": "2021-02-18T22:06:14Z", "author_association": "OWNER", "body": "The implementation in #1232 is ready to land. It's the simplest-thing-that-could-possibly-work: you can run `datasette one.db two.db three.db --crossdb` and then use the `/_memory` page to run joins across tables from multiple databases.\r\n\r\nIt only works on the first 10 databases that were passed to the command-line. This means that if you have a Datasette instance with hundreds of attached databases (see [Datasette Library](https://github.com/simonw/datasette/issues/417)) this won't be particularly useful for you.\r\n\r\nSo... a better, future version of this feature would be one that lets you join across databases on command - maybe by hitting `/_memory?attach=db1&attach=db2` to get a special connection.\r\n\r\nAlso worth noting: plugins that implement the [prepare_connection()](https://docs.datasette.io/en/stable/plugin_hooks.html#prepare-connection-conn-database-datasette) hook can attach additional databases - so if you need better, customized support for this one way to handle that would be with a custom plugin.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781651283", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781651283, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTY1MTI4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T21:37:55Z", "updated_at": "2021-02-18T21:37:55Z", "author_association": "OWNER", "body": "UI listing the attached tables:\r\n\r\n\"_memory\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781641728", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781641728, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTY0MTcyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T21:19:34Z", "updated_at": "2021-02-18T21:19:34Z", "author_association": "OWNER", "body": "I tested the demo deployment like this:\r\n```\r\ndatasette publish cloudrun fixtures.db extra_database.db \\ \r\n -m fixtures.json \\\r\n --plugins-dir=plugins \\\r\n --branch=crossdb \\\r\n --extra-options=\"--setting template_debug 1 --crossdb\" \\\r\n --install=pysqlite3-binary \\\r\n --service=datasette-latest-crossdb\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781637292", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781637292, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTYzNzI5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T21:11:31Z", "updated_at": "2021-02-18T21:11:31Z", "author_association": "OWNER", "body": "Due to bug #1233 I'm going to publish the additional database as `extra_database.db` rather than `extra database.db` as it is used in the tests.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1233#issuecomment-781636590", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1233", "id": 781636590, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTYzNjU5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T21:10:08Z", "updated_at": "2021-02-18T21:10:08Z", "author_association": "OWNER", "body": "I think the bug is here: https://github.com/simonw/datasette/blob/640ac7071b73111ba4423812cd683756e0e1936b/datasette/utils/__init__.py#L349-L373", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811458446, "label": "\"datasette publish cloudrun\" cannot publish files with spaces in their name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781634819", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781634819, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTYzNDgxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T21:06:43Z", "updated_at": "2021-02-18T21:06:43Z", "author_association": "OWNER", "body": "I'll document this option on https://docs.datasette.io/en/stable/sql_queries.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781629841", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781629841, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTYyOTg0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T20:57:23Z", "updated_at": "2021-02-18T20:57:23Z", "author_association": "OWNER", "body": "The new warning looks like this:\r\n\r\n\"datasette_\u2014_pipenv_shell_\u25b8_Python_\u2014_182\u00d766\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781598585", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781598585, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTU5ODU4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T19:57:30Z", "updated_at": "2021-02-18T19:57:30Z", "author_association": "OWNER", "body": "It would also be neat if https://latest.datasette.io/ had multiple databases attached in order to demonstrate this feature.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1232#issuecomment-781594632", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1232", "id": 781594632, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTU5NDYzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T19:50:21Z", "updated_at": "2021-02-18T19:50:21Z", "author_association": "OWNER", "body": "It would be neat if the `/_memory` page showed a list of attached databases, to indicate that the `--crossdb` option is working and give people links to click to start running queries.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 811407131, "label": "--crossdb option for joining across databases"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781593169", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781593169, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTU5MzE2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T19:47:34Z", "updated_at": "2021-02-18T19:47:34Z", "author_association": "OWNER", "body": "I have a working version now, moving development to a pull request.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781591015", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781591015, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTU5MTAxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T19:44:02Z", "updated_at": "2021-02-18T19:44:02Z", "author_association": "OWNER", "body": "For the moment I'm going to hard-code a `SQLITE_LIMIT_ATTACHED=10` constant and only attach the first 10 databases to the `_memory` connection.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-781574786", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 781574786, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MTU3NDc4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-18T19:15:37Z", "updated_at": "2021-02-18T19:15:37Z", "author_association": "OWNER", "body": "`select * from pragma_database_list();` is useful - shows all attached databases for the current connection.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null}