{"html_url": "https://github.com/simonw/datasette/pull/941#issuecomment-674566290", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/941", "id": 674566290, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NDU2NjI5MA==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2020-08-16T19:18:43Z", "updated_at": "2020-08-18T05:04:31Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=h1) Report\n> Merging [#941](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=desc) into [main](https://codecov.io/gh/simonw/datasette/commit/52eabb019d4051084b21524bd0fd9c2731126985&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/941/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #941 +/- ##\n=======================================\n Coverage 84.10% 84.10% \n=======================================\n Files 28 28 \n Lines 3788 3788 \n=======================================\n Hits 3186 3186 \n Misses 602 602 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=footer). Last update [52eabb0...f5a72e1](https://codecov.io/gh/simonw/datasette/pull/941?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679809281, "label": "Run CI on GitHub Actions, not Travis"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/940#issuecomment-674590583", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/940", "id": 674590583, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NDU5MDU4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-16T23:15:51Z", "updated_at": "2020-08-18T05:04:43Z", "author_association": "OWNER", "body": "This example of jobs depending on each other and sharing data via artifacts looks relevant: https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#passing-data-between-jobs-in-a-workflow", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679808124, "label": "Move CI to GitHub Issues"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/940#issuecomment-675250280", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/940", "id": 675250280, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTI1MDI4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T05:01:34Z", "updated_at": "2020-08-18T05:01:42Z", "author_association": "OWNER", "body": "I think `${GITHUB_REF#refs/tags/}` is the equivalent of `$TRAVIS_TAG`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679808124, "label": "Move CI to GitHub Issues"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/940#issuecomment-675251613", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/940", "id": 675251613, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTI1MTYxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T05:05:15Z", "updated_at": "2020-08-18T05:05:15Z", "author_association": "OWNER", "body": "I think this is ready. I'll only know for sure the first time I push a release through it though!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679808124, "label": "Move CI to GitHub Issues"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/940#issuecomment-675253373", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/940", "id": 675253373, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTI1MzM3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T05:10:17Z", "updated_at": "2020-08-18T05:10:17Z", "author_association": "OWNER", "body": "I'll close this after the next release successfully goes out.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679808124, "label": "Move CI to GitHub Issues"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/46#issuecomment-675259273", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/46", "id": 675259273, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTI1OTI3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T05:28:32Z", "updated_at": "2020-08-18T05:28:32Z", "author_association": "MEMBER", "body": "Oh that's interesting - i didn't realize \"reviews\" were a separate concept. I'd definitely accept a pull request adding those!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 664485022, "label": "Feature: pull request reviews and comments"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/39#issuecomment-675509550", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/39", "id": 675509550, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTUwOTU1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T14:23:56Z", "updated_at": "2020-08-18T14:23:56Z", "author_association": "MEMBER", "body": "I think this is fixed: https://github-to-sqlite.dogsheep.net/github/issues?_facet=repo", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613777056, "label": "issues foreign key to repo isn't working"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/47#issuecomment-675523053", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/47", "id": 675523053, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTUyMzA1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T14:45:53Z", "updated_at": "2020-08-18T14:45:53Z", "author_association": "MEMBER", "body": "```\r\n% github-to-sqlite emojis emojis.db --fetch\r\n [########----------------------------] 397/1682 23% 00:03:43\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681086659, "label": "emojis command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/940#issuecomment-675538586", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/940", "id": 675538586, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTUzODU4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T15:11:36Z", "updated_at": "2020-08-18T15:11:36Z", "author_association": "OWNER", "body": "I tested this new publish pattern (running the tests in parallel before the deploy step) on `github-to-sqlite` - skipping the Docker step - and it worked: https://github.com/dogsheep/github-to-sqlite/actions/runs/213809864", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 679808124, "label": "Move CI to GitHub Issues"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/873#issuecomment-675609109", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/873", "id": 675609109, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTYwOTEwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T17:21:51Z", "updated_at": "2020-08-18T17:21:51Z", "author_association": "OWNER", "body": "Asked about this on the encode gitter here: https://gitter.im/encode/community?at=5f3c0dcaa8c17801765940c0", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 647095487, "label": "\"datasette -p 0 --root\" gives the wrong URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/873#issuecomment-675610275", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/873", "id": 675610275, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTYxMDI3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T17:24:05Z", "updated_at": "2020-08-18T17:26:10Z", "author_association": "OWNER", "body": "Maybe I can do this with ASGI after all. Here's the output of `/-/asgi-scope` with `datasette-debug-asgi` installed:\r\n```\r\n{'asgi': {'spec_version': '2.1', 'version': '3.0'},\r\n 'client': ('127.0.0.1', 62035),\r\n 'headers': [(b'host', b'127.0.0.1:62029'),\r\n (b'user-agent',\r\n b'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko'\r\n b'/20100101 Firefox/79.0'),\r\n (b'accept',\r\n b'text/html,application/xhtml+xml,application/xml;q=0.9,image/'\r\n b'webp,*/*;q=0.8'),\r\n (b'accept-language', b'en-US,en;q=0.5'),\r\n (b'accept-encoding', b'gzip, deflate'),\r\n (b'dnt', b'1'),\r\n (b'connection', b'keep-alive'),\r\n (b'upgrade-insecure-requests', b'1'),\r\n (b'cache-control', b'max-age=0')],\r\n 'http_version': '1.1',\r\n 'method': 'GET',\r\n 'path': '/-/asgi-scope',\r\n 'query_string': b'',\r\n 'raw_path': b'/-/asgi-scope',\r\n 'root_path': '',\r\n 'scheme': 'http',\r\n 'server': ('127.0.0.1', 62029),\r\n 'type': 'http'}\r\n```\r\nThat `'server': ('127.0.0.1', 62029)` bit has the correct port. Question is, can I access that programmatically on server startup?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 647095487, "label": "\"datasette -p 0 --root\" gives the wrong URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/942#issuecomment-675715472", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/942", "id": 675715472, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTcxNTQ3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T20:55:02Z", "updated_at": "2020-08-18T20:55:02Z", "author_association": "OWNER", "body": "Could display these as tooltips on icons something like this (from the experimental `datasette-inspect-columns` plugin):\r\n\r\n\"fixtures__facetable__15_rows_and_NOAA_tides_second_attempt_-_Jupyter_Notebook\"\r\n\r\nThis would need to take accessibility into account, and would need a different display for the mobile web layout. Need to consider how it will interact with the column menu suggested in #690.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681334912, "label": "Support column descriptions in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/942#issuecomment-675718593", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/942", "id": 675718593, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTcxODU5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T21:02:11Z", "updated_at": "2020-08-18T21:02:24Z", "author_association": "OWNER", "body": "Easiest solution: if you provide column metadata it gets displayed above the table, something like on https://fivethirtyeight.datasettes.com/fivethirtyeight/antiquities-act%2Factions_under_antiquities_act\r\n\r\n\"fivethirtyeight__antiquities-act_actions_under_antiquities_act__344_rows\"\r\n\r\nHTML `title=` tooltips are also added to the table headers, which won't be visible on touch devices but that's OK because the information is visible on the page already.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681334912, "label": "Support column descriptions in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/942#issuecomment-675720040", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/942", "id": 675720040, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTcyMDA0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T21:05:24Z", "updated_at": "2020-08-18T21:05:24Z", "author_association": "OWNER", "body": "Is `columns` the right key for this in the table metadata block? I might want to use that for initial values for `?_col=` in #615.\r\n\r\nAlternative names:\r\n\r\n- `column_descriptions`\r\n- `column_info`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681334912, "label": "Support column descriptions in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/268#issuecomment-675725464", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/268", "id": 675725464, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTcyNTQ2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T21:18:07Z", "updated_at": "2020-08-18T21:18:35Z", "author_association": "OWNER", "body": "I want this on the table page - but that means that the table page will need to run a slightly more complex query since it needs access to a `rank` column to sort by - which it gets from running a join.\r\n\r\nBUT... that join needs to be constructed in a way that keeps existing filters, `?_where=` clauses etc intact.\r\n\r\nHere's a prototype using SQLite CTEs: https://register-of-members-interests.datasettes.com/regmem?sql=with+original+as+%28select+rowid%2C+*+from+items%29%0D%0Aselect%0D%0A++original.*%2C%0D%0A++items_fts.rank+as+items_fts_rank%0D%0Afrom%0D%0A++original+join+items_fts+on+original.rowid+%3D+items_fts.rowid%0D%0Awhere%0D%0A++items_fts+match+escape_fts%28%3Asearch%29%0D%0Aorder+by+items_fts_rank+desc+limit+10&search=hotel\r\n\r\n```sql\r\nwith original as (\r\n select\r\n rowid,\r\n *\r\n from\r\n items\r\n)\r\nselect\r\n original.*,\r\n items_fts.rank as items_fts_rank\r\nfrom\r\n original\r\n join items_fts on original.rowid = items_fts.rowid\r\nwhere\r\n items_fts match escape_fts(:search)\r\norder by\r\n items_fts_rank desc\r\nlimit\r\n 10\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 323718842, "label": "Mechanism for ranking results from SQLite full-text search"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/915#issuecomment-675746544", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/915", "id": 675746544, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc0NjU0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:14:41Z", "updated_at": "2020-08-18T22:14:41Z", "author_association": "OWNER", "body": "I'm actually pretty happy with how `datasette-graphql` works now - maybe the trick here is to redesign the JSON format in #782 such that it can be used as a documented interface by things like `datasette-graphql` and then ensure Datasette has a documented mechanism for dispatching internal requests.\r\n\r\nI just did a horrible hack here that simulates an internal request, so supporting them as a feature would definitely make sense: https://github.com/natbat/tidepools_near_me/commit/ec102c6da5a5d86f17628740d90b6365b671b5e1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 671763164, "label": "Refactor TableView class so things like datasette-graphql can reuse the logic"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675747878", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675747878, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc0Nzg3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:18:46Z", "updated_at": "2020-08-18T22:19:12Z", "author_association": "OWNER", "body": "Could be as simple as `response = await datasette.get(\"/path/blah\")` - which could also be re-used by the implementation of the `datasette --get /` CLI option introduced in #927.\r\n\r\nBit weird calling it `.get()` since that clashes with Python's dictionary `.get()` method.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675748573", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675748573, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc0ODU3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:20:52Z", "updated_at": "2020-08-18T22:20:52Z", "author_association": "OWNER", "body": "Should it default to treating things as if they had the `.json` extension? There are use-cases for the non-JSON method, such as https://github.com/natbat/tidepools_near_me/commit/ec102c6da5a5d86f17628740d90b6365b671b5e1\r\n\r\nI think I'm OK with people having to add `.json` to their internal calls. Maybe they could use `format=\"json\"`) as an optional parameter which would automatically handle the very weird edge-cases where you need to use `?_format=json` instead of `.json` (due to table names existing with a `.json` suffix).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675749076", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675749076, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc0OTA3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:22:21Z", "updated_at": "2020-08-18T22:22:21Z", "author_association": "OWNER", "body": "Alternative name possibilities:\r\n\r\n- `datasette.http_get(...)` - slightly misleading since it's not going over the HTTP protocol\r\n- `datasette.internal_get(...)` - the `internal_` might suggest its not an API for external use, which isn't true - it's for plugins\r\n- `datasette.get(...)` - clashes with `dict.get()` but I'm not at all sure that's a good reason not to use it", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675749319", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675749319, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc0OTMxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:23:01Z", "updated_at": "2020-08-18T22:23:01Z", "author_association": "OWNER", "body": "Actually no - `requests.get()` and `httpx.get()` prove that having a `.get()` method for an HTTP-related API isn't confusing to people at all.\r\n\r\n`datasette.get()` it is.\r\n\r\n(I'll probably add `datasette.post()` in the future too).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675750382", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675750382, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MDM4Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:26:15Z", "updated_at": "2020-08-18T22:26:15Z", "author_association": "OWNER", "body": "Should internal requests executed in this way be handled by plugins that used the `asgi_wrapper()` hook?\r\n\r\nHard to be sure one way or the other. I'm worried about logging middleware triggering twice - but actually anyone doing serious logging of their Datasette instance is probably doing it in a different layer (uvicorn logs or nginx proxy or whatever) so they wouldn't be affected. There aren't any ASGI logging middlewares out there that I've seen.\r\n\r\nAlso: if you run into a situation where your stuff is breaking because `datasette.get()` is calling ASGI middleware twice you can fix it by running your ASGI middleware outside of the `asgi_wrapper` plugin hook mechanism.\r\n\r\nSo I think it DOES execute `asgi_wrapper()` middleware.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675750845", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675750845, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MDg0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:27:43Z", "updated_at": "2020-08-18T22:27:43Z", "author_association": "OWNER", "body": "What about authentication checks etc? Won't they run twice?\r\n\r\nI think that's OK too, in fact it's desirable: think of the case of `datasette-graphql` where a bunch of different TableView calls are being made as part of the same GraphQL queries. Having those calls take advantage of finely grained per-table authentication and permission checks seems like a good feature.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/915#issuecomment-675751136", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/915", "id": 675751136, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MTEzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:28:36Z", "updated_at": "2020-08-18T22:28:36Z", "author_association": "OWNER", "body": "I'm closing this in favour of an internal requests mechanism in #943.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 671763164, "label": "Refactor TableView class so things like datasette-graphql can reuse the logic"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675751719", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675751719, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MTcxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:30:27Z", "updated_at": "2020-08-18T22:30:27Z", "author_association": "OWNER", "body": "Right now calling `datasette.app()` instantiates an ASGI application - complete with a bunch of routes and wrappers - and returns that application object. Calling it twice instantiates another ASGI application.\r\n\r\nI think a single `Datasette` instance should only ever create a single ASGI app - so the `.app()` method should cache the ASGI app that it returns the first time and return the same application again on future calls.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675752436", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675752436, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MjQzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:32:44Z", "updated_at": "2020-08-18T22:32:44Z", "author_association": "OWNER", "body": "One thing to consider here: Datasette's table and database name escaping rules can be a little bit convoluted.\r\n\r\nIf a plugin wants to get back the first five rows of a table, it will need to construct a URL `/dbname/tablename?_size=5` - but it will need to know how to turn the database and table names into the correctly escaped `dbname` and `tablename` values.\r\n\r\nHere's how the `row.html` table handles that right now: https://github.com/simonw/datasette/blob/b21ed237ab940768574c834aa5a7130724bd3a2d/datasette/templates/row.html#L19-L23\r\n\r\nIt would be an improvement to have this logic abstracted out somewhere and documented so plugins can use it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-675753114", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 675753114, "node_id": "MDEyOklzc3VlQ29tbWVudDY3NTc1MzExNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-18T22:34:55Z", "updated_at": "2020-08-18T22:34:55Z", "author_association": "OWNER", "body": "Maybe allow this:\r\n\r\n response = await datasette.get(\"/{database}/{table}.json\", database=database, table=table)\r\n\r\nThis could cause problems if users ever need to pass literal `{` in their paths. Maybe allow this too:\r\n\r\n response = await datasette.get(\"/{database}/{table}.json\", interpolate=False)\r\n\r\nNot convinced this is useful - it's a bit unintuitive.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null}