home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

16 rows where author_association = "OWNER" and "updated_at" is on date 2017-11-16 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: issue_url, created_at (date), updated_at (date)

issue 8

  • Dockerfile should build more recent SQLite with FTS5 and spatialite support 6
  • UI for editing named parameters 3
  • Add --load-extension option to datasette for loading extra SQLite extensions 2
  • Datasette Plugins 1
  • TemplateAssertionError: no filter named 'tojson' 1
  • add support for ?field__isnull=1 1
  • Set up readthedocs 1
  • Add “updated” to metadata 1

user 1

  • simonw 16

author_association 1

  • OWNER · 16 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
345067498 https://github.com/simonw/datasette/issues/14#issuecomment-345067498 https://api.github.com/repos/simonw/datasette/issues/14 MDEyOklzc3VlQ29tbWVudDM0NTA2NzQ5OA== simonw 9599 2017-11-16T21:25:32Z 2017-11-16T21:26:22Z OWNER

For visualizations, Google Maps should be made available as a plugin. The default visualizations can use Leaflet and Open Street Map, but there's no reason to not make Google Maps available as a plugin, especially if the plugin can provide a mechanism for configuring the necessary API key.

I'm particularly excited in the Google Maps heatmap visualization https://developers.google.com/maps/documentation/javascript/heatmaplayer as seen on http://mochimachine.org/wasteland/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette Plugins 267707940  
345017256 https://github.com/simonw/datasette/issues/110#issuecomment-345017256 https://api.github.com/repos/simonw/datasette/issues/110 MDEyOklzc3VlQ29tbWVudDM0NTAxNzI1Ng== simonw 9599 2017-11-16T18:38:30Z 2017-11-16T18:38:30Z OWNER

To finish up, I committed the image I created in the above so I can run it again in the future:

docker commit $(docker ps -lq) datasette-sqlite

Now I can run it like this:

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
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add --load-extension option to datasette for loading extra SQLite extensions 274578142  
345013127 https://github.com/simonw/datasette/issues/111#issuecomment-345013127 https://api.github.com/repos/simonw/datasette/issues/111 MDEyOklzc3VlQ29tbWVudDM0NTAxMzEyNw== simonw 9599 2017-11-16T18:23:56Z 2017-11-16T18:23:56Z OWNER

Having this as a global option may not make sense when publishing multiple databases. We can revisit that when we implement per-database and per-table metadata.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add “updated” to metadata 274615452  
344995571 https://github.com/simonw/datasette/issues/46#issuecomment-344995571 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk5NTU3MQ== simonw 9599 2017-11-16T17:22:32Z 2017-11-16T17:22:32Z OWNER

The JSON extension would be very worthwhile too: https://www.sqlite.org/json1.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344989340 https://github.com/simonw/datasette/issues/46#issuecomment-344989340 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk4OTM0MA== simonw 9599 2017-11-16T17:02:07Z 2017-11-16T17:02:07Z OWNER

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.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344988591 https://github.com/simonw/datasette/issues/46#issuecomment-344988591 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk4ODU5MQ== simonw 9599 2017-11-16T16:59:51Z 2017-11-16T16:59:51Z OWNER

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.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344988263 https://github.com/simonw/datasette/issues/110#issuecomment-344988263 https://api.github.com/repos/simonw/datasette/issues/110 MDEyOklzc3VlQ29tbWVudDM0NDk4ODI2Mw== simonw 9599 2017-11-16T16:58:48Z 2017-11-16T16:58:48Z OWNER

Here's how I tested this.

First 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.

docker run -it -p 8018:8018 prolocutor/python3-sqlite-ext:3.5.1-spatialite /bin/sh

Installed a pre-release build of datasette which includes the new --load-extension option.

pip install https://static.simonwillison.net/static/2017/datasette-0.13-py3-none-any.whl

Now 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):

wget http://www.gaia-gis.it/spatialite-2.3.1/test-2.3.sqlite.gz
gunzip test-2.3.sqlite.gz
mv test-2.3.sqlite test23.sqlite

Now start datasette on port 8018 (the port I exposed earlier) with the extension loaded:

datasette test23.sqlite  -p 8018 -h 0.0.0.0 --load-extension /usr/local/lib/mod_spatialite.so

Now I can confirm that it worked:

http://localhost:8018/test23-c88bc35?sql=select+ST_AsText%28Geometry%29+from+HighWays+limit+1

If I run datasette without --load-extension I get this:

datasette test23.sqlite  -p 8018 -h 0.0.0.0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add --load-extension option to datasette for loading extra SQLite extensions 274578142  
344986423 https://github.com/simonw/datasette/issues/109#issuecomment-344986423 https://api.github.com/repos/simonw/datasette/issues/109 MDEyOklzc3VlQ29tbWVudDM0NDk4NjQyMw== simonw 9599 2017-11-16T16:53:26Z 2017-11-16T16:53:26Z OWNER

http://datasette.readthedocs.io/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Set up readthedocs 274378301  
344976882 https://github.com/simonw/datasette/issues/46#issuecomment-344976882 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk3Njg4Mg== simonw 9599 2017-11-16T16:25:07Z 2017-11-16T16:25:07Z OWNER

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.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344976104 https://github.com/simonw/datasette/issues/46#issuecomment-344976104 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk3NjEwNA== simonw 9599 2017-11-16T16:22:45Z 2017-11-16T16:22:45Z OWNER

Found a relevant Dockerfile on Reddit: https://www.reddit.com/r/Python/comments/5unkb3/install_sqlite3_on_python_3/ddzdz2b/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344975156 https://github.com/simonw/datasette/issues/46#issuecomment-344975156 https://api.github.com/repos/simonw/datasette/issues/46 MDEyOklzc3VlQ29tbWVudDM0NDk3NTE1Ng== simonw 9599 2017-11-16T16:19:44Z 2017-11-16T16:19:44Z OWNER

That's fantastic! Thank you very much for that.

Do you know if it's possible to view the Dockerfile used by https://hub.docker.com/r/prolocutor/python3-sqlite-ext/ ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Dockerfile should build more recent SQLite with FTS5 and spatialite support 271301468  
344788763 https://github.com/simonw/datasette/issues/96#issuecomment-344788763 https://api.github.com/repos/simonw/datasette/issues/96 MDEyOklzc3VlQ29tbWVudDM0NDc4ODc2Mw== simonw 9599 2017-11-16T01:45:51Z 2017-11-16T01:45:51Z OWNER

Another demo - this time it lets you search by name and see the most popular breeds with that name: https://australian-dogs.now.sh/australian-dogs-3ba9628?sql=select+breed%2C+count%28*%29+as+n+from+%28%0D%0A%0D%0Aselect+upper%28%22Breed%22%29+as+breed+from+%5BAdelaide-City-Council-dog-registrations-2013%5D+where+%22Animal+name%22+like+%3Aname%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22Breed_Description%22%29+as+breed+from+%5BAdelaide-City-Council-dog-registrations-2014%5D+where+%22Animal_Name%22+like+%3Aname%0D%0A%0D%0Aunion+all+%0D%0A%0D%0Aselect+upper%28%22Breed_Description%22%29+as+breed+from+%5BAdelaide-City-Council-dog-registrations-2015%5D+where+%22Animal_Name%22+like+%3Aname%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22AnimalBreed%22%29+as+breed+from+%5BCity-of-Port-Adelaide-Enfield-Dog_Registrations_2016%5D+where+%22AnimalName%22+like+%3Aname%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22Breed%22%29+as+breed+from+%5BMitcham-dog-registrations-2015%5D+where+%22Animal+Name%22+like+%3Aname%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22DOG_BREED%22%29+as+breed+from+%5Bburnside-dog-registrations-2015%5D+where+%22DOG_NAME%22+like+%3Aname%0D%0A%0D%0Aunion+all+%0D%0A%0D%0Aselect+upper%28%22Breed_Description%22%29+as+breed+from+%5Bcity-of-playford-2015-dog-registration%5D+where+%22Animal_Name%22+like+%3Aname%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22Breed+Description%22%29+as+breed+from+%5Bcity-of-prospect-dog-registration-details-2016%5D+where+%22Animal+Name%22+like+%3Aname%0D%0A%0D%0A%29+group+by+breed+order+by+n+desc%3B&name=rex

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
UI for editing named parameters 274001453  
344788435 https://github.com/simonw/datasette/issues/96#issuecomment-344788435 https://api.github.com/repos/simonw/datasette/issues/96 MDEyOklzc3VlQ29tbWVudDM0NDc4ODQzNQ== simonw 9599 2017-11-16T01:43:52Z 2017-11-16T01:43:52Z OWNER

Demo: https://australian-dogs.now.sh/australian-dogs-3ba9628?sql=select+name%2C+count%28*%29+as+n+from+%28%0D%0A%0D%0Aselect+upper%28%22Animal+name%22%29+as+name+from+%5BAdelaide-City-Council-dog-registrations-2013%5D+where+Breed+like+%3Abreed%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28Animal_Name%29+as+name+from+%5BAdelaide-City-Council-dog-registrations-2014%5D+where+Breed_Description+like+%3Abreed%0D%0A%0D%0Aunion+all+%0D%0A%0D%0Aselect+upper%28Animal_Name%29+as+name+from+%5BAdelaide-City-Council-dog-registrations-2015%5D+where+Breed_Description+like+%3Abreed%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22AnimalName%22%29+as+name+from+%5BCity-of-Port-Adelaide-Enfield-Dog_Registrations_2016%5D+where+AnimalBreed+like+%3Abreed%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22Animal+Name%22%29+as+name+from+%5BMitcham-dog-registrations-2015%5D+where+Breed+like+%3Abreed%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22DOG_NAME%22%29+as+name+from+%5Bburnside-dog-registrations-2015%5D+where+DOG_BREED+like+%3Abreed%0D%0A%0D%0Aunion+all+%0D%0A%0D%0Aselect+upper%28%22Animal_Name%22%29+as+name+from+%5Bcity-of-playford-2015-dog-registration%5D+where+Breed_Description+like+%3Abreed%0D%0A%0D%0Aunion+all%0D%0A%0D%0Aselect+upper%28%22Animal+Name%22%29+as+name+from+%5Bcity-of-prospect-dog-registration-details-2016%5D+where%22Breed+Description%22+like+%3Abreed%0D%0A%0D%0A%29+group+by+name+order+by+n+desc%3B&breed=chihuahua

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
UI for editing named parameters 274001453  
344786528 https://github.com/simonw/datasette/issues/96#issuecomment-344786528 https://api.github.com/repos/simonw/datasette/issues/96 MDEyOklzc3VlQ29tbWVudDM0NDc4NjUyOA== simonw 9599 2017-11-16T01:32:41Z 2017-11-16T01:32:41Z OWNER

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
UI for editing named parameters 274001453  
344771130 https://github.com/simonw/datasette/issues/100#issuecomment-344771130 https://api.github.com/repos/simonw/datasette/issues/100 MDEyOklzc3VlQ29tbWVudDM0NDc3MTEzMA== simonw 9599 2017-11-16T00:06:00Z 2017-11-16T00:06:00Z OWNER

Aha... it looks like this is a Jinja version problem: https://github.com/ansible/ansible/issues/25381#issuecomment-306492389

Datasette depends on sanic-jinja2 - and that doesn't depend on a particular jinja2 version: https://github.com/lixxu/sanic-jinja2/blob/7e9520850d8c6bb66faf43b7f252593d7efe3452/setup.py#L22

So if you have an older version of Jinja installed, stuff breaks.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
TemplateAssertionError: no filter named 'tojson' 274160723  
344770170 https://github.com/simonw/datasette/pull/107#issuecomment-344770170 https://api.github.com/repos/simonw/datasette/issues/107 MDEyOklzc3VlQ29tbWVudDM0NDc3MDE3MA== simonw 9599 2017-11-16T00:01:00Z 2017-11-16T00:01:22Z OWNER

It is - but I think this will break on this line since it expects two format string parameters:

https://github.com/simonw/datasette/blob/f45ca30f91b92ac68adaba893bf034f13ec61ced/datasette/utils.py#L61

Needs unit tests too, which live here: https://github.com/simonw/datasette/blob/f45ca30f91b92ac68adaba893bf034f13ec61ced/tests/test_utils.py#L49

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
add support for ?field__isnull=1 274343647  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 509.645ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows