home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

17 rows where "created_at" is on date 2017-10-24 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

  • Addressable pages for every row in a table 4
  • Support Django-style filters in querystring arguments 4
  • Implement sensible query pagination 2
  • Initial test suite 2
  • Implement full URL design 2
  • Framework where by every page is JSON plus a template 1
  • In development mode, should still pick up new .db files 1
  • Handle bytestring records encoding to JSON 1

user 1

  • simonw 17

author_association 1

  • OWNER 17
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
338854988 https://github.com/simonw/datasette/issues/23#issuecomment-338854988 https://api.github.com/repos/simonw/datasette/issues/23 MDEyOklzc3VlQ29tbWVudDMzODg1NDk4OA== simonw 9599 2017-10-24T02:40:12Z 2017-10-25T00:05:46Z OWNER
/database-name/table-name?name__contains=simon&sort=id+desc

Note that if there's a column called "sort" you can still do sort__exact=blah

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support Django-style filters in querystring arguments 267788884  
339138809 https://github.com/simonw/datasette/issues/23#issuecomment-339138809 https://api.github.com/repos/simonw/datasette/issues/23 MDEyOklzc3VlQ29tbWVudDMzOTEzODgwOQ== simonw 9599 2017-10-24T21:32:46Z 2017-10-24T21:32:46Z OWNER

May as well support most of https://sqlite.org/lang_expr.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support Django-style filters in querystring arguments 267788884  
339028979 https://github.com/simonw/datasette/issues/5#issuecomment-339028979 https://api.github.com/repos/simonw/datasette/issues/5 MDEyOklzc3VlQ29tbWVudDMzOTAyODk3OQ== simonw 9599 2017-10-24T15:25:08Z 2017-10-24T15:25:08Z OWNER

Looks like I can use the SQLite specific “rowid” in that case. It isn’t guaranteed to stay consistent across a VACUUM but that’s ok because we are immutable anyway.

https://www.sqlite.org/lang_createtable.html#rowid

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Implement sensible query pagination 267516066  
339027711 https://github.com/simonw/datasette/issues/5#issuecomment-339027711 https://api.github.com/repos/simonw/datasette/issues/5 MDEyOklzc3VlQ29tbWVudDMzOTAyNzcxMQ== simonw 9599 2017-10-24T15:21:30Z 2017-10-24T15:21:30Z OWNER

I have code to detect primary keys on tables... but what should I do for tables that lack primary keys? How should I even sort them?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Implement sensible query pagination 267516066  
339019873 https://github.com/simonw/datasette/issues/29#issuecomment-339019873 https://api.github.com/repos/simonw/datasette/issues/29 MDEyOklzc3VlQ29tbWVudDMzOTAxOTg3Mw== simonw 9599 2017-10-24T14:58:33Z 2017-10-24T14:58:33Z OWNER

Here's what I've got now:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Handle bytestring records encoding to JSON 268050821  
339003850 https://github.com/simonw/datasette/issues/24#issuecomment-339003850 https://api.github.com/repos/simonw/datasette/issues/24 MDEyOklzc3VlQ29tbWVudDMzOTAwMzg1MA== simonw 9599 2017-10-24T14:12:00Z 2017-10-24T14:12:00Z OWNER

As of b46e370ee6126aa2fa85cf789a31da38aed98496 this is done.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Implement full URL design 267828746  
338882207 https://github.com/simonw/datasette/issues/1#issuecomment-338882207 https://api.github.com/repos/simonw/datasette/issues/1 MDEyOklzc3VlQ29tbWVudDMzODg4MjIwNw== simonw 9599 2017-10-24T05:56:04Z 2017-10-24T05:56:04Z OWNER

Next step: generate links to these.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Addressable pages for every row in a table 267513424  
338882110 https://github.com/simonw/datasette/issues/9#issuecomment-338882110 https://api.github.com/repos/simonw/datasette/issues/9 MDEyOklzc3VlQ29tbWVudDMzODg4MjExMA== simonw 9599 2017-10-24T05:55:33Z 2017-10-24T05:55:33Z OWNER

Well, I've started it at least.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Initial test suite 267517348  
338872286 https://github.com/simonw/datasette/issues/1#issuecomment-338872286 https://api.github.com/repos/simonw/datasette/issues/1 MDEyOklzc3VlQ29tbWVudDMzODg3MjI4Ng== simonw 9599 2017-10-24T04:46:06Z 2017-10-24T04:46:06Z OWNER

I'm going to use , as the separator between elements of a compound primary key. If those elements themselves include a comma I will use %2C in its place.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Addressable pages for every row in a table 267513424  
338863155 https://github.com/simonw/datasette/issues/9#issuecomment-338863155 https://api.github.com/repos/simonw/datasette/issues/9 MDEyOklzc3VlQ29tbWVudDMzODg2MzE1NQ== simonw 9599 2017-10-24T03:36:58Z 2017-10-24T03:36:58Z OWNER

I’m going to use py.test and start with all tests in a single tests.py module

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Initial test suite 267517348  
338861511 https://github.com/simonw/datasette/issues/1#issuecomment-338861511 https://api.github.com/repos/simonw/datasette/issues/1 MDEyOklzc3VlQ29tbWVudDMzODg2MTUxMQ== simonw 9599 2017-10-24T03:24:17Z 2017-10-24T03:24:17Z OWNER

Some tables won't have primary keys, in which case I won't generate pages for individual records.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Addressable pages for every row in a table 267513424  
338859709 https://github.com/simonw/datasette/issues/23#issuecomment-338859709 https://api.github.com/repos/simonw/datasette/issues/23 MDEyOklzc3VlQ29tbWVudDMzODg1OTcwOQ== simonw 9599 2017-10-24T03:12:18Z 2017-10-24T03:12:42Z OWNER

I’m going to need to write unit tests for this, is this depends on #9

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support Django-style filters in querystring arguments 267788884  
338859620 https://github.com/simonw/datasette/issues/23#issuecomment-338859620 https://api.github.com/repos/simonw/datasette/issues/23 MDEyOklzc3VlQ29tbWVudDMzODg1OTYyMA== simonw 9599 2017-10-24T03:11:42Z 2017-10-24T03:11:42Z OWNER

I’m going to implement everything in https://docs.djangoproject.com/en/1.11/ref/models/querysets/#field-lookups with the exception of range and the various date ones.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support Django-style filters in querystring arguments 267788884  
338857568 https://github.com/simonw/datasette/issues/1#issuecomment-338857568 https://api.github.com/repos/simonw/datasette/issues/1 MDEyOklzc3VlQ29tbWVudDMzODg1NzU2OA== simonw 9599 2017-10-24T02:57:12Z 2017-10-24T02:57:12Z OWNER

I can find the primary keys using:

PRAGMA table_info(myTable)
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Addressable pages for every row in a table 267513424  
338853083 https://github.com/simonw/datasette/issues/7#issuecomment-338853083 https://api.github.com/repos/simonw/datasette/issues/7 MDEyOklzc3VlQ29tbWVudDMzODg1MzA4Mw== simonw 9599 2017-10-24T02:27:25Z 2017-10-24T02:27:25Z OWNER

Fixed in 9d219140694551453bfa528e0624919eb065f9d6

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Framework where by every page is JSON plus a template 267516650  
338852971 https://github.com/simonw/datasette/issues/17#issuecomment-338852971 https://api.github.com/repos/simonw/datasette/issues/17 MDEyOklzc3VlQ29tbWVudDMzODg1Mjk3MQ== simonw 9599 2017-10-24T02:26:47Z 2017-10-24T02:26:47Z OWNER

I'm not going to bother with this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
In development mode, should still pick up new .db files 267732005  
338834213 https://github.com/simonw/datasette/issues/24#issuecomment-338834213 https://api.github.com/repos/simonw/datasette/issues/24 MDEyOklzc3VlQ29tbWVudDMzODgzNDIxMw== simonw 9599 2017-10-24T00:23:05Z 2017-10-24T00:23:05Z OWNER

If I can’t setect a primary key, I won’t provide a URL for those records

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Implement full URL design 267828746  

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