{"html_url": "https://github.com/simonw/datasette/issues/110#issuecomment-345017256", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/110", "id": 345017256, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NTAxNzI1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T18:38:30Z", "updated_at": "2017-11-16T18:38:30Z", "author_association": "OWNER", "body": "To finish up, I committed the image I created in the above so I can run it again in the future:\r\n\r\n docker commit $(docker ps -lq) datasette-sqlite\r\n\r\nNow I can run it like this:\r\n\r\n docker run -it -p 8018:8018 datasette-sqlite datasette /tmp/test23.sqlite -p 8018 -h 0.0.0.0 --load-extension /usr/local/lib/mod_spatialite.so\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 274578142, "label": "Add --load-extension option to datasette for loading extra SQLite extensions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/110#issuecomment-344988263", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/110", "id": 344988263, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk4ODI2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T16:58:48Z", "updated_at": "2017-11-16T16:58:48Z", "author_association": "OWNER", "body": "Here's how I tested this.\r\n\r\nFirst I downloaded and started a docker container using https://hub.docker.com/r/prolocutor/python3-sqlite-ext - which includes the compiled spatialite extension. This downloads it, then starts a shell in that container.\r\n\r\n docker run -it -p 8018:8018 prolocutor/python3-sqlite-ext:3.5.1-spatialite /bin/sh\r\n\r\nInstalled a pre-release build of datasette which includes the new `--load-extension` option.\r\n\r\n pip install https://static.simonwillison.net/static/2017/datasette-0.13-py3-none-any.whl\r\n\r\nNow grab a sample database from https://www.gaia-gis.it/spatialite-2.3.1/resources.html - and unzip and rename it (datasette doesn't yet like databases with dots in their filename):\r\n\r\n wget http://www.gaia-gis.it/spatialite-2.3.1/test-2.3.sqlite.gz\r\n gunzip test-2.3.sqlite.gz\r\n mv test-2.3.sqlite test23.sqlite\r\n\r\nNow start datasette on port 8018 (the port I exposed earlier) with the extension loaded:\r\n\r\n datasette test23.sqlite -p 8018 -h 0.0.0.0 --load-extension /usr/local/lib/mod_spatialite.so\r\n\r\nNow I can confirm that it worked:\r\n\r\nhttp://localhost:8018/test23-c88bc35?sql=select+ST_AsText%28Geometry%29+from+HighWays+limit+1\r\n\r\n\"test23\"\r\n\r\nIf I run datasette without `--load-extension` I get this:\r\n\r\n datasette test23.sqlite -p 8018 -h 0.0.0.0\r\n\r\n\"test23_and_turn_on_auto-escaping_in_jinja_\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 274578142, "label": "Add --load-extension option to datasette for loading extra SQLite extensions"}, "performed_via_github_app": null}