{"html_url": "https://github.com/simonw/datasette/pull/1279#issuecomment-808762613", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1279", "id": 808762613, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc2MjYxMw==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2021-03-27T17:03:37Z", "updated_at": "2021-03-27T17:03:37Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1279?src=pr&el=h1) Report\n> Merging [#1279](https://codecov.io/gh/simonw/datasette/pull/1279?src=pr&el=desc) (14d8977) into [main](https://codecov.io/gh/simonw/datasette/commit/3fcfc8513465339ac5f055296cbb67f5262af02b?el=desc) (3fcfc85) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1279/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1279?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #1279 +/- ##\n=======================================\n Coverage 91.51% 91.51% \n=======================================\n Files 34 34 \n Lines 4255 4255 \n=======================================\n Hits 3894 3894 \n Misses 361 361 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1279?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/1279?src=pr&el=footer). Last update [3fcfc85...14d8977](https://codecov.io/gh/simonw/datasette/pull/1279?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": 842556944, "label": "Minor Docs Update. Added `--app` to fly install command."}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1273#issuecomment-808759984", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1273", "id": 808759984, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1OTk4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:43:17Z", "updated_at": "2021-03-27T16:43:17Z", "author_association": "OWNER", "body": "That rivers example in the tutorial would work a lot better with a live demo.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838382890, "label": "Refresh SpatiaLite documentation"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1273#issuecomment-808756921", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1273", "id": 808756921, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1NjkyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:19:45Z", "updated_at": "2021-03-27T16:26:28Z", "author_association": "OWNER", "body": "I have a better recipe for using spatial indexes now on https://simonwillison.net/2021/Jan/24/drawing-shapes-spatialite/\r\n```sql\r\nselect\r\n AsGeoJSON(geometry), *\r\nfrom\r\n CPAD_2020a_SuperUnits\r\nwhere\r\n PARK_NAME like '%mini%' and\r\n Intersects(GeomFromGeoJSON(:freedraw), geometry) = 1\r\n and CPAD_2020a_SuperUnits.rowid in (\r\n select\r\n rowid\r\n from\r\n SpatialIndex\r\n where\r\n f_table_name = 'CPAD_2020a_SuperUnits'\r\n and search_frame = GeomFromGeoJSON(:freedraw)\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": 838382890, "label": "Refresh SpatiaLite documentation"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1273#issuecomment-808757721", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1273", "id": 808757721, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1NzcyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:25:48Z", "updated_at": "2021-03-27T16:25:48Z", "author_association": "OWNER", "body": "> This will give you back an additional column of GeoJSON. You can copy and paste GeoJSON from this column into the debugging tool at geojson.io to visualize it on a map.\r\n\r\nThat should promote `datasette-leaflet-geojson` instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838382890, "label": "Refresh SpatiaLite documentation"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1090#issuecomment-808757659", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1090", "id": 808757659, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1NzY1OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:25:25Z", "updated_at": "2021-03-27T16:25:25Z", "author_association": "OWNER", "body": "Related feature request: ability to set default values for canned queries: #1258", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 741862364, "label": "Custom widgets for canned query forms"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1090#issuecomment-808757155", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1090", "id": 808757155, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1NzE1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:21:43Z", "updated_at": "2021-03-27T16:21:43Z", "author_association": "OWNER", "body": "Idea for these: imitate https://django-sql-dashboard.readthedocs.io/en/latest/widgets.html#custom-widgets and drive them with templates.\r\n\r\nSo a custom widget type of `textarea` would look for a template called `widgets/textarea.html` - which means users could define brand new custom widgets just by creating their own template files.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 741862364, "label": "Custom widgets for canned query forms"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1278#issuecomment-808756366", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1278", "id": 808756366, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODc1NjM2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T16:15:47Z", "updated_at": "2021-03-27T16:15:47Z", "author_association": "OWNER", "body": "https://timezones-api.datasette.io/ is now up and running on Cloud Run.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 842416110, "label": "SpatiaLite timezones demo is broken"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1278#issuecomment-808652008", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1278", "id": 808652008, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY1MjAwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:47:17Z", "updated_at": "2021-03-27T04:47:17Z", "author_association": "OWNER", "body": "https://github.com/simonw/timezones-api is that project, it's pretty old now. I'll try to get it running on Cloud Run.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 842416110, "label": "SpatiaLite timezones demo is broken"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1258#issuecomment-808651088", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1258", "id": 808651088, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY1MTA4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:41:52Z", "updated_at": "2021-03-27T04:42:14Z", "author_association": "OWNER", "body": "Right now they look like this:\r\n```yaml\r\ndatabases:\r\n fixtures:\r\n queries:\r\n neighborhood_search:\r\n params:\r\n - text\r\n```\r\nIn addition to being able to specify defaults, I'd also like to add other things in the future - most significantly the ability to specify a different input widget (e.g. textarea v.s. single-line input)\r\n\r\nSo maybe this looks like:\r\n```yaml\r\nparams:\r\n- name: text\r\n default: \"\"\r\n- name: age\r\n widget: number\r\n```", "reactions": "{\"total_count\": 3, \"+1\": 3, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 828858421, "label": "Allow canned query params to specify default values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1258#issuecomment-808650266", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1258", "id": 808650266, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY1MDI2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:37:07Z", "updated_at": "2021-03-27T04:37:07Z", "author_association": "OWNER", "body": "I like that idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 828858421, "label": "Allow canned query params to specify default values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-808649480", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 808649480, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0OTQ4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:32:10Z", "updated_at": "2021-03-27T04:32:10Z", "author_association": "OWNER", "body": "I'll close this issue after I ship Datasette 0.56 and confirm that the Dockerfile was correctly built and published to Docker Hub.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-808649322", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 808649322, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0OTMyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:31:28Z", "updated_at": "2021-03-27T04:31:28Z", "author_association": "OWNER", "body": "One last test of that Dockerfile:\r\n```\r\n(datasette) datasette % docker build -f Dockerfile -t datasetteproject/datasette:0.55a --build-arg VERSION=0.55 .\r\n(datasette) datasette % docker run datasetteproject/datasette:0.55a datasette --get '/-/versions.json' | jq\r\n{\r\n \"python\": {\r\n \"version\": \"3.9.2\",\r\n \"full\": \"3.9.2 (default, Feb 19 2021, 17:23:45) \\n[GCC 8.3.0]\"\r\n },\r\n \"datasette\": {\r\n \"version\": \"0.55\"\r\n },\r\n \"asgi\": \"3.0\",\r\n \"uvicorn\": \"0.13.4\",\r\n \"sqlite\": {\r\n \"version\": \"3.27.2\",\r\n \"fts_versions\": [\r\n \"FTS5\",\r\n \"FTS4\",\r\n \"FTS3\"\r\n ],\r\n \"extensions\": {\r\n \"json1\": null\r\n },\r\n \"compile_options\": [\r\n \"COMPILER=gcc-8.3.0\",\r\n \"ENABLE_COLUMN_METADATA\",\r\n \"ENABLE_DBSTAT_VTAB\",\r\n \"ENABLE_FTS3\",\r\n \"ENABLE_FTS3_PARENTHESIS\",\r\n \"ENABLE_FTS3_TOKENIZER\",\r\n \"ENABLE_FTS4\",\r\n \"ENABLE_FTS5\",\r\n \"ENABLE_JSON1\",\r\n \"ENABLE_LOAD_EXTENSION\",\r\n \"ENABLE_PREUPDATE_HOOK\",\r\n \"ENABLE_RTREE\",\r\n \"ENABLE_SESSION\",\r\n \"ENABLE_STMTVTAB\",\r\n \"ENABLE_UNLOCK_NOTIFY\",\r\n \"ENABLE_UPDATE_DELETE_LIMIT\",\r\n \"HAVE_ISNAN\",\r\n \"LIKE_DOESNT_MATCH_BLOBS\",\r\n \"MAX_SCHEMA_RETRY=25\",\r\n \"MAX_VARIABLE_NUMBER=250000\",\r\n \"OMIT_LOOKASIDE\",\r\n \"SECURE_DELETE\",\r\n \"SOUNDEX\",\r\n \"TEMP_STORE=1\",\r\n \"THREADSAFE=1\",\r\n \"USE_URI\"\r\n ]\r\n }\r\n}\r\n(datasette) datasette % docker run datasetteproject/datasette:0.55a datasette --get '/-/versions.json' --load-extension=spatialite | jq\r\n{\r\n \"python\": {\r\n \"version\": \"3.9.2\",\r\n \"full\": \"3.9.2 (default, Feb 19 2021, 17:23:45) \\n[GCC 8.3.0]\"\r\n },\r\n \"datasette\": {\r\n \"version\": \"0.55\"\r\n },\r\n \"asgi\": \"3.0\",\r\n \"uvicorn\": \"0.13.4\",\r\n \"sqlite\": {\r\n \"version\": \"3.27.2\",\r\n \"fts_versions\": [\r\n \"FTS5\",\r\n \"FTS4\",\r\n \"FTS3\"\r\n ],\r\n \"extensions\": {\r\n \"json1\": null,\r\n \"spatialite\": \"5.0.1\"\r\n },\r\n \"compile_options\": [\r\n \"COMPILER=gcc-8.3.0\",\r\n \"ENABLE_COLUMN_METADATA\",\r\n \"ENABLE_DBSTAT_VTAB\",\r\n \"ENABLE_FTS3\",\r\n \"ENABLE_FTS3_PARENTHESIS\",\r\n \"ENABLE_FTS3_TOKENIZER\",\r\n \"ENABLE_FTS4\",\r\n \"ENABLE_FTS5\",\r\n \"ENABLE_JSON1\",\r\n \"ENABLE_LOAD_EXTENSION\",\r\n \"ENABLE_PREUPDATE_HOOK\",\r\n \"ENABLE_RTREE\",\r\n \"ENABLE_SESSION\",\r\n \"ENABLE_STMTVTAB\",\r\n \"ENABLE_UNLOCK_NOTIFY\",\r\n \"ENABLE_UPDATE_DELETE_LIMIT\",\r\n \"HAVE_ISNAN\",\r\n \"LIKE_DOESNT_MATCH_BLOBS\",\r\n \"MAX_SCHEMA_RETRY=25\",\r\n \"MAX_VARIABLE_NUMBER=250000\",\r\n \"OMIT_LOOKASIDE\",\r\n \"SECURE_DELETE\",\r\n \"SOUNDEX\",\r\n \"TEMP_STORE=1\",\r\n \"THREADSAFE=1\",\r\n \"USE_URI\"\r\n ]\r\n }\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": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1272#issuecomment-808648974", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1272", "id": 808648974, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0ODk3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:29:42Z", "updated_at": "2021-03-27T04:29:42Z", "author_association": "OWNER", "body": "I'm skipping this for the moment because the new Dockerfile shape introduced in https://github.com/simonw/datasette/issues/1249#issuecomment-804404544 isn't compatible with this technique, since it installs Datasette from PyPI rather than directly from the repo.\r\n\r\nWill need to change that if I want to do this unit tests thing.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838245338, "label": "Unit tests for the Dockerfile"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1272#issuecomment-808647937", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1272", "id": 808647937, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0NzkzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T04:23:19Z", "updated_at": "2021-03-27T04:23:36Z", "author_association": "OWNER", "body": "Part of the challenge here is only running if a Docker daemon is available. I think this pattern works, in `tests/test_dockerfile.py`:\r\n```python\r\nimport httpx\r\nimport pathlib\r\nimport pytest\r\nimport subprocess\r\n\r\nroot = pathlib.Path(__file__).parent.parent\r\n\r\ndef docker_is_available():\r\n try:\r\n client = httpx.Client(\r\n transport=httpx.HTTPTransport(uds=\"/var/run/docker.sock\")\r\n )\r\n client.get(\"http://docker/info\")\r\n return True\r\n except httpx.ConnectError:\r\n return False\r\n\r\n\r\n@pytest.fixture\r\ndef build_container():\r\n assert (root / \"Dockerfile\").exists()\r\n subprocess.check_call([\r\n \"docker\", \"build\", str(root), \"-t\", \"datasette-dockerfile-test\"\r\n ])\r\n\r\n\r\n@pytest.mark.skipif(not docker_is_available(),\r\n reason=\"Docker is not available\"\r\n)\r\ndef test_dockerfile(build_container):\r\n output = subprocess.check_output([\r\n \"docker\", \"run\", \"datasette-dockerfile-test\", \"datasette\", \"--get\", \"/_memory?sql=select+1&shape=_array\"\r\n ])\r\n assert False, \"Implement better assertion here\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838245338, "label": "Unit tests for the Dockerfile"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1276#issuecomment-808642405", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1276", "id": 808642405, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0MjQwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T03:53:18Z", "updated_at": "2021-03-27T03:53:18Z", "author_association": "OWNER", "body": "That's really odd. What version of SQLite are you using on the server? You can tell by visiting `https://your-site/-/versions`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 841456306, "label": "Invalid SQL: \"no such table: pragma_database_list\" on database page"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1277#issuecomment-808641846", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1277", "id": 808641846, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODY0MTg0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-27T03:49:34Z", "updated_at": "2021-03-27T03:49:34Z", "author_association": "OWNER", "body": "I fixed this already, it's a duplicate of #1239", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 842212586, "label": "Facet by array breaks if table name contains a space"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/252#issuecomment-808302971", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/252", "id": 808302971, "node_id": "MDEyOklzc3VlQ29tbWVudDgwODMwMjk3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-26T15:21:38Z", "updated_at": "2021-03-26T15:21:38Z", "author_association": "OWNER", "body": "Already got that! It's the `--nl` option - works for both importing and exporting data: https://sqlite-utils.datasette.io/en/stable/cli.html#inserting-json-data", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 842062949, "label": "Support json-line files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/251#issuecomment-807647791", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/251", "id": 807647791, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNzY0Nzc5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-25T22:42:48Z", "updated_at": "2021-03-25T22:44:31Z", "author_association": "OWNER", "body": "Idea: enhance `lambda` to allow it to return a dictionary of values, which will then be used to populate new columns. Use a `--multicolumn` option to indicate this:\r\n\r\n sqlite-utils convert lambda mydb.db mytable mycolumn \\\r\n --code '{\"first_name\": value.split()[0], \"last_name\": value.split()[1]}' \\\r\n --multicolumn --drop\r\n\r\nThe `--drop` means \"drop the `mycolumn` column after making this change\".\r\n\r\nMaybe `--multi` is a better name than `--multicolumn` here, since either way it's going to need additional explanation somewhere.\r\n\r\nWould this overlap with #239 at all?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 841377702, "label": "\"sqlite-utils convert\" command to replace the separate \"sqlite-transform\" tool"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/251#issuecomment-807642041", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/251", "id": 807642041, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNzY0MjA0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-25T22:39:22Z", "updated_at": "2021-03-25T22:39:22Z", "author_association": "OWNER", "body": "Here's the full current implementation of that tool: https://github.com/simonw/sqlite-transform/blob/0.5/sqlite_transform/cli.py\r\n\r\nMy current plan is to make this functionality available as the following:\r\n\r\n sqlite-utils convert jsonsplit mydb.db mytable mycolumn\r\n sqlite-utils convert parsedatetime mydb.db mytable mycolumn\r\n sqlite-utils convert parsedate mydb.db mytable mycolumn\r\n sqlite-utils convert lambda mydb.db mytable mycolumn --code='str(value).upper()'\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": 841377702, "label": "\"sqlite-utils convert\" command to replace the separate \"sqlite-transform\" tool"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1258#issuecomment-807459633", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1258", "id": 807459633, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNzQ1OTYzMw==", "user": {"value": 1385831, "label": "wdccdw"}, "created_at": "2021-03-25T20:48:33Z", "updated_at": "2021-03-25T20:49:34Z", "author_association": "NONE", "body": "What about allowing default parameters when defining the query in metadata.yml? Something like:\r\n```\r\ndatabases:\r\n fec:\r\n queries:\r\n search_by_name:\r\n params:\r\n - q\r\n default-param-values:\r\n q: \"text to search\"\r\n sql: |-\r\n SELECT...\r\n```\r\n\r\nFor now, I'm using a custom database-.html file that hardcodes a default param in the link, but I'd rather not customize the template just for that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 828858421, "label": "Allow canned query params to specify default values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/741#issuecomment-806166575", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/741", "id": 806166575, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNjE2NjU3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-24T20:30:33Z", "updated_at": "2021-03-24T20:30:33Z", "author_association": "OWNER", "body": "`datasette package` is a mostly unmaintained feature at this point - it has a bit of test coverage but I've not made any improvements to it in a few years, and I don't use it for my own projects.\r\n\r\nI'll make this change to `package` at the same time as I land it for `publish` though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607223136, "label": "Replace \"datasette publish --extra-options\" with \"--setting\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/741#issuecomment-806010960", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/741", "id": 806010960, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNjAxMDk2MA==", "user": {"value": 596279, "label": "zaneselvans"}, "created_at": "2021-03-24T17:19:42Z", "updated_at": "2021-03-24T17:19:42Z", "author_association": "NONE", "body": "Ah, okay so `--extra-options` applies to both `datasette publish` and `datasette package`? There wren't any examples of it being used with `publish` in the docs, so this tripped me up for a bit.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607223136, "label": "Replace \"datasette publish --extra-options\" with \"--setting\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1274#issuecomment-805216038", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1274", "id": 805216038, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTIxNjAzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T20:14:53Z", "updated_at": "2021-03-23T20:14:53Z", "author_association": "OWNER", "body": "Yes this is one of the main reasons I'm planning to switch to encouraging YAML be default instead of JSON (while still supporting JSON) - YAML supports comments and multi-line strings.\r\n\r\nSee #1153 for YAML by default in the documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 839008371, "label": "Might there be some way to comment metadata.json?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1274#issuecomment-805214307", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1274", "id": 805214307, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTIxNDMwNw==", "user": {"value": 7476523, "label": "bobwhitelock"}, "created_at": "2021-03-23T20:12:29Z", "updated_at": "2021-03-23T20:12:29Z", "author_association": "CONTRIBUTOR", "body": "One issue I could see with adding first class support for metadata in hjson format is that this would require adding an additional dependency to handle this, for a feature that would be unused by many users. I wonder if this could fit in as a plugin instead; if a hook existed for loading metadata (maybe as part of https://github.com/simonw/datasette/issues/860) the metadata could then come from any source, as specified by plugins, e.g. hjson, toml, XML, a database table etc.\r\n\r\nUntil/unless this exists, a few ideas for how you could add comments:\r\n- Using YAML as you suggest.\r\n- A common pattern is adding a `\"comment\"` key for comments to any object in JSON - I don't think including an unnecessary key like this would break anything in Datasette, but not certain.\r\n- You could use another tool as a preprocessor for your JSON metadata - e.g. hjson or Jsonnet. You'd write the metadata in that format, and then convert that into JSON to actually use as your final metadata.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 839008371, "label": "Might there be some way to comment metadata.json?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805109341", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805109341, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTEwOTM0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T17:55:48Z", "updated_at": "2021-03-23T18:41:57Z", "author_association": "OWNER", "body": "Beginnings of a UI element for switching between them:\r\n```html\r\n
\r\nJSON\r\nYAML\r\n
\r\n```\r\n\"Metadata_\u2014_Datasette_documentation\"\r\n\r\nThat `
` has a padding of 12px, so using 12px padding on the tab links should get them to line up better.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805047117", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805047117, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA0NzExNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:30:15Z", "updated_at": "2021-03-23T16:46:06Z", "author_association": "OWNER", "body": "https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.0.0/js-yaml.min.js is only 12.5KB zipped, 38KB total - so that's not a bad option.\r\n\r\nhttps://github.com/nodeca/js-yaml", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1270#issuecomment-805058241", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1270", "id": 805058241, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA1ODI0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:45:39Z", "updated_at": "2021-03-23T16:45:39Z", "author_association": "OWNER", "body": "I managed to build SpatiaLite such that this isn't necessary any more. I'm still interested in pursuing this further though - it feels like it could be a more robust way of implementing timeouts, but I need to prove to myself that it's better (maybe better performance, or handles more edge-cases?). Not sure how to prove that yet.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837350092, "label": "Try implementing SQLite timeouts using .interrupt() instead of using .set_progress_handler()"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805056806", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805056806, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA1NjgwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:43:38Z", "updated_at": "2021-03-23T16:43:38Z", "author_association": "OWNER", "body": "I used this code to get that:\r\n```javascript\r\nvar jsonVersion = JSON.stringify(window.jsyaml.load(document.querySelector('.highlight-yaml').textContent), null, 4);\r\ndiv.querySelector('.highlight pre').innerText = jsonVersion;\r\ndiv.querySelector('.highlight pre').style.whiteSpace = 'pre-wrap'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805055291", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805055291, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA1NTI5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:41:31Z", "updated_at": "2021-03-23T16:41:31Z", "author_association": "OWNER", "body": "One downside of doing this conversion in JavaScript: it's much harder to get the same JSON syntax highlighting as that provided by Sphinx:\r\n\r\n\"Metadata_\u2014_Datasette_documentation\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805050163", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805050163, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA1MDE2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:34:35Z", "updated_at": "2021-03-23T16:35:32Z", "author_association": "OWNER", "body": "https://docs.datasette.io/en/stable/metadata.html has this example:\r\n```yaml\r\ntitle: Demonstrating Metadata from YAML\r\ndescription_html: |-\r\n  

This description includes a long HTML string

\r\n
    \r\n
  • YAML is better for embedding HTML strings than JSON!
  • \r\n
\r\nlicense: ODbL\r\nlicense_url: https://opendatacommons.org/licenses/odbl/\r\ndatabases:\r\n fixtures:\r\n tables:\r\n no_primary_key:\r\n hidden: true\r\n queries:\r\n neighborhood_search:\r\n sql: |-\r\n select neighborhood, facet_cities.name, state\r\n from facetable join facet_cities on facetable.city_id = facet_cities.id\r\n where neighborhood like '%' || :text || '%' order by neighborhood;\r\n title: Search neighborhoods\r\n description_html: |-\r\n

This demonstrates basic LIKE search\r\n```\r\n\r\nI ran this in the browser dev tools:\r\n```javascript\r\nvar s = document.createElement('script')\r\ns.src = 'https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.0.0/js-yaml.min.js'\r\ndocument.head.appendChild(s)\r\nvar yamlExample = document.querySelector('.highlight-yaml').textContent);\r\nconsole.log(JSON.stringify(window.jsyaml.load(yamlExample), null, 4))\r\n```\r\nAnd got:\r\n```json\r\n{\r\n \"title\": \"Demonstrating Metadata from YAML\",\r\n \"description_html\": \"

This description includes a long HTML string

\\n
    \\n
  • YAML is better for embedding HTML strings than JSON!
  • \\n
\",\r\n \"license\": \"ODbL\",\r\n \"license_url\": \"https://opendatacommons.org/licenses/odbl/\",\r\n \"databases\": {\r\n \"fixtures\": {\r\n \"tables\": {\r\n \"no_primary_key\": {\r\n \"hidden\": true\r\n }\r\n },\r\n \"queries\": {\r\n \"neighborhood_search\": {\r\n \"sql\": \"select neighborhood, facet_cities.name, state\\nfrom facetable join facet_cities on facetable.city_id = facet_cities.id\\nwhere neighborhood like '%' || :text || '%' order by neighborhood;\",\r\n \"title\": \"Search neighborhoods\",\r\n \"description_html\": \"

This demonstrates basic LIKE search\"\r\n }\r\n }\r\n }\r\n }\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": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805042880", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805042880, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA0Mjg4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:24:32Z", "updated_at": "2021-03-23T16:24:32Z", "author_association": "OWNER", "body": "... actually I think I would do that conversion in Python. The client-side YAML parsers all look a little bit heavy to me in terms of additional page weight.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-805041522", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 805041522, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTA0MTUyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:22:46Z", "updated_at": "2021-03-23T16:22:46Z", "author_association": "OWNER", "body": "That's a good idea. I could do that with JavaScript - loading YAML and converting it to JSON in JavaScript shouldn't be hard, and it's better than JSON-to-YAML because there's only one correct JSON representation of a YAML file whereas you can represent a JSON document in YAML in a bunch of different ways.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-805033155", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 805033155, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNTAzMzE1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T16:12:13Z", "updated_at": "2021-03-23T16:12:13Z", "author_association": "OWNER", "body": "Don't forget to update this bit of the docs: https://docs.datasette.io/en/0.55/spatialite.html#building-spatialite-from-source\r\n\r\n> The packaged versions of SpatiaLite usually provide SpatiaLite 4.3.0a. For an example of how to build the most recent unstable version, 4.4.0-RC0 (which includes the powerful [VirtualKNN module](https://www.gaia-gis.it/fossil/libspatialite/wiki?name=KNN)), take a look at the [Datasette Dockerfile](https://github.com/simonw/datasette/blob/master/Dockerfile).\r\n\r\nSee also #1273", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1159#issuecomment-804698315", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1159", "id": 804698315, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDY5ODMxNQ==", "user": {"value": 552629, "label": "lovasoa"}, "created_at": "2021-03-23T07:58:28Z", "updated_at": "2021-03-23T07:58:38Z", "author_association": "NONE", "body": "@mroswell Did you try it with more columns ? The display is flexible and columns get closer as new ones are added.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 774332247, "label": "Improve the display of facets information"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1153#issuecomment-804640440", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1153", "id": 804640440, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDY0MDQ0MA==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-23T05:58:20Z", "updated_at": "2021-03-23T05:58:20Z", "author_association": "CONTRIBUTOR", "body": "Could there be a little widget that offers conversion from one to the other? ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771202454, "label": "Use YAML examples in documentation by default, not JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1159#issuecomment-804639427", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1159", "id": 804639427, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDYzOTQyNw==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-23T05:56:02Z", "updated_at": "2021-03-23T05:56:02Z", "author_association": "CONTRIBUTOR", "body": "With just three facets, I like it, but it does take more horizontal space. Would be nice to have a switch somewhere, enabling either original compact option or this proposed more-readable option. Also some control over word wrap (width setting) and facet spacing. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 774332247, "label": "Improve the display of facets information"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/164#issuecomment-804541064", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/164", "id": 804541064, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDU0MTA2NA==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-23T02:45:12Z", "updated_at": "2021-03-23T02:45:12Z", "author_association": "CONTRIBUTOR", "body": "\"datasette skeleton\" feature removed #476", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 280013907, "label": "datasette skeleton command for kick-starting database and table metadata"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/163#issuecomment-804540869", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/163", "id": 804540869, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDU0MDg2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-23T02:44:33Z", "updated_at": "2021-03-23T02:44:33Z", "author_association": "OWNER", "body": "Comments welcome!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 279547886, "label": "Document the querystring argument for setting a different time limit"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/163#issuecomment-804539729", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/163", "id": 804539729, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDUzOTcyOQ==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-23T02:41:14Z", "updated_at": "2021-03-23T02:41:14Z", "author_association": "CONTRIBUTOR", "body": "I'm visiting old issues for context while learning datasette. Let me know if okay to make the occasional comment like this one.\r\nquerystring argument now located at:\r\nhttps://docs.datasette.io/en/latest/settings.html#sql-time-limit-ms", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 279547886, "label": "Document the querystring argument for setting a different time limit"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/88#issuecomment-804471733", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/88", "id": 804471733, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDQ3MTczMw==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-22T23:46:36Z", "updated_at": "2021-03-22T23:46:36Z", "author_association": "CONTRIBUTOR", "body": "Google Map API limits seem to prevent https://nhs-england-map.netlify.com from being a working demo.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 273775212, "label": "Add NHS England Hospitals example to wiki"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1271#issuecomment-804299406", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1271", "id": 804299406, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI5OTQwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T18:36:14Z", "updated_at": "2021-03-22T21:49:27Z", "author_association": "OWNER", "body": "This isn't actually working - the outer code attempts to send an `.interrupt()` call to the connection object via the `connections` thread-local, which doesn't work because it's a thread-local so the connection isn't visible to that code.\r\n\r\nNeed to figure out how to communicate with that thread properly.\r\n\r\nAlso a test that fails in this particular case would be a good idea!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837956424, "label": "Use SQLite conn.interrupt() instead of sqlite_timelimit()"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1149#issuecomment-804415619", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1149", "id": 804415619, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDQxNTYxOQ==", "user": {"value": 192568, "label": "mroswell"}, "created_at": "2021-03-22T21:43:16Z", "updated_at": "2021-03-22T21:43:16Z", "author_association": "CONTRIBUTOR", "body": "Sounds like a good idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 769520939, "label": "Make it easier to theme Datasette with CSS"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804406675", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804406675, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDQwNjY3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T21:26:27Z", "updated_at": "2021-03-22T21:26:27Z", "author_association": "OWNER", "body": "(Without the `apt-get update ...` SpatiaLite line it's 125MB)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804404544", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804404544, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDQwNDU0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T21:22:56Z", "updated_at": "2021-03-22T21:24:24Z", "author_association": "OWNER", "body": "Final version of Dockerfile which installs the specified version from GitHub:\r\n\r\n docker build . -t datasette-spatialite --build-arg VERSION=0.55\r\n\r\n```dockerfile\r\nFROM python:3.9.2-slim-buster as build\r\n\r\n# Version of Datasette to install, e.g. 0.55\r\n# docker build . -t datasette --build-arg VERSION=0.55\r\nARG VERSION\r\n\r\n# software-properties-common provides add-apt-repository\r\n# which we need in order to install a more recent release\r\n# of libsqlite3-mod-spatialite from the sid distribution\r\nRUN apt-get update && \\\r\n apt-get -y --no-install-recommends install software-properties-common && \\\r\n add-apt-repository \"deb http://httpredir.debian.org/debian sid main\" && \\\r\n apt-get update && \\\r\n apt-get -t sid install -y --no-install-recommends libsqlite3-mod-spatialite && \\\r\n apt-get remove -y software-properties-common && \\\r\n apt clean && \\\r\n rm -rf /var/lib/apt && \\\r\n rm -rf /var/lib/dpkg\r\n\r\nRUN pip install https://github.com/simonw/datasette/archive/refs/tags/${VERSION}.zip && \\\r\n find /usr/local/lib -name '__pycache__' | xargs rm -r && \\\r\n rm -rf /root/.cache/pip\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nRun against 0.55 this produces an image of 262MB", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804384196", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804384196, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM4NDE5Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:48:46Z", "updated_at": "2021-03-22T20:48:46Z", "author_association": "OWNER", "body": "I think part of the reason it's smaller is that I ran `pip install datasette` instead of using `COPY . /datasette` followed by `pip install /datasette`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804380181", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804380181, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM4MDE4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:42:16Z", "updated_at": "2021-03-22T20:42:16Z", "author_association": "OWNER", "body": "Considering the image on Docker Hub is 383MB, I'm happy with getting that down to 262MB. I'm going to stop looking for new optimizations here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804379644", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804379644, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM3OTY0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:41:23Z", "updated_at": "2021-03-22T20:41:23Z", "author_association": "OWNER", "body": "I tried adding `apt-get remove -y software-properties-common &&` to remove `software-properties-common` but it made no difference to the image size.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804372977", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804372977, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM3Mjk3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:30:37Z", "updated_at": "2021-03-22T20:30:37Z", "author_association": "OWNER", "body": "I tried copying just the `mod_spatialite.so` file into a second stage build but it failed. So I ran `bash` in a working image and used `ldd` to figure out what it was linked to:\r\n```\r\nroot@39683f91e588:/usr/lib/x86_64-linux-gnu# ldd mod_spatialite.so\r\n\tlinux-vdso.so.1 (0x00007ffd021f4000)\r\n\tlibxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f5c75412000)\r\n\tlibpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5c753f0000)\r\n\tlibm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5c752ac000)\r\n\tlibminizip.so.1 => /usr/lib/x86_64-linux-gnu/libminizip.so.1 (0x00007f5c750a0000)\r\n\tlibrttopo.so.1 => /usr/lib/x86_64-linux-gnu/librttopo.so.1 (0x00007f5c75028000)\r\n\tlibfreexl.so.1 => /usr/lib/x86_64-linux-gnu/libfreexl.so.1 (0x00007f5c7501c000)\r\n\tlibproj.so.19 => /usr/lib/x86_64-linux-gnu/libproj.so.19 (0x00007f5c74ca7000)\r\n\tlibz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5c74a89000)\r\n\tlibsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f5c74967000)\r\n\tlibgeos_c.so.1 => /usr/lib/x86_64-linux-gnu/libgeos_c.so.1 (0x00007f5c7492b000)\r\n\tlibc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5c74766000)\r\n\tlibdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5c74760000)\r\n\tlibicuuc.so.67 => /usr/lib/x86_64-linux-gnu/libicuuc.so.67 (0x00007f5c74575000)\r\n\tliblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f5c7454d000)\r\n\t/lib64/ld-linux-x86-64.so.2 (0x00007f5c75d49000)\r\n\tlibtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f5c744c7000)\r\n\tlibcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f5c74439000)\r\n\tlibstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5c7426c000)\r\n\tlibgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5c74250000)\r\n\tlibgeos-3.9.0.so => /usr/lib/x86_64-linux-gnu/libgeos-3.9.0.so (0x00007f5c74040000)\r\n\tlibicudata.so.67 => /usr/lib/x86_64-linux-gnu/libicudata.so.67 (0x00007f5c72527000)\r\n\tlibwebp.so.6 => /usr/lib/x86_64-linux-gnu/libwebp.so.6 (0x00007f5c724bc000)\r\n\tlibzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f5c7241c000)\r\n\tlibjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f5c7220e000)\r\n\tlibjpeg.so.62 => /usr/lib/x86_64-linux-gnu/libjpeg.so.62 (0x00007f5c72188000)\r\n\tlibdeflate.so.0 => /usr/lib/x86_64-linux-gnu/libdeflate.so.0 (0x00007f5c7216c000)\r\n\tlibnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f5c72144000)\r\n\tlibidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f5c72125000)\r\n\tlibrtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f5c71f08000)\r\n\tlibssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f5c71eda000)\r\n\tlibpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f5c71ec5000)\r\n\tlibnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f5c71e8d000)\r\n\tlibgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f5c71ce0000)\r\n\tlibgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f5c71c93000)\r\n\tlibkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f5c71bb3000)\r\n\tlibk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f5c71b7f000)\r\n\tlibcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f5c71b77000)\r\n\tlibldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f5c71b23000)\r\n\tliblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f5c71b12000)\r\n\tlibunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f5c7198e000)\r\n\tlibhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f5c71955000)\r\n\tlibgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f5c718d0000)\r\n\tlibgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f5c717b2000)\r\n\tlibp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f5c71683000)\r\n\tlibtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f5c71470000)\r\n\tlibkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f5c71461000)\r\n\tlibkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f5c71458000)\r\n\tlibresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f5c7143e000)\r\n\tlibsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f5c71421000)\r\n\tlibgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f5c713fe000)\r\n\tlibffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f5c713f4000)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804368372", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804368372, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM2ODM3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:22:43Z", "updated_at": "2021-03-22T20:22:43Z", "author_association": "OWNER", "body": "```dockerfile\r\nFROM python:3.9.2-slim-buster as build\r\n\r\n# software-properties-common provides add-apt-repository\r\nRUN apt-get update && \\\r\n apt-get -y --no-install-recommends install software-properties-common && \\\r\n add-apt-repository \"deb http://httpredir.debian.org/debian sid main\" && \\\r\n apt-get update && \\\r\n apt-get -t sid install -y --no-install-recommends libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/apt && \\\r\n rm -rf /var/lib/dpkg\r\n\r\nRUN pip install datasette && \\\r\n find /usr/local/lib -name '__pycache__' | xargs rm -r && \\\r\n rm -rf /root/.cache/pip\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\n262 MB", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804363687", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804363687, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM2MzY4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:15:00Z", "updated_at": "2021-03-22T20:15:00Z", "author_association": "OWNER", "body": "```\r\nRUN pip install datasette && \\\r\n find /usr/local/lib -name '__pycache__' | xargs rm -r\r\n```\r\nThat dropped it to 265MB.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804360701", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804360701, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM2MDcwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T20:10:07Z", "updated_at": "2021-03-22T20:10:07Z", "author_association": "OWNER", "body": "Adding `--no-install-recommends` dropped it to 275MB", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804347152", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804347152, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM0NzE1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T19:47:56Z", "updated_at": "2021-03-22T19:48:03Z", "author_association": "OWNER", "body": "I wrote a bunch of tips on creating smaller Docker images here: https://simonwillison.net/2018/Nov/19/smaller-python-docker-images/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804344553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804344553, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDM0NDU1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T19:43:25Z", "updated_at": "2021-03-22T19:43:25Z", "author_association": "OWNER", "body": "Does `--no-install-recommends` make a difference?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804338678", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804338678, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDMzODY3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T19:33:43Z", "updated_at": "2021-03-22T19:33:43Z", "author_association": "OWNER", "body": "Replacing `rm -rf /var/lib/{apt,dpkg,cache,log}/` with \r\n```\r\n rm -rf /var/lib/apt && \\\r\n rm -rf /var/lib/dpkg\r\n```\r\nGot the size down to 305MB.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804318314", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804318314, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDMxODMxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T19:04:30Z", "updated_at": "2021-03-22T19:04:30Z", "author_association": "OWNER", "body": "Considering the image on Docker Hub right now is `383MB` this is actually an improvement.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804317545", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804317545, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDMxNzU0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T19:03:22Z", "updated_at": "2021-03-22T19:03:22Z", "author_association": "OWNER", "body": "This Dockerfile:\r\n```dockerfile\r\nFROM python:3.9.2-slim-buster as build\r\n\r\n# software-properties-common provides add-apt-repository\r\nRUN apt-get update && \\\r\n apt-get -y install software-properties-common && \\\r\n add-apt-repository \"deb http://httpredir.debian.org/debian sid main\" && \\\r\n apt-get update && \\\r\n apt-get -t sid install -y libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nRUN pip install datasette\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nProduces a 344MB image that includes a working SpatiaLite 5.0 module. And weirdly... it doesn't exhibit the hanging bug!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804310353", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804310353, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDMxMDM1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T18:52:12Z", "updated_at": "2021-03-22T18:52:12Z", "author_association": "OWNER", "body": "This Dockerfile:\r\n```dockerfile\r\nFROM python:3.9.2-slim-buster as build\r\n\r\n# Setup build dependencies\r\nRUN apt update \\\r\n && apt install -y python3-dev build-essential wget libxml2-dev libproj-dev \\\r\n libminizip-dev libgeos-dev libsqlite3-dev zlib1g-dev pkg-config git \\\r\n && apt clean\r\n\r\nRUN wget \"https://www.sqlite.org/2021/sqlite-autoconf-3340100.tar.gz\" && tar xzf sqlite-autoconf-3340100.tar.gz \\\r\n && cd sqlite-autoconf-3340100 && ./configure --disable-static --enable-fts5 --enable-json1 \\\r\n CFLAGS=\"-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_JSON1\" \\\r\n && make && make install\r\n\r\nRUN wget \"http://www.gaia-gis.it/gaia-sins/freexl-1.0.6.tar.gz\" && tar zxf freexl-1.0.6.tar.gz \\\r\n && cd freexl-1.0.6 && ./configure && make && make install\r\n\r\nRUN wget \"http://www.gaia-gis.it/gaia-sins/libspatialite-5.0.1.tar.gz\" && tar zxf libspatialite-5.0.1.tar.gz \\\r\n && cd libspatialite-5.0.1 && ./configure --disable-rttopo && make && make install\r\n\r\nRUN wget \"http://www.gaia-gis.it/gaia-sins/readosm-sources/readosm-1.1.0.tar.gz\" && tar zxf readosm-1.1.0.tar.gz && cd readosm-1.1.0 && ./configure && make && make install\r\n\r\nRUN wget \"http://www.gaia-gis.it/gaia-sins/spatialite-tools-5.0.0.tar.gz\" && tar zxf spatialite-tools-5.0.0.tar.gz \\\r\n && cd spatialite-tools-5.0.0 && ./configure --disable-rttopo && make && make install\r\n\r\n# Add local code to the image instead of fetching from pypi.\r\n#COPY . /datasette\r\n#RUN pip install /datasette\r\nRUN pip install datasette\r\n\r\nFROM python:3.9.2-slim-buster\r\n\r\n# Copy python dependencies and spatialite libraries\r\nCOPY --from=build /usr/local/lib/ /usr/local/lib/\r\n# Copy executables\r\nCOPY --from=build /usr/local/bin /usr/local/bin\r\n# Copy spatial extensions\r\nCOPY --from=build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu\r\n\r\nENV LD_LIBRARY_PATH=/usr/local/lib\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nProduced a 448MB image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804309510", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804309510, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDMwOTUxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T18:50:50Z", "updated_at": "2021-03-22T18:50:50Z", "author_association": "OWNER", "body": "Ideally I'd like to use the Debian stable `python:3.9.2-slim-buster` base image but install SpatiaLite from Debian unstable here: https://packages.debian.org/sid/libspatialite7\r\n\r\nThis pattern might let me do that: https://github.com/helmesjo/cpp_bash_utils/blob/f031e926249f8e2d7f260f22dc8974c6d5be11fe/docker/images/linux-gcc.dockerfile#L20-L24", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1271#issuecomment-804265042", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1271", "id": 804265042, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI2NTA0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T17:45:45Z", "updated_at": "2021-03-22T17:45:45Z", "author_association": "OWNER", "body": "I can remove this code too: \r\nhttps://github.com/simonw/datasette/blob/6f41c8a2bef309a66588b2875c3e24d26adb4850/datasette/database.py#L190-L192", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837956424, "label": "Use SQLite conn.interrupt() instead of sqlite_timelimit()"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-804263434", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 804263434, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI2MzQzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T17:43:25Z", "updated_at": "2021-03-22T17:43:25Z", "author_association": "OWNER", "body": "I figured out the cause of the hang in #1268 - it was caused by `select count(*) from SpatialIndex` interacting badly with the `set_progress_handler()` mechanism I was using to implement query time limits. #1271 has a replacement for that using `asyncio.wait_for()` and `conn.interrupt()` which should resolve the SpatiaLite issue too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-804261915", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 804261915, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI2MTkxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T17:41:12Z", "updated_at": "2021-03-22T17:41:12Z", "author_association": "OWNER", "body": "Closing this because I've figured out the root of the problem now, and I have a potential solution.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1269#issuecomment-804261610", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1269", "id": 804261610, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI2MTYxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T17:40:41Z", "updated_at": "2021-03-22T17:40:41Z", "author_association": "OWNER", "body": "#1270 looks promising, and I don't want to leave open a security hole where someone could potentially hang Datasette with a nasty `count(*)` query.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837348479, "label": "Don't attempt to run count(*) against virtual tables"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1271#issuecomment-804261103", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1271", "id": 804261103, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI2MTEwMw==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2021-03-22T17:39:57Z", "updated_at": "2021-03-22T17:39:57Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1271?src=pr&el=h1) Report\n> Merging [#1271](https://codecov.io/gh/simonw/datasette/pull/1271?src=pr&el=desc) (fb2ad7a) into [main](https://codecov.io/gh/simonw/datasette/commit/c4f1ec7f33fd7d5b93f0f895dafb5351cc3bfc5b?el=desc) (c4f1ec7) will **decrease** coverage by `0.28%`.\n> The diff coverage is `94.28%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1271/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1271?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #1271 +/- ##\n==========================================\n- Coverage 91.51% 91.22% -0.29% \n==========================================\n Files 34 34 \n Lines 4255 4263 +8 \n==========================================\n- Hits 3894 3889 -5 \n- Misses 361 374 +13 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/simonw/datasette/pull/1271?src=pr&el=tree) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/database.py](https://codecov.io/gh/simonw/datasette/pull/1271/diff?src=pr&el=tree#diff-ZGF0YXNldHRlL2RhdGFiYXNlLnB5) | `92.41% <94.28%> (-0.52%)` | :arrow_down: |\n| [datasette/utils/\\_\\_init\\_\\_.py](https://codecov.io/gh/simonw/datasette/pull/1271/diff?src=pr&el=tree#diff-ZGF0YXNldHRlL3V0aWxzL19faW5pdF9fLnB5) | `92.24% <0.00%> (-1.90%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1271?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/1271?src=pr&el=footer). Last update [c4f1ec7...fb2ad7a](https://codecov.io/gh/simonw/datasette/pull/1271?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": 837956424, "label": "Use SQLite conn.interrupt() instead of sqlite_timelimit()"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1270#issuecomment-804255633", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1270", "id": 804255633, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNDI1NTYzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T17:32:02Z", "updated_at": "2021-03-22T17:32:08Z", "author_association": "OWNER", "body": "Confirmed that the `interrupt()` based cancellation mechanism fixes the SpatiaLite issue in #1268!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837350092, "label": "Try implementing SQLite timeouts using .interrupt() instead of using .set_progress_handler()"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1270#issuecomment-803834784", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1270", "id": 803834784, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzgzNDc4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T07:31:57Z", "updated_at": "2021-03-22T16:22:19Z", "author_association": "OWNER", "body": "I think the implementation for this goes here: https://github.com/simonw/datasette/blob/6f41c8a2bef309a66588b2875c3e24d26adb4850/datasette/database.py#L146-L157\r\n\r\nI figured out a similar pattern in `datasette-ripgrep` here: https://github.com/simonw/datasette-ripgrep/blob/0.7/datasette_ripgrep/__init__.py#L63-L71", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837350092, "label": "Try implementing SQLite timeouts using .interrupt() instead of using .set_progress_handler()"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803802957", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803802957, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzgwMjk1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T06:38:14Z", "updated_at": "2021-03-22T06:38:14Z", "author_association": "OWNER", "body": "Also worth trying is to change this code:\r\n```python\r\n n = 1000 \r\n if ms < 50: \r\n n = 1 \r\n```\r\nWhat happens with `n = 10` instead?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1269#issuecomment-803785808", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1269", "id": 803785808, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc4NTgwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T06:00:53Z", "updated_at": "2021-03-22T06:00:53Z", "author_association": "OWNER", "body": "This may not be necessary if using `.interrupt() for SQLite timeouts in #1270 works.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837348479, "label": "Don't attempt to run count(*) against virtual tables"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803784902", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803784902, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc4NDkwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:59:06Z", "updated_at": "2021-03-22T05:59:06Z", "author_association": "OWNER", "body": "Even if I implement that workaround in #1269 I'm concerned that this could still allow users to deliberately crash Datasette (if it's running SpatiaLite 5.0) by executing `select count(*) from SpatialIndex`.\r\n\r\nThat `interrupt` timeout mechanism is worth digging into further.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803782705", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803782705, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc4MjcwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:54:19Z", "updated_at": "2021-03-22T05:54:19Z", "author_association": "OWNER", "body": "Got two new TILs out of this:\r\n\r\n* [Tracing every executed Python statement](https://til.simonwillison.net/python/tracing-every-statement)\r\n* [Running gdb against a Python process in a running Docker container](https://til.simonwillison.net/docker/gdb-python-docker)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803777724", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803777724, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc3NzcyNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:42:50Z", "updated_at": "2021-03-22T05:43:23Z", "author_association": "OWNER", "body": "\"tuscany_housenumbers__select___from_sqlite_master_where_sql_like__create_virtual_table__\"\r\n\r\nIf I want to avoid counting virtual tables, I need to detect which tables are virtual tables.\r\n\r\nThe safest way to do this is probably to pull the `sql` for every table and then, in Python, check for values that start with `create virtual table` after converting to lower case, using any number of spaces.\r\n\r\nThis would catch things like ` CREATE virtual TABLE` which might be missed by a SQL `like` query. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803775121", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803775121, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc3NTEyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:36:26Z", "updated_at": "2021-03-22T05:36:26Z", "author_association": "OWNER", "body": "So one fix could be to avoid running counts for anything that turns out to be a virtual table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803774926", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803774926, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc3NDkyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:35:56Z", "updated_at": "2021-03-22T05:35:56Z", "author_association": "OWNER", "body": "That's in this code here: https://github.com/simonw/datasette/blob/c4f1ec7f33fd7d5b93f0f895dafb5351cc3bfc5b/datasette/database.py#L221-L241", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803774518", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803774518, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc3NDUxOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:34:57Z", "updated_at": "2021-03-22T05:34:57Z", "author_association": "OWNER", "body": "... and sure enough, adding this code fixed the problem:\r\n```diff\r\ndiff --git a/datasette/database.py b/datasette/database.py\r\nindex 3579cce..b466b12 100644\r\n--- a/datasette/database.py\r\n+++ b/datasette/database.py\r\n@@ -224,6 +226,9 @@ class Database:\r\n # Try to get counts for each table, $limit timeout for each count\r\n counts = {}\r\n for table in await self.table_names():\r\n+ if table == \"SpatialIndex\":\r\n+ counts[table] = 0\r\n+ continue\r\n try:\r\n table_count = (\r\n await self.execute(\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803773484", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803773484, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc3MzQ4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:32:29Z", "updated_at": "2021-03-22T05:32:29Z", "author_association": "OWNER", "body": "To figure out which SQL query triggers the problem I added this code to write to a log file:\r\n```python\r\n with sqlite_timelimit(conn, time_limit_ms):\r\n try:\r\n cursor = conn.cursor()\r\n with open(\"/tmp/sql.log\", \"ab\", buffering=0) as fp:\r\n fp.write((\"{}: {}\\n\".format(sql, params)).encode(\"utf-8\"))\r\n cursor.execute(sql, params if params is not None else {})\r\n```\r\nI had to use `ab` binary mode because Python doesn't allow `buffering=0` for non-binary file operations.\r\n\r\nWith the log enabled, I used `docker exec -it 589ae68de943 bash` to attach to the running container and `tail -f /tmp/sql.log` to see the logs. Here's where it broke:\r\n\r\n```\r\nselect count(*) from [idx_civici_geom_parent]: None\r\nselect count(*) from [sqlite_stat1]: None\r\nselect count(*) from [sqlite_stat3]: None\r\nselect count(*) from [SpatialIndex]: None\r\n```\r\nSo attempting to run a `count(*)` against the `SpatialIndex` virtual table is the thing that triggers the bug.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803764919", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803764919, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc2NDkxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:11:11Z", "updated_at": "2021-03-22T05:11:11Z", "author_association": "OWNER", "body": "Maybe I could implement SQLite query timeouts using the `interrupt()` method instead of the progress handler hack I'm currently using?\r\n\r\nhttps://stackoverflow.com/questions/43240496/python-sqlite3-how-to-quickly-and-cleanly-interrupt-long-running-query-with-e has some tips.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803764200", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803764200, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc2NDIwMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:09:13Z", "updated_at": "2021-03-22T05:09:13Z", "author_association": "OWNER", "body": "I tried building a container where the `conn.set_progress_handler(handler, n)` line was commented out... and it fixed the bug.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803762969", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803762969, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc2Mjk2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:05:51Z", "updated_at": "2021-03-22T05:05:51Z", "author_association": "OWNER", "body": "I had to run `docker kill 16197781a7b5` to kill the broken container - Ctrl+C in the Datasette console window didn't do anything.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803762609", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803762609, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc2MjYwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T05:05:00Z", "updated_at": "2021-03-22T05:05:00Z", "author_association": "OWNER", "body": "Using https://til.simonwillison.net/docker/attach-bash-to-running-container - I figured out how to run `gdb`. I had to use `--privileged` here because otherwise `gdb` showed a \"Could not attach to process\" error.\r\n```\r\ndocker exec --privileged -it 16197781a7b5 bash\r\n# apt-get install gdb python3-dbg\r\n# gdb /usr/bin/python3 -p 20\r\n```\r\nThis paused the process. I tried running this:\r\n```\r\n(gdb) py-bt\r\nTraceback (most recent call first):\r\n File \"/usr/lib/python3.8/asyncio/base_events.py\", line 1845, in _run_once\r\n if handle._cancelled:\r\n File \"/usr/lib/python3.8/asyncio/base_events.py\", line 570, in run_forever\r\n self._run_once()\r\n File \"/usr/lib/python3.8/asyncio/base_events.py\", line 603, in run_until_complete\r\n self.run_forever()\r\n File \"/usr/local/lib/python3.8/dist-packages/uvicorn/server.py\", line 49, in run\r\n loop.run_until_complete(self.serve(sockets=sockets))\r\n File \"/usr/local/lib/python3.8/dist-packages/uvicorn/main.py\", line 386, in run\r\n server.run()\r\n File \"/usr/local/lib/python3.8/dist-packages/datasette/cli.py\", line 575, in serve\r\n uvicorn.run(ds.app(), **uvicorn_kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/click/core.py\", line 610, in invoke\r\n return callback(*args, **kwargs)\r\n File \"/usr/local/lib/python3.8/dist-packages/click/core.py\", line 1066, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File \"/usr/local/lib/python3.8/dist-packages/click/core.py\", line 1259, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File \"/usr/local/lib/python3.8/dist-packages/click/core.py\", line 782, in main\r\n rv = self.invoke(ctx)\r\n File \"/usr/local/lib/python3.8/dist-packages/click/core.py\", line 829, in __call__\r\n return self.main(*args, **kwargs)\r\n File \"/usr/local/bin/datasette\", line 8, in \r\n sys.exit(cli())\r\n \r\n File \"/usr/lib/python3.8/trace.py\", line 450, in runctx\r\n exec(cmd, globals, locals)\r\n File \"/usr/lib/python3.8/trace.py\", line 6632, in main\r\n File \"/usr/lib/python3.8/trace.py\", line 756, in \r\n main()\r\n \r\n File \"/usr/lib/python3.8/runpy.py\", line 343, in _run_code\r\n File \"/usr/lib/python3.8/runpy.py\", line 450, in _run_module_as_main\r\n```\r\nNot sure if that's useful or not.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803759051", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803759051, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1OTA1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:55:22Z", "updated_at": "2021-03-22T04:55:22Z", "author_association": "OWNER", "body": "So I think there's a bug in the way the `set_progress_handler()` mechanism works when used in conjunction with SpatiaLite 5.0 on Linux.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803758793", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803758793, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1ODc5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:54:32Z", "updated_at": "2021-03-22T04:54:32Z", "author_association": "OWNER", "body": "Hitting http://localhost:8001/tuscany_housenumbers triggers the bug. It gets stuck in a loop that looks like this:\r\n\r\n\"datasette_\u2014_root_16197781a7b5____\u2014_com_docker_cli_\u25c2_docker_run_-it_-p_8001_8001_-v___Dropbox_Development_datasette__mnt_datasette-spatialite_latest_bash_\u2014_195\u00d748_and_getIncidentsGit_\u2014_-zsh_\u2014_162\u00d760\"\r\n\r\nWhich looks to me like this code: https://github.com/simonw/datasette/blob/8e18c7943181f228ce5ebcea48deb59ce50bee1f/datasette/utils/__init__.py#L139-L158", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803758182", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803758182, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1ODE4Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:52:15Z", "updated_at": "2021-03-22T04:52:15Z", "author_association": "OWNER", "body": "Hitting http://localhost:8001/ successfully shows the homepage (after a lot more scrolling).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803757746", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803757746, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1Nzc0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:50:40Z", "updated_at": "2021-03-22T04:51:52Z", "author_association": "OWNER", "body": "Here's a fun debugging trick:\r\n\r\n docker run -it -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest bash\r\n root@16197781a7b5:/# python3 -m trace --trace $(which datasette) \\\r\n -p 8001 -h 0.0.0.0 /mnt/tuscany_housenumbers.sqlite \\\r\n --load-extension=spatialite\r\n\r\nA huge amount of stuff scrolls past as Datasette starts up, since we are tracing every executed line of Python.\r\n\r\nAfter about a minute it's finished starting and gets to this point:\r\n\r\n```\r\nselectors.py(452): if timeout is None:\r\nselectors.py(454): elif timeout <= 0:\r\nselectors.py(459): timeout = math.ceil(timeout * 1e3) * 1e-3\r\nselectors.py(464): max_ev = max(len(self._fd_to_key), 1)\r\nselectors.py(466): ready = []\r\nselectors.py(467): try:\r\nselectors.py(468): fd_event_list = self._selector.poll(timeout, max_ev)\r\n```\r\nNow I can make some HTTP requests against it.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1268#issuecomment-803756495", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1268", "id": 803756495, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1NjQ5NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:46:04Z", "updated_at": "2021-03-22T04:46:04Z", "author_association": "OWNER", "body": "`gdb` may be able to help debug this: https://www.podoliaka.org/2016/04/10/debugging-cpython-gdb/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837308703, "label": "Figure out why SpatiaLite 5.0 hangs the database page on Linux"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803755698", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803755698, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1NTY5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:43:02Z", "updated_at": "2021-03-22T04:43:02Z", "author_association": "OWNER", "body": "I'll spin off a separate ticket to investigate the hang.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1267#issuecomment-803754226", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1267", "id": 803754226, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1NDIyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:37:26Z", "updated_at": "2021-03-22T04:37:26Z", "author_association": "OWNER", "body": "Thanks for doing this - I've used alternativeto.net a bunch in the past, it's great to see Datasette listed there.\r\n\r\nThis does raise some interesting philosophical questions: three years into the project I'm still not entirely sure what Datasette competes with! Could be SQLite desktop packages, could be visualization software like Tableau, could even be something like Airtable (given a few more plugins).\r\n\r\nIt will be interesting to see how the alternativeto listing evolves, maybe it will help me answer that question!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 837208901, "label": "Update Datasette alternativeto listening with details"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803753388", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803753388, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1MzM4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:34:20Z", "updated_at": "2021-03-22T04:35:10Z", "author_association": "OWNER", "body": "Well this is frustrating. I finally found a Dockerfile that worked and installed an Ubuntu pre-compiled SpatiaLite module that would load...\r\n```dockerfile\r\nFROM ubuntu:20.10 as install_spatialite\r\n\r\nRUN apt update && \\\r\n apt install -y libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nFROM ubuntu:20.10\r\n\r\nRUN apt update && \\\r\n apt install -y python3-pip && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nRUN pip install datasette\r\n\r\n# Copy spatial extensions\r\nCOPY --from=install_spatialite /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/\r\n\r\nENV LD_LIBRARY_PATH=/usr/local/lib\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\n(Which produced a 550MB image)\r\n\r\nAnd when I ran Datasette I got that same error where the database listing page hangs!\r\n```\r\ndocker run -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest datasette -p 8001 -h 0.0.0.0 /mnt/tuscany_housenumbers.sqlite --load-extension=spatialite\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803751068", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803751068, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1MTA2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:26:45Z", "updated_at": "2021-03-22T04:26:45Z", "author_association": "OWNER", "body": "Here's why:\r\n```\r\ndatasette % docker run -it -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest bash \r\nroot@3430352ff378:/# datasette\r\nbash: /usr/local/bin/datasette: /usr/bin/python3: bad interpreter: No such file or directory\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803750617", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803750617, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1MDYxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:25:14Z", "updated_at": "2021-03-22T04:25:14Z", "author_association": "OWNER", "body": "Got this error attempting to run Datasette (with or without SpatiaLite):\r\n```\r\nstandard_init_linux.go:219: exec user process caused: no such file or directory\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": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803750399", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803750399, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc1MDM5OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:24:25Z", "updated_at": "2021-03-22T04:24:25Z", "author_association": "OWNER", "body": "I'll try using `ubuntu:20.10` for everything:\r\n```dockerfile\r\nFROM ubuntu:20.10 as install_spatialite\r\n\r\nRUN apt update && \\\r\n apt install -y libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nFROM ubuntu:20.10 as build\r\n\r\nRUN apt update && \\\r\n apt install -y python3-pip && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nRUN pip install datasette\r\n\r\n#COPY . /datasette\r\n#RUN pip install /datasette\r\n\r\nFROM ubuntu:20.10\r\n\r\n# Copy python dependencies and spatialite libraries\r\nCOPY --from=build /usr/local/lib/ /usr/local/lib/\r\n# Copy executables\r\nCOPY --from=build /usr/local/bin /usr/local/bin\r\n# Copy spatial extensions\r\nCOPY --from=install_spatialite /usr/lib/x86_64-linux-gnu/mod_spatialite.so /usr/lib/x86_64-linux-gnu/mod_spatialite.so\r\n\r\nENV LD_LIBRARY_PATH=/usr/local/lib\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803749831", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803749831, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc0OTgzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:22:35Z", "updated_at": "2021-03-22T04:22:35Z", "author_association": "OWNER", "body": "I tried copying just the `mod_spatialite.so` file:\r\n```dockerfile\r\nFROM ubuntu:20.10 as install_spatialite\r\n\r\nRUN apt update && \\\r\n apt install -y libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nFROM python:3.9.2-slim as build\r\n\r\nRUN pip install datasette\r\n\r\n#COPY . /datasette\r\n#RUN pip install /datasette\r\n\r\nFROM python:3.9.2-slim\r\n\r\n# Copy python dependencies and spatialite libraries\r\nCOPY --from=build /usr/local/lib/ /usr/local/lib/\r\n# Copy executables\r\nCOPY --from=build /usr/local/bin /usr/local/bin\r\n# Copy spatial extensions\r\nCOPY --from=install_spatialite /usr/lib/x86_64-linux-gnu/mod_spatialite.so /usr/lib/x86_64-linux-gnu/mod_spatialite.so\r\n\r\nENV LD_LIBRARY_PATH=/usr/local/lib\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nBut when I ran Datasette with `--load-extension=spatialite` I got this:\r\n```\r\n File \"/usr/local/lib/python3.9/site-packages/datasette/database.py\", line 151, in in_thread\r\n self.ds._prepare_connection(conn, self.name)\r\n File \"/usr/local/lib/python3.9/site-packages/datasette/app.py\", line 502, in _prepare_connection\r\n conn.execute(f\"SELECT load_extension('{extension}')\")\r\nsqlite3.OperationalError: /usr/lib/x86_64-linux-gnu/mod_spatialite.so.so: cannot open shared object file: No such file or directory\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803748469", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803748469, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc0ODQ2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:17:51Z", "updated_at": "2021-03-22T04:17:51Z", "author_association": "OWNER", "body": "... except my clever image using SpatiaLite installed for Ubuntu doesn't actually work:\r\n\r\n```\r\ndatasette % docker run -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest datasette -p 8001 -h 0.0.0.0 /mnt/fixtures.db\r\n File \"/usr/local/lib/python3.9/sqlite3/dbapi2.py\", line 27, in \r\n from _sqlite3 import *\r\nImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/lib/x86_64-linux-gnu/libsqlite3.so.0)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803748158", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803748158, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc0ODE1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:16:57Z", "updated_at": "2021-03-22T04:16:57Z", "author_association": "OWNER", "body": "Which is great, because the image on Docker Hub right now is 383MB.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803747701", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803747701, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzc0NzcwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T04:15:40Z", "updated_at": "2021-03-22T04:15:40Z", "author_association": "OWNER", "body": "Here's a trick: install SpatiaLite in `ubuntu:20.10` and then copy it into the final `python:3.9.2-slim` image.\r\n\r\n```dockerfile\r\nFROM ubuntu:20.10 as install_spatialite\r\n\r\nRUN apt update && \\\r\n apt install -y libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n\r\nFROM python:3.9.2-slim as build\r\n\r\nRUN pip install datasette\r\n\r\n#COPY . /datasette\r\n#RUN pip install /datasette\r\n\r\nFROM python:3.9.2-slim\r\n\r\n# Copy python dependencies and spatialite libraries\r\nCOPY --from=build /usr/local/lib/ /usr/local/lib/\r\n# Copy executables\r\nCOPY --from=build /usr/local/bin /usr/local/bin\r\n# Copy spatial extensions\r\nCOPY --from=install_spatialite /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu\r\n\r\nENV LD_LIBRARY_PATH=/usr/local/lib\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nThat produced a 265MB image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803700940", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803700940, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzcwMDk0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T01:14:24Z", "updated_at": "2021-03-22T01:14:24Z", "author_association": "OWNER", "body": "I tried that with just `python3-pip` (removing `libsqlite3-mod-spatialite`) and got 435MB.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803700626", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803700626, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzcwMDYyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T01:13:04Z", "updated_at": "2021-03-22T01:13:04Z", "author_association": "OWNER", "body": "Building a Dockerfile containing just `FROM ubuntu:20.10` gave me `79.5MB`.\r\n\r\nBuilding this one:\r\n```dockerfile\r\nFROM ubuntu:20.10\r\n\r\n# Setup build dependencies\r\nRUN apt update && \\\r\n apt install -y python3-pip libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/{apt,dpkg,cache,log}/\r\n```\r\nResulted in a 515MB image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803698983", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803698983, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzY5ODk4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T01:05:36Z", "updated_at": "2021-03-22T01:06:23Z", "author_association": "OWNER", "body": "It's pretty big though. I tried this version which avoids copying junk from my laptop in:\r\n\r\n```dockerfile\r\nFROM ubuntu:20.10\r\n\r\n# Setup build dependencies\r\nRUN apt update && apt install -y python3-pip libsqlite3-mod-spatialite && apt clean\r\n\r\nRUN pip install datasette\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nAnd got this:\r\n```\r\ndatasette % docker images datasette-spatialite \r\nREPOSITORY TAG IMAGE ID CREATED SIZE\r\ndatasette-spatialite latest 0796950653c2 2 seconds ago 528MB\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803698168", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803698168, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzY5ODE2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T01:02:02Z", "updated_at": "2021-03-22T01:02:30Z", "author_association": "OWNER", "body": "This is the shortest Dockerfile that appeared to give me a working SpatiaLite module:\r\n```dockerfile\r\nFROM ubuntu:20.10\r\n\r\n# Setup build dependencies\r\nRUN apt update && apt install -y python3-pip libsqlite3-mod-spatialite && apt clean\r\n\r\n# Add local code to the image instead of fetching from pypi.\r\nCOPY . /datasette\r\n\r\nRUN pip install /datasette\r\n\r\nRUN rm -rf /datasette\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803697546", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803697546, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzY5NzU0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T00:59:47Z", "updated_at": "2021-03-22T00:59:47Z", "author_association": "OWNER", "body": "To debug I'm running:\r\n\r\n docker run -it -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest bash\r\n\r\nThis gets me a shell I can use.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803697211", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803697211, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzY5NzIxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T00:58:01Z", "updated_at": "2021-03-22T00:58:01Z", "author_association": "OWNER", "body": "I'm messing around with the `Dockerfile` and after each change I'm running:\r\n\r\n docker build . -t datasette-spatialite\r\n\r\nAnd then:\r\n\r\n docker run -p 8001:8001 -v `pwd`:/mnt datasette-spatialite:latest datasette -p 8001 -h 0.0.0.0 /mnt/fixtures.db\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1249#issuecomment-803694661", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1249", "id": 803694661, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMzY5NDY2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-22T00:46:49Z", "updated_at": "2021-03-22T00:46:49Z", "author_association": "OWNER", "body": "Actually for the loadable module I think I need https://packages.ubuntu.com/groovy/libsqlite3-mod-spatialite", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 824064069, "label": "Updated Dockerfile with SpatiaLite version 5.0"}, "performed_via_github_app": null}