{"action":"closed","number":280,"pull_request":{"url":"https://api.github.com/repos/simonw/datasette/pulls/280","id":189723716,"html_url":"https://github.com/simonw/datasette/pull/280","diff_url":"https://github.com/simonw/datasette/pull/280.diff","patch_url":"https://github.com/simonw/datasette/pull/280.patch","issue_url":"https://api.github.com/repos/simonw/datasette/issues/280","number":280,"state":"closed","locked":false,"title":"Build Dockerfile with recent Sqlite + Spatialite","user":{"login":"r4vi","id":565628,"avatar_url":"https://avatars1.githubusercontent.com/u/565628?v=4","gravatar_id":"","url":"https://api.github.com/users/r4vi","html_url":"https://github.com/r4vi","followers_url":"https://api.github.com/users/r4vi/followers","following_url":"https://api.github.com/users/r4vi/following{/other_user}","gists_url":"https://api.github.com/users/r4vi/gists{/gist_id}","starred_url":"https://api.github.com/users/r4vi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r4vi/subscriptions","organizations_url":"https://api.github.com/users/r4vi/orgs","repos_url":"https://api.github.com/users/r4vi/repos","events_url":"https://api.github.com/users/r4vi/events{/privacy}","received_events_url":"https://api.github.com/users/r4vi/received_events","type":"User","site_admin":false},"body":"This solves #278 without bloating the Dockerfile too much, the image size is now\r\n495MB (original was ~240MB) but it could be reduced significantly if we only\r\ncopied the output of the compilation of spatialite and friends to\r\n/usr/local/lib, instead of the entirety of it however that will take more time.\r\n\r\nIn the python code change references to `import sqlite3` to `import pysqlite3`\r\nand it should use the compiled version of sqlite3.23.1. You don't need to\r\ntry/except because pysqlite3 falls back to builtin sqlite3 if there is no\r\ncompiled version.\r\n\r\n```bash\r\n  $ docker run --rm -it datasette spatialite\r\n  SpatiaLite version ..: 4.4.0-RC0\tSupported Extensions:\r\n    - 'VirtualShape'\t[direct Shapefile access]\r\n    - 'VirtualDbf'\t\t[direct DBF access]\r\n    - 'VirtualXL'\t\t[direct XLS access]\r\n    - 'VirtualText'\t\t[direct CSV/TXT access]\r\n    - 'VirtualNetwork'\t[Dijkstra shortest path]\r\n    - 'RTree'\t\t[Spatial Index - R*Tree]\r\n    - 'MbrCache'\t\t[Spatial Index - MBR cache]\r\n    - 'VirtualSpatialIndex'\t[R*Tree metahandler]\r\n    - 'VirtualElementary'\t[ElemGeoms metahandler]\r\n    - 'VirtualKNN'\t[K-Nearest Neighbors metahandler]\r\n    - 'VirtualXPath'\t[XML Path Language - XPath]\r\n    - 'VirtualFDO'\t\t[FDO-OGR interoperability]\r\n    - 'VirtualGPKG'\t[OGC GeoPackage interoperability]\r\n    - 'VirtualBBox'\t\t[BoundingBox tables]\r\n    - 'SpatiaLite'\t\t[Spatial SQL - OGC]\r\n  PROJ.4 version ......: Rel. 4.9.3, 15 August 2016\r\n  GEOS version ........: 3.5.1-CAPI-1.9.1 r4246\r\n  TARGET CPU ..........: x86_64-linux-gnu\r\n  the SPATIAL_REF_SYS table already contains some row(s)\r\n  SQLite version ......: 3.23.1\r\n  Enter \".help\" for instructions\r\n  SQLite version 3.23.1 2018-04-10 17:39:29\r\n  Enter \".help\" for instructions\r\n  Enter SQL statements terminated with a \";\"\r\n  spatialite>\r\n```\r\n\r\n```bash\r\n$ docker run --rm -it datasette python -c \"import pysqlite3; print(pysqlite3.sqlite_version)\"\r\n3.23.1\r\n```","created_at":"2018-05-22T16:33:50Z","updated_at":"2018-05-23T17:43:35Z","closed_at":"2018-05-23T17:43:35Z","merged_at":"2018-05-23T17:43:35Z","merge_commit_sha":"bd30c696e18927207358ee9d63174a5c41c8297e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/simonw/datasette/pulls/280/commits","review_comments_url":"https://api.github.com/repos/simonw/datasette/pulls/280/comments","review_comment_url":"https://api.github.com/repos/simonw/datasette/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simonw/datasette/issues/280/comments","statuses_url":"https://api.github.com/repos/simonw/datasette/statuses/5cf78eded61cacec435b854e18f1e94511cf2da8","head":{"label":"r4vi:dockerfile-updated-spatialite-and-sqlite","ref":"dockerfile-updated-spatialite-and-sqlite","sha":"5cf78eded61cacec435b854e18f1e94511cf2da8","user":{"login":"r4vi","id":565628,"avatar_url":"https://avatars1.githubusercontent.com/u/565628?v=4","gravatar_id":"","url":"https://api.github.com/users/r4vi","html_url":"https://github.com/r4vi","followers_url":"https://api.github.com/users/r4vi/followers","following_url":"https://api.github.com/users/r4vi/following{/other_user}","gists_url":"https://api.github.com/users/r4vi/gists{/gist_id}","starred_url":"https://api.github.com/users/r4vi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r4vi/subscriptions","organizations_url":"https://api.github.com/users/r4vi/orgs","repos_url":"https://api.github.com/users/r4vi/repos","events_url":"https://api.github.com/users/r4vi/events{/privacy}","received_events_url":"https://api.github.com/users/r4vi/received_events","type":"User","site_admin":false},"repo":{"id":134421885,"name":"datasette","full_name":"r4vi/datasette","owner":{"login":"r4vi","id":565628,"avatar_url":"https://avatars1.githubusercontent.com/u/565628?v=4","gravatar_id":"","url":"https://api.github.com/users/r4vi","html_url":"https://github.com/r4vi","followers_url":"https://api.github.com/users/r4vi/followers","following_url":"https://api.github.com/users/r4vi/following{/other_user}","gists_url":"https://api.github.com/users/r4vi/gists{/gist_id}","starred_url":"https://api.github.com/users/r4vi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r4vi/subscriptions","organizations_url":"https://api.github.com/users/r4vi/orgs","repos_url":"https://api.github.com/users/r4vi/repos","events_url":"https://api.github.com/users/r4vi/events{/privacy}","received_events_url":"https://api.github.com/users/r4vi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/r4vi/datasette","description":"Instantly publish structured data to the internet with a JSON API","fork":true,"url":"https://api.github.com/repos/r4vi/datasette","forks_url":"https://api.github.com/repos/r4vi/datasette/forks","keys_url":"https://api.github.com/repos/r4vi/datasette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/r4vi/datasette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/r4vi/datasette/teams","hooks_url":"https://api.github.com/repos/r4vi/datasette/hooks","issue_events_url":"https://api.github.com/repos/r4vi/datasette/issues/events{/number}","events_url":"https://api.github.com/repos/r4vi/datasette/events","assignees_url":"https://api.github.com/repos/r4vi/datasette/assignees{/user}","branches_url":"https://api.github.com/repos/r4vi/datasette/branches{/branch}","tags_url":"https://api.github.com/repos/r4vi/datasette/tags","blobs_url":"https://api.github.com/repos/r4vi/datasette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/r4vi/datasette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/r4vi/datasette/git/refs{/sha}","trees_url":"https://api.github.com/repos/r4vi/datasette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/r4vi/datasette/statuses/{sha}","languages_url":"https://api.github.com/repos/r4vi/datasette/languages","stargazers_url":"https://api.github.com/repos/r4vi/datasette/stargazers","contributors_url":"https://api.github.com/repos/r4vi/datasette/contributors","subscribers_url":"https://api.github.com/repos/r4vi/datasette/subscribers","subscription_url":"https://api.github.com/repos/r4vi/datasette/subscription","commits_url":"https://api.github.com/repos/r4vi/datasette/commits{/sha}","git_commits_url":"https://api.github.com/repos/r4vi/datasette/git/commits{/sha}","comments_url":"https://api.github.com/repos/r4vi/datasette/comments{/number}","issue_comment_url":"https://api.github.com/repos/r4vi/datasette/issues/comments{/number}","contents_url":"https://api.github.com/repos/r4vi/datasette/contents/{+path}","compare_url":"https://api.github.com/repos/r4vi/datasette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/r4vi/datasette/merges","archive_url":"https://api.github.com/repos/r4vi/datasette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/r4vi/datasette/downloads","issues_url":"https://api.github.com/repos/r4vi/datasette/issues{/number}","pulls_url":"https://api.github.com/repos/r4vi/datasette/pulls{/number}","milestones_url":"https://api.github.com/repos/r4vi/datasette/milestones{/number}","notifications_url":"https://api.github.com/repos/r4vi/datasette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/r4vi/datasette/labels{/name}","releases_url":"https://api.github.com/repos/r4vi/datasette/releases{/id}","deployments_url":"https://api.github.com/repos/r4vi/datasette/deployments","created_at":"2018-05-22T13:47:19Z","updated_at":"2018-05-22T13:47:21Z","pushed_at":"2018-05-23T09:49:45Z","git_url":"git://github.com/r4vi/datasette.git","ssh_url":"git@github.com:r4vi/datasette.git","clone_url":"https://github.com/r4vi/datasette.git","svn_url":"https://github.com/r4vi/datasette","homepage":"https://simonwillison.net/2017/Nov/13/datasette/","size":956,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"simonw:master","ref":"master","sha":"58b5a37dbbf13868a46bcbb284509434e66eca25","user":{"login":"simonw","id":9599,"avatar_url":"https://avatars0.githubusercontent.com/u/9599?v=4","gravatar_id":"","url":"https://api.github.com/users/simonw","html_url":"https://github.com/simonw","followers_url":"https://api.github.com/users/simonw/followers","following_url":"https://api.github.com/users/simonw/following{/other_user}","gists_url":"https://api.github.com/users/simonw/gists{/gist_id}","starred_url":"https://api.github.com/users/simonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonw/subscriptions","organizations_url":"https://api.github.com/users/simonw/orgs","repos_url":"https://api.github.com/users/simonw/repos","events_url":"https://api.github.com/users/simonw/events{/privacy}","received_events_url":"https://api.github.com/users/simonw/received_events","type":"User","site_admin":false},"repo":{"id":107914493,"name":"datasette","full_name":"simonw/datasette","owner":{"login":"simonw","id":9599,"avatar_url":"https://avatars0.githubusercontent.com/u/9599?v=4","gravatar_id":"","url":"https://api.github.com/users/simonw","html_url":"https://github.com/simonw","followers_url":"https://api.github.com/users/simonw/followers","following_url":"https://api.github.com/users/simonw/following{/other_user}","gists_url":"https://api.github.com/users/simonw/gists{/gist_id}","starred_url":"https://api.github.com/users/simonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonw/subscriptions","organizations_url":"https://api.github.com/users/simonw/orgs","repos_url":"https://api.github.com/users/simonw/repos","events_url":"https://api.github.com/users/simonw/events{/privacy}","received_events_url":"https://api.github.com/users/simonw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simonw/datasette","description":"Instantly publish structured data to the internet with a JSON API","fork":false,"url":"https://api.github.com/repos/simonw/datasette","forks_url":"https://api.github.com/repos/simonw/datasette/forks","keys_url":"https://api.github.com/repos/simonw/datasette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simonw/datasette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simonw/datasette/teams","hooks_url":"https://api.github.com/repos/simonw/datasette/hooks","issue_events_url":"https://api.github.com/repos/simonw/datasette/issues/events{/number}","events_url":"https://api.github.com/repos/simonw/datasette/events","assignees_url":"https://api.github.com/repos/simonw/datasette/assignees{/user}","branches_url":"https://api.github.com/repos/simonw/datasette/branches{/branch}","tags_url":"https://api.github.com/repos/simonw/datasette/tags","blobs_url":"https://api.github.com/repos/simonw/datasette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simonw/datasette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simonw/datasette/git/refs{/sha}","trees_url":"https://api.github.com/repos/simonw/datasette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simonw/datasette/statuses/{sha}","languages_url":"https://api.github.com/repos/simonw/datasette/languages","stargazers_url":"https://api.github.com/repos/simonw/datasette/stargazers","contributors_url":"https://api.github.com/repos/simonw/datasette/contributors","subscribers_url":"https://api.github.com/repos/simonw/datasette/subscribers","subscription_url":"https://api.github.com/repos/simonw/datasette/subscription","commits_url":"https://api.github.com/repos/simonw/datasette/commits{/sha}","git_commits_url":"https://api.github.com/repos/simonw/datasette/git/commits{/sha}","comments_url":"https://api.github.com/repos/simonw/datasette/comments{/number}","issue_comment_url":"https://api.github.com/repos/simonw/datasette/issues/comments{/number}","contents_url":"https://api.github.com/repos/simonw/datasette/contents/{+path}","compare_url":"https://api.github.com/repos/simonw/datasette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simonw/datasette/merges","archive_url":"https://api.github.com/repos/simonw/datasette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simonw/datasette/downloads","issues_url":"https://api.github.com/repos/simonw/datasette/issues{/number}","pulls_url":"https://api.github.com/repos/simonw/datasette/pulls{/number}","milestones_url":"https://api.github.com/repos/simonw/datasette/milestones{/number}","notifications_url":"https://api.github.com/repos/simonw/datasette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simonw/datasette/labels{/name}","releases_url":"https://api.github.com/repos/simonw/datasette/releases{/id}","deployments_url":"https://api.github.com/repos/simonw/datasette/deployments","created_at":"2017-10-23T00:39:03Z","updated_at":"2018-05-23T14:00:51Z","pushed_at":"2018-05-23T17:43:34Z","git_url":"git://github.com/simonw/datasette.git","ssh_url":"git@github.com:simonw/datasette.git","clone_url":"https://github.com/simonw/datasette.git","svn_url":"https://github.com/simonw/datasette","homepage":"https://simonwillison.net/2017/Nov/13/datasette/","size":976,"stargazers_count":1579,"watchers_count":1579,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"archived":false,"open_issues_count":84,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":72,"open_issues":84,"watchers":1579,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simonw/datasette/pulls/280"},"html":{"href":"https://github.com/simonw/datasette/pull/280"},"issue":{"href":"https://api.github.com/repos/simonw/datasette/issues/280"},"comments":{"href":"https://api.github.com/repos/simonw/datasette/issues/280/comments"},"review_comments":{"href":"https://api.github.com/repos/simonw/datasette/pulls/280/comments"},"review_comment":{"href":"https://api.github.com/repos/simonw/datasette/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simonw/datasette/pulls/280/commits"},"statuses":{"href":"https://api.github.com/repos/simonw/datasette/statuses/5cf78eded61cacec435b854e18f1e94511cf2da8"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"simonw","id":9599,"avatar_url":"https://avatars0.githubusercontent.com/u/9599?v=4","gravatar_id":"","url":"https://api.github.com/users/simonw","html_url":"https://github.com/simonw","followers_url":"https://api.github.com/users/simonw/followers","following_url":"https://api.github.com/users/simonw/following{/other_user}","gists_url":"https://api.github.com/users/simonw/gists{/gist_id}","starred_url":"https://api.github.com/users/simonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonw/subscriptions","organizations_url":"https://api.github.com/users/simonw/orgs","repos_url":"https://api.github.com/users/simonw/repos","events_url":"https://api.github.com/users/simonw/events{/privacy}","received_events_url":"https://api.github.com/users/simonw/received_events","type":"User","site_admin":false},"comments":8,"review_comments":6,"maintainer_can_modify":false,"commits":2,"additions":27,"deletions":6,"changed_files":2}}
{"actor":{"display_login":"simonw"}}