{"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319401843", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319401843, "node_id": "IC_kwDOBm6k_c5OpHlz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T00:42:03Z", "updated_at": "2022-11-18T00:42:23Z", "author_association": "OWNER", "body": "This function works even if the SQLite JSON functions are not available:\r\n\r\n```python\r\nasync def _table_columns(datasette, database_name):\r\n internal = datasette.get_database(\"_internal\")\r\n result = await internal.execute(\r\n \"select table_name, name from columns where database_name = ?\",\r\n [database_name],\r\n )\r\n table_columns = {}\r\n for row in result.rows:\r\n table_columns.setdefault(row[\"table_name\"], []).append(row[\"name\"])\r\n return table_columns\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319435374", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319435374, "node_id": "IC_kwDOBm6k_c5OpPxu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T01:33:30Z", "updated_at": "2022-11-18T01:33:30Z", "author_association": "OWNER", "body": "Just noticed that this isn't including views, which it should.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319477721", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319477721, "node_id": "IC_kwDOBm6k_c5OpaHZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T02:51:40Z", "updated_at": "2022-11-18T02:51:40Z", "author_association": "OWNER", "body": "Views aren't currently available in the `_internal` schema.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319478811", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319478811, "node_id": "IC_kwDOBm6k_c5OpaYb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T02:53:57Z", "updated_at": "2022-11-18T02:53:57Z", "author_association": "OWNER", "body": "I decided to just go for the view names, not their columns.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319482791", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319482791, "node_id": "IC_kwDOBm6k_c5OpbWn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T03:01:36Z", "updated_at": "2022-11-18T03:01:36Z", "author_association": "OWNER", "body": "Good catch. Looks like that bug was introduced by this change: https://github.com/simonw/datasette/commit/1a5e5f2aa951e5bd731067a49819efba68fbe8ef\r\n\r\nFrom:\r\n\r\n- https://github.com/simonw/datasette/issues/1831\r\n\r\nThe search all plugin includes this code which interacts poorly with that refactor:\r\n\r\nhttps://github.com/simonw/datasette-search-all/blob/847b55c368a285e4567627029624d7872ee75cac/datasette_search_all/templates/search_all.html#L31-L36\r\n\r\n```html+jinja\r\n{% block nav %}\r\n
\r\n home\r\n
\r\n {{ super() }}\r\n{% endblock %}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319483555", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319483555, "node_id": "IC_kwDOBm6k_c5Opbij", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T03:02:35Z", "updated_at": "2022-11-18T03:02:35Z", "author_association": "OWNER", "body": "Looks like this issue could affect a bunch of other plugins too: https://cs.github.com/?scopeName=All+repos&scope=&q=%3Cp+class%3D%22crumbs%22%3E+user%3Asimonw", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319493475", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319493475, "node_id": "IC_kwDOBm6k_c5Opd9j", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T03:19:25Z", "updated_at": "2022-11-18T07:03:03Z", "author_association": "OWNER", "body": "Other plugins this looks like it will affect:\r\n\r\n- [x] `datasette-ripgrep` https://github.com/simonw/datasette-ripgrep/blob/03446464420130368582022eeb5944993f64ec8f/datasette_ripgrep/templates/ripgrep.html#L37-L42\r\n- [x] `datasette-socrata` https://github.com/simonw/datasette-socrata/blob/32fb256a461bf0e790eca10bdc7dd9d96c20f7c4/datasette_socrata/templates/datasette_socrata_error.html#L5-L10\r\n- [x] `datasette-configure-fts` https://github.com/simonw/datasette-configure-fts/blob/eca742e5d4b9190fc22d68bc0a406c575e6d09a0/datasette_configure_fts/templates/configure_fts_database.html#L9-L14\r\n- [x] `datasette-edit-templates` https://github.com/simonw/datasette-edit-templates/blob/f772aff4a2a4080c949746668a8ec6302dbeb0d9/datasette_edit_templates/templates/edit_template.html#L17-L23\r\n- [x] `datasette-copyable` https://github.com/simonw/datasette-copyable/blob/204d5c912a8d48c49155c67fba7339d4bb26ab9a/datasette_copyable/templates/copyable.html#L36-L43\r\n- [x] `datasette-public` https://github.com/simonw/datasette-public/blob/32b6a0ba53bd5714b6b41eddd8705b213c105efc/datasette_public/templates/public_table_change_privacy.html#L5-L11\r\n- [x] `datasette-import-table` https://github.com/simonw/datasettecloud-datasette/blob/37d0fe525c6649c1aec3d1ee8bc35a684570e87f/templates/import_data.html#L5-L10\r\n- [x] `datasette-edit-schema` (three places)\r\n- [x] `datasette-indieauth` https://github.com/simonw/datasette-indieauth/blob/a08ce67ddad6098b1240adbeff37d040e4df53b1/datasette_indieauth/templates/indieauth.html#L5-L10", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319525520", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319525520, "node_id": "IC_kwDOBm6k_c5OplyQ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T04:21:14Z", "updated_at": "2022-11-18T07:22:37Z", "author_association": "OWNER", "body": "This search helps too: [https://ripgrep.datasette.io/-/ripgrep?pattern=%7B%25+block+nav&literal=on&ignore=on&glob=%21datasette%2F**](https://ripgrep.datasette.io/-/ripgrep?pattern=%7B%25+block+nav&literal=on&ignore=on&glob=%21datasette%2F**)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319528359", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319528359, "node_id": "IC_kwDOBm6k_c5Opmen", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T04:27:00Z", "updated_at": "2022-11-18T04:27:00Z", "author_association": "OWNER", "body": "Also `datasette-indieauth` https://github.com/simonw/datasette-indieauth/blob/a08ce67ddad6098b1240adbeff37d040e4df53b1/datasette_indieauth/templates/indieauth.html#L5-L10", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319533445", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319533445, "node_id": "IC_kwDOBm6k_c5OpnuF", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-18T04:38:03Z", "updated_at": "2022-11-18T04:38:03Z", "author_association": "CONTRIBUTOR", "body": "Are you tracking the change to send the JSON over to the frontend separately or was that part of this? Something like this is probably pretty close https://github.com/bgrins/datasette/commit/8431c98850c7a552dbcde2a4dd0c3dc942a97d25#diff-0c93232bfd5477eeac96382e52769108b41433d960d5277ffcccf2f464e60abdR9", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319570586", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319570586, "node_id": "IC_kwDOBm6k_c5Opwya", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:33:20Z", "updated_at": "2022-11-18T05:33:20Z", "author_association": "OWNER", "body": "One of the big changes still left to do for Datasette 1.0 is to unify the JSON representation with the context psssed to the templates (via an `?_extra=` mechanism to add extra context needed by the HTML templates), because a goal for 1.0 is for the template context to be a documented API contract such that custom templates won't break with future releases.\r\n\r\nAs such I expect to do quite a bit of refactoring and cleanup on how the template context works later on.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1900#issuecomment-1319571220", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1900", "id": 1319571220, "node_id": "IC_kwDOBm6k_c5Opw8U", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:34:35Z", "updated_at": "2022-11-18T05:34:35Z", "author_association": "OWNER", "body": "Which Docker image are you using here? It looks like it's missing SpatiaLite from the image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452572348, "label": "datasette package --spatialite throws error during build"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1900#issuecomment-1319582239", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1900", "id": 1319582239, "node_id": "IC_kwDOBm6k_c5Opzof", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:55:38Z", "updated_at": "2022-11-18T05:55:38Z", "author_association": "OWNER", "body": "Trying this out locally with this 69MB SpatiaLite file I happened to have lying around (from testing `shapefile-to-sqlite` a while ago): https://static.simonwillison.net/static/2022/nps-spatialite.db\r\n```\r\n% datasette package nps-spatialite.db --spatialite\r\n...\r\n => [2/6] COPY . /app 0.4s\r\n => [3/6] WORKDIR /app 0.0s\r\n => [4/6] RUN apt-get update && apt-get install -y python3-dev gcc libsqlite3-mod-spatialite && rm -rf /var/lib/apt/lists/* 29.6s\r\n => [5/6] RUN pip install -U datasette 12.0s\r\n => [6/6] RUN datasette inspect nps-spatialite.db --inspect-file inspect-data.json 2.6s \r\n => exporting to image 3.0s \r\n => => exporting layers 3.0s \r\n => => writing image sha256:4dfef1c373c5c057ef7ac22344f834d522acef24313a1b25d2eba9e500066b8f 0.0s \r\n```\r\nAnd then:\r\n\r\n docker run -p 8001:8001 4dfef1c373c5\r\n\r\nThis worked fine for me. I ran `datasette package` using Datasette 0.63.1.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452572348, "label": "datasette package --spatialite throws error during build"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1900#issuecomment-1319583281", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1900", "id": 1319583281, "node_id": "IC_kwDOBm6k_c5Opz4x", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:57:44Z", "updated_at": "2022-11-18T05:57:44Z", "author_association": "OWNER", "body": "Did you use the `--spatialite` option?\r\n\r\nI just tried this:\r\n\r\n datasette package nps-spatialite.db\r\n\r\nIt built the image OK (I didn't see the error you reported), but running the container failed with an error:\r\n\r\n```\r\n/tmp % docker run -p 8001:8001 7298e8e6bbfb\r\nUsage: datasette serve [OPTIONS] [FILES]...\r\nTry 'datasette serve --help' for help.\r\n\r\nError: It looks like you're trying to load a SpatiaLite database without first loading the SpatiaLite module.\r\n\r\nRead more: https://docs.datasette.io/en/stable/spatialite.html\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452572348, "label": "datasette package --spatialite throws error during build"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1900#issuecomment-1319583703", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1900", "id": 1319583703, "node_id": "IC_kwDOBm6k_c5Opz_X", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:58:31Z", "updated_at": "2022-11-18T05:58:31Z", "author_association": "OWNER", "body": "Could you provide full steps to reproduce plus a SpatiaLite database file that triggered this for you? I'm not able to recreate the problem.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452572348, "label": "datasette package --spatialite throws error during build"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1899#issuecomment-1319584553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1899", "id": 1319584553, "node_id": "IC_kwDOBm6k_c5Op0Mp", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T06:00:10Z", "updated_at": "2022-11-18T06:01:50Z", "author_association": "OWNER", "body": "I can't actually remember where that `min-height: 70px` came from. I just tried without it and it seems fine - especially since any time you add a newline in the editor it increases its height to fit.\r\n\r\nI ran this in the DevTools console:\r\n\r\n```javascript\r\ndocument.querySelector('.cm-editor').style.minHeight = 'none';\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452495049, "label": "Clicking within the CodeMirror area below the SQL (i.e. when there's only a single line) doesn't cause the editor to get focused "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1901#issuecomment-1319588163", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1901", "id": 1319588163, "node_id": "IC_kwDOBm6k_c5Op1FD", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T06:05:11Z", "updated_at": "2022-11-18T06:05:11Z", "author_association": "OWNER", "body": "For `datasette-copyable` I want to show breadcrumbs that take database/instance permissions into account, so I'm removing `{% block nav %}` entirely and replacing it with this:\r\n\r\n```html+jinja\r\n{% block crumbs %}\r\n{{ crumbs.nav(request=request, database=database, table=table) }}\r\n{% endblock %}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1453813400, "label": "Some plugins show \"home\" breadcrumbs twice in the top left"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1900#issuecomment-1319596087", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1900", "id": 1319596087, "node_id": "IC_kwDOBm6k_c5Op3A3", "user": {"value": 419145, "label": "rdmurphy"}, "created_at": "2022-11-18T06:16:33Z", "updated_at": "2022-11-18T06:16:33Z", "author_association": "NONE", "body": "Interesting! So I tried this locally using your copy of `nps-spatialite.db` and I got the same error. \ud83e\udd14\r\n\r\n```\r\n\u276f datasette package nps-spatialite.db --spatialite\r\n[+] Building 27.5s (10/10) FINISHED \r\n => [internal] load build definition from Dockerfile 0.0s\r\n => => transferring dockerfile: 622B 0.0s\r\n => [internal] load .dockerignore 0.0s\r\n => => transferring context: 2B 0.0s\r\n => [internal] load metadata for docker.io/library/python:3.11.0-slim-bullseye 0.9s\r\n => [internal] load build context 2.3s\r\n => => transferring context: 72.38MB 2.3s\r\n => CACHED [1/6] FROM docker.io/library/python:3.11.0-slim-bullseye@sha256:1cd45c5dad845af18d71745c017325725dc979571c1bbe625b67e6051533716c 0.0s\r\n => [2/6] COPY . /app 0.1s\r\n => [3/6] WORKDIR /app 0.0s\r\n => [4/6] RUN apt-get update && apt-get install -y python3-dev gcc libsqlite3-mod-spatialite && rm -rf /var/lib/apt/lists/* 18.5s\r\n => [5/6] RUN pip install -U datasette 4.9s\r\n => ERROR [6/6] RUN datasette inspect nps-spatialite.db --inspect-file inspect-data.json 0.7s \r\n------ \r\n > [6/6] RUN datasette inspect nps-spatialite.db --inspect-file inspect-data.json: \r\n#10 0.681 Traceback (most recent call last): \r\n#10 0.681 File \"/usr/local/bin/datasette\", line 8, in