home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 289425975 and user = 9599 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 · 5 ✖

issue 1

  • add "format sql" button to query page, uses sql-formatter · 5 ✖

author_association 1

  • OWNER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
552275451 https://github.com/simonw/datasette/pull/181#issuecomment-552275451 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDU1MjI3NTQ1MQ== simonw 9599 2019-11-11T03:08:25Z 2019-11-11T03:08:25Z OWNER

Closing this because this feature was shipped in #592

{
    "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  
378295376 https://github.com/simonw/datasette/pull/181#issuecomment-378295376 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDM3ODI5NTM3Ng== simonw 9599 2018-04-03T15:39:57Z 2018-04-03T15:39:57Z OWNER

On the licensing front: it looks like the way Django handles this is to keep the licensing header in the files intact, e.g. https://github.com/django/django/blob/6deaddcca367d0143c815aaa42342021baa3b41e/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js

So for this change, adding a comment at the top of sql-formatter.min.js which references the MIT license would do the trick.

{
    "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  
378293599 https://github.com/simonw/datasette/pull/181#issuecomment-378293599 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDM3ODI5MzU5OQ== simonw 9599 2018-04-03T15:34:50Z 2018-04-03T15:36:58Z OWNER

Let's only show the "Format SQL" button if the user has JavaScript enabled. We can do that in this code here:

https://github.com/bsmithgall/datasette/blob/4a7151a58d6ab7c8404a91beef7083e8a5807cf8/datasette/templates/_codemirror_foot.html#L14-L21

{
    "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  
378293484 https://github.com/simonw/datasette/pull/181#issuecomment-378293484 https://api.github.com/repos/simonw/datasette/issues/181 MDEyOklzc3VlQ29tbWVudDM3ODI5MzQ4NA== simonw 9599 2018-04-03T15:34:29Z 2018-04-03T15:34:29Z OWNER

Here's what this looks like:

I need to figure out the right way to handle licensing of bundled software like this - it's MIT licensed which is compatible with Datasette's Apache 2 license, but I feel like bundled licensed software (including codemirror) needs to be recognized in the README or docs somehow.

{
    "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  

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