home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where author_association = "OWNER" and "updated_at" is on date 2018-05-31 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 6

  • inspect should record column types 4
  • Support table names ending with .json or .csv 3
  • --spatialite option for datasette publish commands 1
  • Extract unit tests for inspect out to test_inspect.py 1
  • datasette publish Dockerfile should use python:3.6-slim-stretch 1
  • Ability to configure SQLite cache_size 1

user 1

  • simonw 11

author_association 1

  • OWNER · 11 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
393610731 https://github.com/simonw/datasette/issues/304#issuecomment-393610731 https://api.github.com/repos/simonw/datasette/issues/304 MDEyOklzc3VlQ29tbWVudDM5MzYxMDczMQ== simonw 9599 2018-05-31T17:29:31Z 2018-05-31T17:30:05Z OWNER

I prototyped this a while ago here https://github.com/simonw/datasette/commit/04476ead53758044a5f272ae8696b63d6703115e before we had the --config mechanism.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to configure SQLite cache_size 328229224  
393600441 https://github.com/simonw/datasette/issues/303#issuecomment-393600441 https://api.github.com/repos/simonw/datasette/issues/303 MDEyOklzc3VlQ29tbWVudDM5MzYwMDQ0MQ== simonw 9599 2018-05-31T16:56:25Z 2018-05-31T16:57:41Z OWNER

Here's a nasty challenge: what happens if a database has the following two tables:

  • blah
  • blah.json

What would the URL be for the JSON endpoint for the blah table?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support table names ending with .json or .csv 328172521  
393599840 https://github.com/simonw/datasette/issues/303#issuecomment-393599840 https://api.github.com/repos/simonw/datasette/issues/303 MDEyOklzc3VlQ29tbWVudDM5MzU5OTg0MA== simonw 9599 2018-05-31T16:54:22Z 2018-05-31T16:54:32Z OWNER

The interesting thing about this is that it requires URL routing to become aware of the names of all of the available tables.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support table names ending with .json or .csv 328172521  
393557968 https://github.com/simonw/datasette/issues/294#issuecomment-393557968 https://api.github.com/repos/simonw/datasette/issues/294 MDEyOklzc3VlQ29tbWVudDM5MzU1Nzk2OA== simonw 9599 2018-05-31T14:55:46Z 2018-05-31T14:55:46Z OWNER

I'm not sure what the best JSON shape for this would be considering the potential complexity of geospatial columns. I do think it's worth exposing these in the inspect JSON though, mainly so Datasette Registry can keep track of all of the openly available geodata out there.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect should record column types 327365110  
393557406 https://github.com/simonw/datasette/issues/303#issuecomment-393557406 https://api.github.com/repos/simonw/datasette/issues/303 MDEyOklzc3VlQ29tbWVudDM5MzU1NzQwNg== simonw 9599 2018-05-31T14:54:03Z 2018-05-31T14:54:03Z OWNER

Our test fixtures currently have a table with a name ending in .csv:

https://github.com/simonw/datasette/blob/d69ebce53385b7c6fafb85fdab3b136dbf3f332c/tests/fixtures.py#L234-L237

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support table names ending with .json or .csv 328172521  
393554151 https://github.com/simonw/datasette/issues/297#issuecomment-393554151 https://api.github.com/repos/simonw/datasette/issues/297 MDEyOklzc3VlQ29tbWVudDM5MzU1NDE1MQ== simonw 9599 2018-05-31T14:44:37Z 2018-05-31T14:44:37Z OWNER

I fixed this in https://github.com/simonw/datasette/commit/b18e4515855c3f1eeca3dfcccdbb6df05869084a

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
datasette publish Dockerfile should use python:3.6-slim-stretch 327420945  
393549215 https://github.com/simonw/datasette/issues/294#issuecomment-393549215 https://api.github.com/repos/simonw/datasette/issues/294 MDEyOklzc3VlQ29tbWVudDM5MzU0OTIxNQ== simonw 9599 2018-05-31T14:29:37Z 2018-05-31T14:29:37Z OWNER

Also of note: spatialite-test uses readable strings in the type column, while timezones has a geometry_type column with integers in it.

Those integers are documented here: https://www.gaia-gis.it/fossil/libspatialite/wiki?name=switching-to-4.0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect should record column types 327365110  
393548602 https://github.com/simonw/datasette/issues/294#issuecomment-393548602 https://api.github.com/repos/simonw/datasette/issues/294 MDEyOklzc3VlQ29tbWVudDM5MzU0ODYwMg== simonw 9599 2018-05-31T14:27:41Z 2018-05-31T14:27:56Z OWNER

Presumably the difference in primary key structure between those two is caused by the fact that the spatialite-test database (actually https://www.gaia-gis.it/spatialite-2.3.1/test-2.3.sqlite.gz downloaded from https://www.gaia-gis.it/spatialite-2.3.1/resources.html ) was created by a much older version of SpatialLite - presumably v2.3.1

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect should record column types 327365110  
393547960 https://github.com/simonw/datasette/issues/294#issuecomment-393547960 https://api.github.com/repos/simonw/datasette/issues/294 MDEyOklzc3VlQ29tbWVudDM5MzU0Nzk2MA== simonw 9599 2018-05-31T14:25:43Z 2018-05-31T14:25:43Z OWNER

SpatialLite columns are actually quite a bit more interesting than this - they also have a geometry_type (point, polygon, linestring etc), a coord_dimension (usually 2 but can be higher) and an srid.

For example:

https://datasette-publish-spatialite-demo.now.sh/spatialite-test-c88bc35/geometry_columns

The SRID here is particularly interesting, because it helps hint at the fact that the results from these queries won't be latitude/longitude co-ordinates - which means that AsGeoJSON() won't return results that can be easily rendered by Leaflet:

https://datasette-publish-spatialite-demo.now.sh/spatialite-test-c88bc35?sql=select+AsGeoJSON(Geometry)+from+HighWays%20limit1

Compare with https://timezones-api.now.sh/timezones-a99b2e3/geometry_columns:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect should record column types 327365110  
393544357 https://github.com/simonw/datasette/issues/243#issuecomment-393544357 https://api.github.com/repos/simonw/datasette/issues/243 MDEyOklzc3VlQ29tbWVudDM5MzU0NDM1Nw== simonw 9599 2018-05-31T14:14:49Z 2018-05-31T14:14:49Z OWNER

Demo: https://datasette-publish-spatialite-demo.now.sh/spatialite-test-c88bc35?sql=select+AsText(Geometry)+from+HighWays+limit+1%3B

Published using datasette publish now --spatialite /tmp/spatialite-test.db

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
--spatialite option for datasette publish commands 318737808  
393534579 https://github.com/simonw/datasette/issues/295#issuecomment-393534579 https://api.github.com/repos/simonw/datasette/issues/295 MDEyOklzc3VlQ29tbWVudDM5MzUzNDU3OQ== simonw 9599 2018-05-31T13:44:15Z 2018-05-31T13:44:15Z OWNER

I actually started doing this in 45e502aace6cc1198cc5f9a04d61b4a1860a012b

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Extract unit tests for inspect out to test_inspect.py 327383759  

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 1038.09ms · About: github-to-sqlite