home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 274578142 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: created_at (date), updated_at (date)

user 1

  • simonw 2

issue 1

  • Add --load-extension option to datasette for loading extra SQLite extensions · 2 ✖

author_association 1

  • OWNER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
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  
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  

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 31.614ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows