{"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-345259115", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 345259115, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NTI1OTExNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-17T14:32:12Z", "updated_at": "2017-11-17T14:32:12Z", "author_association": "OWNER", "body": "OK, I can confirm that the version in the new docker container supports FTS5, JSON *and* spatialite!\r\n\r\nNotes on how I built the container and tested the spatialite extension are here: https://github.com/simonw/datasette/issues/112#issuecomment-345255655\r\n\r\nTo confirm that JSON and FTS5 are working, I ran the following:\r\n\r\n $ docker run -it -p 8001:8001 6c9ca7e29181 python\r\n Python 3.6.3 (default, Nov 4 2017, 14:24:48) \r\n [GCC 6.3.0 20170516] on linux\r\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n >>> import sqlite3\r\n >>> sqlite3.connect(':memory:').execute('CREATE VIRTUAL TABLE email USING fts5(sender, title, body);')\r\n \r\n >>> list(sqlite3.connect(':memory:').execute('''SELECT json(' { \"this\" : \"is\", \"a\": [ \"test\" ] } ') '''))\r\n [('{\"this\":\"is\",\"a\":[\"test\"]}',)]\r\n\r\nIf I do the same thing in python3 on my OS X laptop directly, I get this:\r\n\r\n $ python3\r\n Python 3.5.1 (default, Apr 18 2016, 11:46:32) \r\n [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin\r\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n >>> import sqlite3\r\n >>> sqlite3.connect(':memory:').execute('CREATE VIRTUAL TABLE email USING fts5(sender, title, body);')\r\n Traceback (most recent call last):\r\n File \"\", line 1, in \r\n sqlite3.OperationalError: no such module: fts5\r\n >>> list(sqlite3.connect(':memory:').execute('''SELECT json(' { \"this\" : \"is\", \"a\": [ \"test\" ] } ') '''))\r\n Traceback (most recent call last):\r\n File \"\", line 1, in \r\n sqlite3.OperationalError: no such function: json\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-345138347", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 345138347, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NTEzODM0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-17T03:52:25Z", "updated_at": "2017-11-17T03:52:25Z", "author_association": "OWNER", "body": "We now have a Dockerfile that compiles spatialite! https://github.com/simonw/datasette/pull/114/commits/6c6b63d890529eeefcefb7ab126ea3bd7b2315c1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-345002908", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 345002908, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NTAwMjkwOA==", "user": {"value": 54999, "label": "ingenieroariel"}, "created_at": "2017-11-16T17:47:49Z", "updated_at": "2017-11-16T17:47:49Z", "author_association": "CONTRIBUTOR", "body": "I'll try to find alternatives to the Dockerfile option - I also think we should not use that old one without sources or license.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344995571", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344995571, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk5NTU3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T17:22:32Z", "updated_at": "2017-11-16T17:22:32Z", "author_association": "OWNER", "body": "The JSON extension would be very worthwhile too: https://www.sqlite.org/json1.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344989340", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344989340, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk4OTM0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T17:02:07Z", "updated_at": "2017-11-16T17:02:07Z", "author_association": "OWNER", "body": "The fact that `prolocutor/python3-sqlite-ext` doesn't provide a visible Dockerfile and hasn't been updated in two years makes me hesitant to bake it into datasette itself. I'd rather put together a Dockerfile that enables the necessary extensions and can live in the datasette repository itself.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344988591", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344988591, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk4ODU5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T16:59:51Z", "updated_at": "2017-11-16T16:59:51Z", "author_association": "OWNER", "body": "OK, `--load-extension` is now a supported command line option - see #110 which includes my notes on how I manually tested it using the `prolocutor/python3-sqlite-ext` Docker image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344976882", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344976882, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk3Njg4Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T16:25:07Z", "updated_at": "2017-11-16T16:25:07Z", "author_association": "OWNER", "body": "Maybe part of the solution here is to add a `--load-extension` argument to `datasette` - so when you run the command you can specify SQLite extensions that should be loaded. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344976104", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344976104, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk3NjEwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T16:22:45Z", "updated_at": "2017-11-16T16:22:45Z", "author_association": "OWNER", "body": "Found a relevant Dockerfile on Reddit: https://www.reddit.com/r/Python/comments/5unkb3/install_sqlite3_on_python_3/ddzdz2b/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344975156", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344975156, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDk3NTE1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-16T16:19:44Z", "updated_at": "2017-11-16T16:19:44Z", "author_association": "OWNER", "body": "That's fantastic! Thank you very much for that. \r\n\r\nDo you know if it's possible to view the Dockerfile used by https://hub.docker.com/r/prolocutor/python3-sqlite-ext/ ?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344810525", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344810525, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDgxMDUyNQ==", "user": {"value": 54999, "label": "ingenieroariel"}, "created_at": "2017-11-16T04:11:25Z", "updated_at": "2017-11-16T04:11:25Z", "author_association": "CONTRIBUTOR", "body": "@simonw On the spatialite support, here is some info to make it work and a screenshot:\r\n\r\n\"screen\r\n\r\nI used the following Dockerfile:\r\n```\r\nFROM prolocutor/python3-sqlite-ext:3.5.1-spatialite as build\r\n\r\nRUN mkdir /code\r\nADD . /code/\r\n\r\nRUN pip install /code/\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\", \"serve\", \"/code/ne.sqlite\", \"--host\", \"0.0.0.0\"]\r\n```\r\n\r\nand added this to `prepare_connection`:\r\n```\r\n conn.enable_load_extension(True)\r\n conn.execute(\"SELECT load_extension('/usr/local/lib/mod_spatialite.so')\")\r\n```", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 1, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344161430", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344161430, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDE2MTQzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-14T06:42:44Z", "updated_at": "2017-11-14T06:42:44Z", "author_association": "OWNER", "body": "Also requested on Twitter: https://twitter.com/DenubisX/status/930322813864439808", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344161371", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344161371, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDE2MTM3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-14T06:42:15Z", "updated_at": "2017-11-14T06:42:15Z", "author_association": "OWNER", "body": "http://charlesleifer.com/blog/going-fast-with-sqlite-and-python/ is useful here too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/46#issuecomment-344161226", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/46", "id": 344161226, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NDE2MTIyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-14T06:41:21Z", "updated_at": "2017-11-14T06:41:21Z", "author_association": "OWNER", "body": "Spatial extensions would be really useful too. https://www.gaia-gis.it/spatialite-2.1/SpatiaLite-manual.html", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 271301468, "label": "Dockerfile should build more recent SQLite with FTS5 and spatialite support"}, "performed_via_github_app": null}