{"html_url": "https://github.com/simonw/datasette/issues/1595#issuecomment-1012626243", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1595", "id": 1012626243, "node_id": "IC_kwDOBm6k_c48W3ND", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:00:33Z", "updated_at": "2022-01-14T00:00:33Z", "author_association": "OWNER", "body": "Copying those in here:\r\n\r\n- New plugin hook: [filters_from_request(request, database, table, datasette)](https://docs.datasette.io/en/latest/plugin_hooks.html#plugin-hook-filters-from-request), which runs on the table page and can be used to support new custom query string parameters that modify the SQL query. ([#473](https://github.com/simonw/datasette/issues/473))\r\n- The number of unique values in a facet is now always displayed. Previously it was only displayed if the user specified `?_facet_size=max`. ([#1556](https://github.com/simonw/datasette/issues/1556))\r\n- Fixed bug where `?_facet_array=tags&_facet=tags` would only display one of the two selected facets. ([#625](https://github.com/simonw/datasette/issues/625))\r\n- Facets of type `date` or `array` can now be configured in `metadata.json`, see [Facets in metadata.json](https://docs.datasette.io/en/latest/facets.html#facets-metadata). Thanks, David Larlet. ([#1552](https://github.com/simonw/datasette/issues/1552))\r\n- New `?_nosuggest=1` parameter for table views, which disables facet suggestion. ([#1557](https://github.com/simonw/datasette/issues/1557))\r\n- Label columns detected for foreign keys are now case-insensitive, so `Name` or `TITLE` will be detected in the same way as `name` or `title`. ([#1544](https://github.com/simonw/datasette/issues/1544))\r\n- The query string variables exposed by `request.args` will now include blank strings for arguments such as `foo` in `?foo=&bar=1` rather than ignoring those parameters entirely. ([#1551](https://github.com/simonw/datasette/issues/1551))\r\n- Database write connections now execute the [prepare_connection(conn, database, datasette)](https://docs.datasette.io/en/latest/plugin_hooks.html#plugin-hook-prepare-connection) plugin hook. ([#1564](https://github.com/simonw/datasette/issues/1564))\r\n- The `Datasette()` constructor no longer requires the `files=` argument, and is now documented at [Datasette class](https://docs.datasette.io/en/latest/internals.html#internals-datasette). ([#1563](https://github.com/simonw/datasette/issues/1563))\r\n- The tracing feature now traces write queries, not just read queries. ([#1568](https://github.com/simonw/datasette/issues/1568))\r\n- Added two methods for writing to the database: [await db.execute_write_script(sql, block=False)](https://docs.datasette.io/en/latest/internals.html#database-execute-write-script) and [await db.execute_write_many(sql, params_seq, block=False)](https://docs.datasette.io/en/latest/internals.html#database-execute-write-many). ([#1570](https://github.com/simonw/datasette/issues/1570))\r\n- Made several performance improvements to the database schema introspection code that runs when Datasette first starts up. ([#1555](https://github.com/simonw/datasette/issues/1555))\r\n- Fixed bug where writable canned queries could not be used with custom templates. ([#1547](https://github.com/simonw/datasette/issues/1547))", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1102484126, "label": "Release notes for 0.60"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1595#issuecomment-1012626410", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1595", "id": 1012626410, "node_id": "IC_kwDOBm6k_c48W3Pq", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:00:56Z", "updated_at": "2022-01-14T01:17:47Z", "author_association": "OWNER", "body": "Commits since 0.60a1: https://github.com/simonw/datasette/compare/0.60a1...3664ddd40", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1102484126, "label": "Release notes for 0.60"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1597#issuecomment-1012629825", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1597", "id": 1012629825, "node_id": "IC_kwDOBm6k_c48W4FB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:07:36Z", "updated_at": "2022-01-14T00:07:36Z", "author_association": "OWNER", "body": "Fixed:\r\n```\r\n% datasette --help \r\nUsage: datasette [OPTIONS] COMMAND [ARGS]...\r\n\r\n Datasette is an open source multi-tool for exploring and publishing data\r\n\r\n About Datasette: https://datasette.io/\r\n Full documentation: https://docs.datasette.io/\r\n\r\nOptions:\r\n --version Show the version and exit.\r\n --help Show this message and exit.\r\n\r\nCommands:\r\n serve* Serve up specified SQLite database files with a web UI\r\n inspect Generate JSON summary of provided database files\r\n...\r\n\r\n% datasette inspect --help\r\nUsage: datasette inspect [OPTIONS] [FILES]...\r\n\r\n Generate JSON summary of provided database files\r\n\r\n This can then be passed to \"datasette --inspect-file\" to speed up count\r\n operations against immutable database files.\r\n\r\nOptions:\r\n --inspect-file TEXT\r\n --load-extension TEXT Path to a SQLite extension to load\r\n --help Show this message and exit.\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1102612922, "label": "\"datasette inspect\" has no help summary"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1527#issuecomment-1012634659", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1527", "id": 1012634659, "node_id": "IC_kwDOBm6k_c48W5Qj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:17:00Z", "updated_at": "2022-01-14T00:18:11Z", "author_association": "OWNER", "body": "That's because that page has this unnecessary hidden form field:\r\n```html\r\n\r\n```\r\nThat field is added by this bit in the template: https://github.com/simonw/datasette/blob/515f8d38ebae203efc15ca79a8b42848276b35e5/datasette/templates/table.html#L119-L122\r\n\r\nWhich is populated here: https://github.com/simonw/datasette/blob/ace86566b28280091b3844cf5fbecd20158e9004/datasette/views/table.py#L813-L821\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1059555791, "label": "Columns starting with an underscore behave poorly in filters"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1527#issuecomment-1012635696", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1527", "id": 1012635696, "node_id": "IC_kwDOBm6k_c48W5gw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:19:10Z", "updated_at": "2022-01-14T00:20:36Z", "author_association": "OWNER", "body": "Oh! This is because `_city_id` has a leading underscore (for testing purposes). I think I need to filter out any keys that contain `__` in that case.\r\n\r\nWhat happens to columns that contain a `__`? They shouldn't be reflected in the hidden arguments either - this code is really only supposed to catch things like `_where` and `_m2m_through=` and `_col` - basically most of the list on https://docs.datasette.io/en/stable/json_api.html#special-table-arguments", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1059555791, "label": "Columns starting with an underscore behave poorly in filters"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1598#issuecomment-1012643882", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1598", "id": 1012643882, "node_id": "IC_kwDOBm6k_c48W7gq", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:34:49Z", "updated_at": "2022-01-14T00:34:49Z", "author_association": "OWNER", "body": "There are four places in the documentation that use `.. literalinclude::` at the moment which I can replace - I can actually just link directly to the new https://docs.datasette.io/en/latest/cli-reference.html page instead of embedding the help directly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1102637351, "label": "Replace update-docs-help.py script with cog"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1527#issuecomment-1012653109", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1527", "id": 1012653109, "node_id": "IC_kwDOBm6k_c48W9w1", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:57:08Z", "updated_at": "2022-01-14T00:57:08Z", "author_association": "OWNER", "body": "Bug is fixed on https://latest.datasette.io/fixtures/facetable?_sort=pk&_city_id__gt=1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1059555791, "label": "Columns starting with an underscore behave poorly in filters"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1590#issuecomment-1012653966", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1590", "id": 1012653966, "node_id": "IC_kwDOBm6k_c48W9-O", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T00:59:07Z", "updated_at": "2022-01-14T00:59:07Z", "author_association": "OWNER", "body": "Since this is a special case bug for when using Datasette as a library I wonder if a good fix here would be to support something like this:\r\n```python\r\napplication = URLRouter([\r\n re_path(r\"^datasettes/.*\", asgi_cors(datasette_.app(remove_path_prefix=\"datasettes/\"), allow_all=True)),\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": 1099723916, "label": "Table+query JSON and CSV links broken when using `base_url` setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1590#issuecomment-1012656790", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1590", "id": 1012656790, "node_id": "IC_kwDOBm6k_c48W-qW", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T01:05:34Z", "updated_at": "2022-01-14T01:05:34Z", "author_association": "OWNER", "body": "I think this prefixed string mechanism is supposed to prevent the `base_url` prefix from being applied twice: https://github.com/simonw/datasette/blob/3664ddd400062123e99500d28b160c7944408c1a/datasette/url_builder.py#L9-L16\r\n\r\nBut with a bit of extra logging all of the inputs to that are NOT prefixed strings:\r\n\r\n```\r\nUrls.path called with: /datasettes/fixtures/compound_three_primary_keys?_sort=content (PrefixedUrlString = False)\r\n returning /datasettes/datasettes/fixtures/compound_three_primary_keys?_sort=content\r\n```\r\nSo it looks like `urls.path(...)` is indeed the code responsible for doubling up that `/datasettes/` prefix.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099723916, "label": "Table+query JSON and CSV links broken when using `base_url` setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1590#issuecomment-1012661522", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1590", "id": 1012661522, "node_id": "IC_kwDOBm6k_c48W_0S", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T01:16:08Z", "updated_at": "2022-01-14T01:16:34Z", "author_association": "OWNER", "body": "OK, I'm going to recommend a workaround for this instead. Here's `asgi.py` updated to strip the prefix before passing the request on to Datasette:\r\n```python\r\nimport pathlib\r\nfrom asgi_cors import asgi_cors\r\nfrom channels.routing import URLRouter\r\nfrom django.urls import re_path\r\nfrom datasette.app import Datasette\r\n\r\n\r\ndef rewrite_path(app, prefix_to_strip):\r\n async def rewrite_path_app(scope, receive, send):\r\n if (\r\n scope[\"type\"] == \"http\"\r\n and \"path\" in scope\r\n and scope[\"path\"].startswith(prefix_to_strip)\r\n ):\r\n scope[\"path\"] = scope[\"path\"][len(prefix_to_strip) :]\r\n if \"raw_path\" in scope:\r\n scope[\"raw_path\"] = scope[\"raw_path\"][len(prefix_to_strip) :]\r\n await app(scope, receive, send)\r\n\r\n return rewrite_path_app\r\n\r\n\r\ndatasette_ = Datasette(\r\n files=[\"fixtures.db\"],\r\n settings={\"base_url\": \"/datasettes/\", \"plugins\": {}},\r\n)\r\napplication = URLRouter(\r\n [\r\n re_path(\r\n r\"^datasettes/.*\",\r\n asgi_cors(rewrite_path(datasette_.app(), \"/datasettes\"), allow_all=True),\r\n ),\r\n ]\r\n)\r\n```\r\nThis works on my laptop - please re-open the ticket if it doesn't work for you!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099723916, "label": "Table+query JSON and CSV links broken when using `base_url` setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1595#issuecomment-1012664607", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1595", "id": 1012664607, "node_id": "IC_kwDOBm6k_c48XAkf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T01:22:58Z", "updated_at": "2022-01-14T01:22:58Z", "author_association": "OWNER", "body": "- Upgraded Pluggy dependency to 1.0. #1575\r\n- Now using [Plausible](https://plausible.io/) analytics for the Datasette documentation.\r\n- The `db.execute_write()` internals method now defaults to blocking until the write operation has completed. Previously it defaulted to queuing the write and then continuing to run code while the write was in the queue. #1579\r\n- `explain query plan` is now allowed with varying amounts of white space in the query. #1588\r\n- New CLI reference page showing the output of `--help` for each of the `datasette` sub-commands. This lead to several small improvements to the help copy. #1594\r\n- Fixed bug where columns with a underscore prefix could result in unnecessary hidden form fields. #1527", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1102484126, "label": "Release notes for 0.60"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1566#issuecomment-1012680228", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1566", "id": 1012680228, "node_id": "IC_kwDOBm6k_c48XEYk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-14T01:59:54Z", "updated_at": "2022-01-14T01:59:54Z", "author_association": "OWNER", "body": "This is now shipped!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1083669410, "label": "Release Datasette 0.60"}, "performed_via_github_app": null}