{"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709571143", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709571143, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU3MTE0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T20:25:35Z", "updated_at": "2020-10-15T20:25:35Z", "author_association": "OWNER", "body": "`cast(nullif(colname, '') as real)` can fix this - it will treat `''` the same as `null`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709539257", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709539257, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzOTI1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:19:29Z", "updated_at": "2020-10-15T19:34:07Z", "author_association": "OWNER", "body": "Urgh this isn't going to work. `%7E~%7E` gets decoded as `~~~` so I wouldn't be able to tell the difference.\r\n\r\nI could use double-percentage-encoding here instead. I feel like there's a simpler solution that I'm missing (and that may well be in use within Datasette already, I'm not doing great thinking this morning).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1024#issuecomment-709595960", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1024", "id": 709595960, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU5NTk2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:18:14Z", "updated_at": "2020-10-15T21:18:14Z", "author_association": "OWNER", "body": "Typing `nginx` starts it running as a daemon listening on port `http-alt` aka 8080. It uses the config file from ` /usr/local/etc/nginx/nginx.conf`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722674708, "label": "Figure out how to run an environment that exercises the base_url proxy setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/988#issuecomment-709588290", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/988", "id": 709588290, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU4ODI5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:02:21Z", "updated_at": "2020-10-15T21:02:21Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 713209404, "label": "Mechanism for plugins to construct URLs that respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/900#issuecomment-709588322", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/900", "id": 709588322, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU4ODMyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:02:26Z", "updated_at": "2020-10-15T21:02:26Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 661605489, "label": "Some links don't honor base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/865#issuecomment-709588373", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/865", "id": 709588373, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU4ODM3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:02:31Z", "updated_at": "2020-10-15T21:02:31Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "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/838#issuecomment-709588425", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/838", "id": 709588425, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTU4ODQyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:02:37Z", "updated_at": "2020-10-15T21:02:37Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "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/904#issuecomment-709633823", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 709633823, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMzgyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:01:13Z", "updated_at": "2020-10-15T23:01:13Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709505147", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709505147, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUwNTE0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:18:45Z", "updated_at": "2020-10-15T18:50:50Z", "author_association": "OWNER", "body": "This needs querystring parameter design. Some options:\r\n\r\n* `?_sort_clause=cast(mycol+as+integer)` and `?_sort_clause_desc=cast(mycol+as+integer)` - allowing any expression. This would need to be disabled if arbitrary SQL was turned off, similar to the restrictions on `?_where=`.\r\n* `?_sort_numeric=mycol` and `?_sort_numeric_desc=mycol` - this would cast to `real` which would work on integer values as well. It could be allowed even when arbitrary SQL was disabled.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1024#issuecomment-709600335", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1024", "id": 709600335, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYwMDMzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:28:02Z", "updated_at": "2020-10-15T22:25:43Z", "author_association": "OWNER", "body": "This is working OK so far:\r\n\r\n\"fixtures__compound_three_primary_keys__1_001_rows_where_sorted_by_pk2\"\r\n\r\nI'll try crawling it with `wget -r` to see if I get any errors.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722674708, "label": "Figure out how to run an environment that exercises the base_url proxy setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709525082", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709525082, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUyNTA4Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:51:59Z", "updated_at": "2020-10-15T18:51:59Z", "author_association": "OWNER", "body": "This is enough of a design to build a working prototype.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/988#issuecomment-709633762", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/988", "id": 709633762, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMzc2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:01:01Z", "updated_at": "2020-10-15T23:01:01Z", "author_association": "OWNER", "body": "This is a dupe of https://github.com/simonw/datasette/issues/904", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 713209404, "label": "Mechanism for plugins to construct URLs that respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709509635", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709509635, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUwOTYzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:24:57Z", "updated_at": "2020-10-15T18:24:57Z", "author_association": "OWNER", "body": "This does feel like a weird plugin hook just because there aren't really THAT many different use-cases that plugins could solve. The ones I can think of are:\r\n\r\n- Sort numeric\r\n- Sort by parsed date\r\n- Sort by FTS rank\r\n\r\nCould this work if I just allow `_sort_clause=`?\r\n\r\nOne possible solution for the no-arbitrary-SQL case: users can define sort orders in `metadata.json/yml`. So if you want to enable sort-by-distance without enabling arbitrary SQL you could add something like this:\r\n\r\n```yaml\r\ndatabases:\r\n mydb:\r\n tables:\r\n museums:\r\n sort_clause: bm25(fts)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709510422", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709510422, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUxMDQyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:26:25Z", "updated_at": "2020-10-15T18:26:25Z", "author_association": "OWNER", "body": "There's something interesting about figuring out which sort options should be offered in the column actions menu.\r\n\r\nTwo options:\r\n\r\n- Try to detect if a text column is all-integers or all-floats, either by scanning the entire table (if it's small enough) or by scanning the first X rows, where X might be the size of the first page or maybe the first 1,000 or similar.\r\n- Could also let users define this in `metadata.yml` for the table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709511399", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709511399, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUxMTM5OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:28:09Z", "updated_at": "2020-10-15T18:28:09Z", "author_association": "OWNER", "body": "The simplest solution would be for Python code to scan all of the visible values on the current page and show the column action for \"sort by this numeric\" based purely on that. I already do that in the JavaScript for \"are there any blank values in the first page?\" here:\r\n\r\nhttps://github.com/simonw/datasette/blob/4f7c0ebd85ccd8c1853d7aa0147628f7c1b749cc/datasette/static/table.js#L106-L118\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": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/878#issuecomment-709502889", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/878", "id": 709502889, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUwMjg4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T18:14:34Z", "updated_at": "2020-10-15T18:14:34Z", "author_association": "OWNER", "body": "The `BaseView` class does this for Datasette internals at the moment, but I'm not convinced it works as well as it could.\r\n\r\nI'd like to turn this into a class that is documented and available to plugins as well.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 648435885, "label": "New pattern for views that return either JSON or HTML, available for plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709531343", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709531343, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzMTM0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:03:12Z", "updated_at": "2020-10-15T19:03:12Z", "author_association": "OWNER", "body": "The Sort by `