{"html_url": "https://github.com/simonw/datasette/pull/866#issuecomment-648818707", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/866", "id": 648818707, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODgxODcwNw==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2020-06-24T13:26:14Z", "updated_at": "2020-06-24T13:26:14Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/866?src=pr&el=h1) Report\n> Merging [#866](https://codecov.io/gh/simonw/datasette/pull/866?src=pr&el=desc) into [master](https://codecov.io/gh/simonw/datasette/commit/1a5b7d318fa923edfcefd3df8f64dae2e9c49d3f&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/866/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/866?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #866 +/- ##\n=======================================\n Coverage 82.99% 82.99% \n=======================================\n Files 26 26 \n Lines 3547 3547 \n=======================================\n Hits 2944 2944 \n Misses 603 603 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/866?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/866?src=pr&el=footer). Last update [1a5b7d3...fb64dda](https://codecov.io/gh/simonw/datasette/pull/866?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": 644610729, "label": "Update pytest-asyncio requirement from <0.13,>=0.10 to >=0.10,<0.15"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/838#issuecomment-648800356", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/838", "id": 648800356, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODgwMDM1Ng==", "user": {"value": 6739646, "label": "tballison"}, "created_at": "2020-06-24T12:51:48Z", "updated_at": "2020-06-24T12:51:48Z", "author_association": "NONE", "body": ">But also want to say thanks for a great tool\r\n\r\n+1!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 637395097, "label": "Incorrect URLs when served behind a proxy with base_url set"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/842#issuecomment-649000075", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/842", "id": 649000075, "node_id": "MDEyOklzc3VlQ29tbWVudDY0OTAwMDA3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T18:46:36Z", "updated_at": "2020-06-24T18:47:37Z", "author_association": "OWNER", "body": "Another magic parameter that would be useful would be `_random`. Consider https://github.com/simonw/datasette-auth-tokens/issues/1 for example - I'd like to be able to provide a writable canned query which can create new authentication tokens in the database, but ideally it would automatically populate a secure random secret for each one.\r\n\r\nMaybe `_random_chars_128` to create a 128 character long random string (using `os.urandom(64).hex()`).\r\n\r\nThis would be the first example of a magic parameter where part of the parameter name is used to configure the resulting value. Maybe neater to separate that with a different character? Unfortunately `_random_chars:128` wouldn't work because these parameters are used in a SQLite query where `:` has special meaning: `insert into blah (secret) values (:_random_chars:128)` wouldn't make sense.\r\n\r\nActually this is already supported by the proposed design - `_random_chars_128` would become `random(\"chars_128\")` so the `random()` function could split off the 128 itself.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638212085, "label": "Magic parameters for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/842#issuecomment-646270702", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/842", "id": 646270702, "node_id": "MDEyOklzc3VlQ29tbWVudDY0NjI3MDcwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-18T19:47:19Z", "updated_at": "2020-06-24T18:48:48Z", "author_association": "OWNER", "body": "Brainstorming more potential magic parameters:\r\n\r\n* `_actor_id`\r\n* `_actor_name`\r\n* `_request_ip`\r\n* `_request_user_agent`\r\n* `_cookie_cookiename`\r\n* `_signedcookie_cookiename` - reading signed cookies would be cool, not sure how to specify namespace though, maybe always use the same one? Or have the namespace come last, `_signedcookie_cookiename_mynamespace`. Might not need special signed cookie support since `actor` is already usually from a signed cookie.\r\n* `_timestamp_unix` (not happy with these names yet)\r\n* `_timestamp_localtime`\r\n* `_timestamp_datetime`\r\n* `_timestamp_utc`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638212085, "label": "Magic parameters for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/842#issuecomment-646271834", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/842", "id": 646271834, "node_id": "MDEyOklzc3VlQ29tbWVudDY0NjI3MTgzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-18T19:49:41Z", "updated_at": "2020-06-24T18:49:22Z", "author_association": "OWNER", "body": "But then what kind of magic parameters might plugins want to add?\r\n\r\nHere's a crazy idea: `_scrapedcontent_url` - it would look for the `url` column on the data being inserted, scrape the content from it and insert that. This does suggest that the magic resolving function `scrapedcontent()` would need to optionally be sent the full row dictionary being inserted too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638212085, "label": "Magic parameters for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/858#issuecomment-648997857", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/858", "id": 648997857, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODk5Nzg1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T18:42:10Z", "updated_at": "2020-06-24T18:42:10Z", "author_association": "OWNER", "body": "I really need to get myself a Windows 10 development environment working so I can dig into this kind of bug properly. I have a gaming PC lying around that I could re-task for that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 642388564, "label": "publish heroku does not work on Windows 10"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/859#issuecomment-648669523", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/859", "id": 648669523, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODY2OTUyMw==", "user": {"value": 3243482, "label": "abdusco"}, "created_at": "2020-06-24T08:13:23Z", "updated_at": "2020-06-24T10:30:36Z", "author_association": "CONTRIBUTOR", "body": "I tried setting `cache_size_kb=0` then `cache_size_kb=100000`, still getting this behavior. I even changed `Database::table_counts` and lowered time limit to 1\r\n\r\n```py\r\ntable_count = (\r\n await self.execute(\r\n \"select count(*) from [{}]\".format(table),\r\n custom_time_limit=1,\r\n )\r\n).rows[0][0]\r\ncounts[table] = table_count\r\n```\r\n\r\nI feel like 10 seconds is a magic number, like a processing timeout and datasette gives up and returns the page. \r\nIndex page loads instantly, table page, query page, as well. But when I return to database page after some time, it loads in 10s.\r\n\r\nEDIT:\r\n\r\nIt's always like 10 + 0.3s, like 10s wait and timeout then 300ms to render the page", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 642572841, "label": "Database page loads too slowly with many large tables (due to table counts)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/842#issuecomment-649014757", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/842", "id": 649014757, "node_id": "MDEyOklzc3VlQ29tbWVudDY0OTAxNDc1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T19:15:46Z", "updated_at": "2020-06-24T19:31:52Z", "author_association": "OWNER", "body": "I'm building this documentation-first - here's the documentation so far: https://github.com/simonw/datasette/blob/6fc8bd9c473f4a25e0a076f24c7e5a9b2f353bb8/docs/sql_queries.rst#magic-parameters", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638212085, "label": "Magic parameters for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/865#issuecomment-648998264", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/865", "id": 648998264, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODk5ODI2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T18:43:02Z", "updated_at": "2020-06-24T18:43:02Z", "author_association": "OWNER", "body": "Thanks for the bug report. Yes I think #838 may be the same issue. Will investigate.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644582921, "label": "base_url doesn't seem to work when adding criteria and clicking \"apply\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/864#issuecomment-648580556", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/864", "id": 648580556, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODU4MDU1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T04:40:49Z", "updated_at": "2020-06-24T04:40:49Z", "author_association": "OWNER", "body": "The ideal fix here would be to rework my `BaseView` subclass mechanism to work with `register_routes()` so that those views don't have any special privileges above plugin-provided views.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644309017, "label": "datasette.add_message() doesn't work inside plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/865#issuecomment-648799963", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/865", "id": 648799963, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODc5OTk2Mw==", "user": {"value": 6739646, "label": "tballison"}, "created_at": "2020-06-24T12:51:01Z", "updated_at": "2020-06-24T12:51:01Z", "author_association": "NONE", "body": "This seems to be a duplicate of: https://github.com/simonw/datasette/issues/838", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644582921, "label": "base_url doesn't seem to work when adding criteria and clicking \"apply\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/864#issuecomment-648580236", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/864", "id": 648580236, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODU4MDIzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-24T04:39:39Z", "updated_at": "2020-06-24T04:39:39Z", "author_association": "OWNER", "body": "Urgh, fixing this is going to be a bit of a pain.\r\n\r\nHere's where I added that custom `dispatch_request()` method - it was to implement flash messaging in #790: https://github.com/simonw/datasette/blame/1a5b7d318fa923edfcefd3df8f64dae2e9c49d3f/datasette/views/base.py#L85\r\n\r\nIf I want this to be made available to `register_routes()` views as well, I'm going to have to move the logic somewhere else. In particular I need to make sure that the `request` object is created once and used throughout the whole request cycle.\r\n\r\nCurrently `register_routes()` view functions get their own separate request object which is created here:\r\n\r\nhttps://github.com/simonw/datasette/blob/1a5b7d318fa923edfcefd3df8f64dae2e9c49d3f/datasette/app.py#L1057-L1068\r\n\r\nSo I'm going to have to refactor this quite a bit to get that shared request object which can be passed both to `register_routes` views and to my various `BaseView` subclasses.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644309017, "label": "datasette.add_message() doesn't work inside plugins"}, "performed_via_github_app": null}