home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

18 rows where "updated_at" is on date 2018-04-09 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 6

  • Ability to sort (and paginate) by column 10
  • add "format sql" button to query page, uses sql-formatter 2
  • 500 from missing table name 2
  • Ability to apply sort on mobile in portrait mode 2
  • Metadata should be a nested arbitrary KV store 1
  • Cleaner mechanism for handling custom errors 1

user 3

  • simonw 15
  • carlmjohnson 2
  • bsmithgall 1

author_association 2

  • OWNER 15
  • NONE 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
379833481 https://github.com/simonw/datasette/issues/199#issuecomment-379833481 https://api.github.com/repos/simonw/datasette/issues/199 MDEyOklzc3VlQ29tbWVudDM3OTgzMzQ4MQ== simonw 9599 2018-04-09T17:38:39Z 2018-04-09T17:38:39Z OWNER

Since you can't apply _sort and _sort_desc at the same time, maybe just one select box for picking the column to sort by and a boolean checkbox for "sort descending" - which then redirects to the _sort_desc= URL variant.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to apply sort on mobile in portrait mode 312620566  
379833216 https://github.com/simonw/datasette/issues/199#issuecomment-379833216 https://api.github.com/repos/simonw/datasette/issues/199 MDEyOklzc3VlQ29tbWVudDM3OTgzMzIxNg== simonw 9599 2018-04-09T17:37:47Z 2018-04-09T17:37:47Z OWNER

I may do this by adding select boxes for _sort and _sort_desc to the filters UI. This would allow sorting in mobile portrait mode but would also ensure that the existing sort order is persisted if the user edits the current filters (right now sort resets when filters are applied).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to apply sort on mobile in portrait mode 312620566  
379830529 https://github.com/simonw/datasette/issues/189#issuecomment-379830529 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTgzMDUyOQ== simonw 9599 2018-04-09T17:28:47Z 2018-04-09T17:28:47Z OWNER

Another demo: https://fivethirtyeight.datasettes.com/fivethirtyeight-2628db9/congress-age%2Fcongress-terms

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379803864 https://github.com/simonw/datasette/issues/189#issuecomment-379803864 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTgwMzg2NA== simonw 9599 2018-04-09T16:02:09Z 2018-04-09T16:02:09Z OWNER

This is now released in Datasette 0.15 https://github.com/simonw/datasette/releases/tag/0.15

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379791047 https://github.com/simonw/datasette/issues/189#issuecomment-379791047 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTc5MTA0Nw== carlmjohnson 222245 2018-04-09T15:23:45Z 2018-04-09T15:23:45Z NONE

Awesome!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379788103 https://github.com/simonw/datasette/issues/184#issuecomment-379788103 https://api.github.com/repos/simonw/datasette/issues/184 MDEyOklzc3VlQ29tbWVudDM3OTc4ODEwMw== carlmjohnson 222245 2018-04-09T15:15:11Z 2018-04-09T15:15:11Z NONE

Visit https://salaries.news.baltimoresun.com/salaries/bad-table.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
500 from missing table name 292011379  
379759875 https://github.com/simonw/datasette/pull/181#issuecomment-379759875 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDM3OTc1OTg3NQ== bsmithgall 1957344 2018-04-09T13:53:14Z 2018-04-09T13:53:14Z NONE

I've implemented that approach in 86ac746. It does cause the button to pop in only after Codemirror is finished rendering which is a bit awkward.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
add "format sql" button to query page, uses sql-formatter 289425975  
379636695 https://github.com/simonw/datasette/pull/181#issuecomment-379636695 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDM3OTYzNjY5NQ== simonw 9599 2018-04-09T05:30:16Z 2018-04-09T05:30:16Z OWNER

I'd prefer to have the JavaScript actually manipulate the DOM to add the button - something like this:

var button = document.createElement('button');
button.value = 'Format SQL';
button.addEventListener(
    'click', format, false
);
document.getElementById('run-sql').parentNode.appendChild(button);
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
add "format sql" button to query page, uses sql-formatter 289425975  
379636068 https://github.com/simonw/datasette/issues/184#issuecomment-379636068 https://api.github.com/repos/simonw/datasette/issues/184 MDEyOklzc3VlQ29tbWVudDM3OTYzNjA2OA== simonw 9599 2018-04-09T05:26:21Z 2018-04-09T05:26:21Z OWNER

Do you have steps to reproduce here - ideally a small example SQLite database that exhibits the error?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
500 from missing table name 292011379  
379634425 https://github.com/simonw/datasette/issues/189#issuecomment-379634425 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTYzNDQyNQ== simonw 9599 2018-04-09T05:16:02Z 2018-04-09T05:16:02Z OWNER

I've merged this into master.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379624163 https://github.com/simonw/datasette/issues/193#issuecomment-379624163 https://api.github.com/repos/simonw/datasette/issues/193 MDEyOklzc3VlQ29tbWVudDM3OTYyNDE2Mw== simonw 9599 2018-04-09T04:03:49Z 2018-04-09T04:03:49Z OWNER

This is harder than I thought, because the _shape= logic actually runs AFTER the main block of code which is set up to catch exceptions - this code here:

https://github.com/simonw/datasette/blob/0abd3abacb309a2bd5913a7a2df4e9256585b1bb/datasette/app.py#L200-L216

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cleaner mechanism for handling custom errors 310882100  
379608977 https://github.com/simonw/datasette/issues/189#issuecomment-379608977 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTYwODk3Nw== simonw 9599 2018-04-09T02:22:59Z 2018-04-09T02:22:59Z OWNER

Here's a demo of the new clickable column headers: https://datasette-issue-189-demo-3.now.sh/salaries-7859114-7859114/2017+Maryland+state+salaries?_search=university&_sort_desc=last_name

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379603156 https://github.com/simonw/datasette/issues/189#issuecomment-379603156 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTYwMzE1Ng== simonw 9599 2018-04-09T01:41:22Z 2018-04-09T01:41:22Z OWNER

Actually I think I always want nulls last when ordering asc, nulls first when ordering desc.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379602690 https://github.com/simonw/datasette/issues/189#issuecomment-379602690 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTYwMjY5MA== simonw 9599 2018-04-09T01:37:03Z 2018-04-09T01:37:03Z OWNER

I'm going to split the following out into separate tickets:

  • Ability to sort by multiple columns e.g. ?_sort=name&sort_desc=age&_sort=height
  • Ability to specify nulls last e.g. ?_sort_desc_nulls_last=age
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379602339 https://github.com/simonw/datasette/issues/189#issuecomment-379602339 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTYwMjMzOQ== simonw 9599 2018-04-09T01:33:26Z 2018-04-09T01:33:26Z OWNER

Small bug: "201 rows where sorted by sortable_with_nulls" shouldn't have the word "where" in it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379595274 https://github.com/simonw/datasette/issues/189#issuecomment-379595274 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTU5NTI3NA== simonw 9599 2018-04-09T00:24:37Z 2018-04-09T00:29:46Z OWNER

Another demo: https://datasette-issue-189-demo-2.now.sh/salaries-7859114-7859114/2017+Maryland+state+salaries?_search=university&_sort_desc=annual_salary

https://datasette-issue-189-demo-2.now.sh/salaries-7859114-7859114/2017+Maryland+state+salaries?_search=university&last_name__exact=JOHNSON&_sort_desc=annual_salary

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  
379595253 https://github.com/simonw/datasette/issues/185#issuecomment-379595253 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3OTU5NTI1Mw== simonw 9599 2018-04-09T00:24:10Z 2018-04-09T00:24:10Z OWNER

@carlmjohnson in case you aren't following along with #189 I've shipped the first working prototype of sort-by-column - you can try it out here: https://datasette-issue-189-demo-2.now.sh/salaries-7859114-7859114/2017+Maryland+state+salaries?_search=university&_sort_desc=annual_salary

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
379594529 https://github.com/simonw/datasette/issues/189#issuecomment-379594529 https://api.github.com/repos/simonw/datasette/issues/189 MDEyOklzc3VlQ29tbWVudDM3OTU5NDUyOQ== simonw 9599 2018-04-09T00:15:03Z 2018-04-09T00:15:03Z OWNER

Demo: senator tweets ordered by number of replies:

https://datasette-issue-189-demo.now.sh/fivethirtyeight-2628db9/twitter-ratio%2Fsenators?_sort_desc=replies

Page 2 (note that since Senators retweet things there are tweets with the same text/number-of-replies but retweeted by different senators that span the page break): https://datasette-issue-189-demo.now.sh/fivethirtyeight-2628db9/twitter-ratio%2Fsenators?_next=8556%2C121799&_sort_desc=replies

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to sort (and paginate) by column 309471814  

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