home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

13 rows where author_association = "OWNER" and "created_at" is on date 2019-11-04 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 7

  • [enhancement] Method to delete a row in python 5
  • Offer to format readonly SQL 2
  • ?_col= and ?_nocol= support for toggling columns on table view 2
  • Mechanism for customizing the SQL used to select specific columns in the table view 1
  • importing CSV to SQLite as library 1
  • Add "not in" filter - ?pk__notin=x,y,z 1
  • ensure_index() method 1

user 1

  • simonw 13

author_association 1

  • OWNER · 13 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
549591028 https://github.com/simonw/datasette/issues/615#issuecomment-549591028 https://api.github.com/repos/simonw/datasette/issues/615 MDEyOklzc3VlQ29tbWVudDU0OTU5MTAyOA== simonw 9599 2019-11-04T23:15:28Z 2019-11-04T23:15:28Z OWNER

Demo: visit https://52fa79c.datasette.io/fixtures/roadside_attractions and click "View and edit SQL" - you'll be sent to https://52fa79c.datasette.io/fixtures?sql=select+pk%2C+name%2C+address%2C+latitude%2C+longitude+from+roadside_attractions+order+by+pk+limit+101

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_col= and ?_nocol= support for toggling columns on table view 517451234  
549585571 https://github.com/simonw/datasette/issues/615#issuecomment-549585571 https://api.github.com/repos/simonw/datasette/issues/615 MDEyOklzc3VlQ29tbWVudDU0OTU4NTU3MQ== simonw 9599 2019-11-04T22:57:16Z 2019-11-04T22:57:16Z OWNER

First step: stop using select * and switch to selecting columns instead. This will also make the View and edit SQL button more useful.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_col= and ?_nocol= support for toggling columns on table view 517451234  
549584753 https://github.com/simonw/datasette/issues/292#issuecomment-549584753 https://api.github.com/repos/simonw/datasette/issues/292 MDEyOklzc3VlQ29tbWVudDU0OTU4NDc1Mw== simonw 9599 2019-11-04T22:54:26Z 2019-11-04T22:54:26Z OWNER

I'm going to split off an issue just for ?_col= and ?_nocol=

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for customizing the SQL used to select specific columns in the table view 326800219  
549435364 https://github.com/simonw/sqlite-utils/issues/62#issuecomment-549435364 https://api.github.com/repos/simonw/sqlite-utils/issues/62 MDEyOklzc3VlQ29tbWVudDU0OTQzNTM2NA== simonw 9599 2019-11-04T16:30:34Z 2019-11-04T16:30:34Z OWNER

Released as 1.12.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[enhancement] Method to delete a row in python 500783373  
549432592 https://github.com/simonw/sqlite-utils/issues/61#issuecomment-549432592 https://api.github.com/repos/simonw/sqlite-utils/issues/61 MDEyOklzc3VlQ29tbWVudDU0OTQzMjU5Mg== simonw 9599 2019-11-04T16:25:01Z 2019-11-04T16:25:01Z OWNER

Yeah I've thought about this a bit and I'm OK leaving it out.

The core idea of sqlite-utils is that if you can create a list, iterator or generator of Python dictionaries you can efficiently insert those into a SQLite table.

The --csv function is actually implemented as just a few lines of code which turn that incoming CSV into a generator of dictionaries:

https://github.com/simonw/sqlite-utils/blob/169ea455fc1f1d5e5b6e44cb339ba7ffa9d49c31/sqlite_utils/cli.py#L364-L368

I could turn this into a reusable helper function but since it wouldn't have anything to do with database inserts (it would just be a helper that turns a CSV into a generator of dictionaries) it doesn't feel like it fits well in the Python library section of this package.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
importing CSV to SQLite as library 491219910  
549430429 https://github.com/simonw/sqlite-utils/issues/63#issuecomment-549430429 https://api.github.com/repos/simonw/sqlite-utils/issues/63 MDEyOklzc3VlQ29tbWVudDU0OTQzMDQyOQ== simonw 9599 2019-11-04T16:20:35Z 2019-11-04T16:20:35Z OWNER

I don't think we need this. We already have a dogs.create_index(["name"], if_not_exists=True) option.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
ensure_index() method 517241040  
549429512 https://github.com/simonw/sqlite-utils/issues/62#issuecomment-549429512 https://api.github.com/repos/simonw/sqlite-utils/issues/62 MDEyOklzc3VlQ29tbWVudDU0OTQyOTUxMg== simonw 9599 2019-11-04T16:18:48Z 2019-11-04T16:18:48Z OWNER

Documentation for .delete_where(): https://github.com/simonw/sqlite-utils/blob/169ea455fc1f1d5e5b6e44cb339ba7ffa9d49c31/docs/python-api.rst#deleting-multiple-records

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[enhancement] Method to delete a row in python 500783373  
549425364 https://github.com/simonw/sqlite-utils/issues/62#issuecomment-549425364 https://api.github.com/repos/simonw/sqlite-utils/issues/62 MDEyOklzc3VlQ29tbWVudDU0OTQyNTM2NA== simonw 9599 2019-11-04T16:09:56Z 2019-11-04T16:09:56Z OWNER

Since we have table.rows_where(where, where_args) it makes sense to me to also support table.delete_where(where, where_args).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[enhancement] Method to delete a row in python 500783373  
549425012 https://github.com/simonw/sqlite-utils/issues/62#issuecomment-549425012 https://api.github.com/repos/simonw/sqlite-utils/issues/62 MDEyOklzc3VlQ29tbWVudDU0OTQyNTAxMg== simonw 9599 2019-11-04T16:09:08Z 2019-11-04T16:09:08Z OWNER

Documentation for table.delete(): https://github.com/simonw/sqlite-utils/blob/19073d6d972fad9d68dd74c28544cd29083f1c12/docs/python-api.rst#deleting-a-specific-record

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[enhancement] Method to delete a row in python 500783373  
549418134 https://github.com/simonw/sqlite-utils/issues/62#issuecomment-549418134 https://api.github.com/repos/simonw/sqlite-utils/issues/62 MDEyOklzc3VlQ29tbWVudDU0OTQxODEzNA== simonw 9599 2019-11-04T15:54:18Z 2019-11-04T15:54:18Z OWNER

This is a good idea. The individual row version of it can work like the .update(pk, ...) method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[enhancement] Method to delete a row in python 500783373  
549222252 https://github.com/simonw/datasette/issues/614#issuecomment-549222252 https://api.github.com/repos/simonw/datasette/issues/614 MDEyOklzc3VlQ29tbWVudDU0OTIyMjI1Mg== simonw 9599 2019-11-04T04:31:58Z 2019-11-04T04:31:58Z OWNER

Demo: https://latest.datasette.io/fixtures/facetable?pk__notin=1,2,3

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add "not in" filter - ?pk__notin=x,y,z 516950748  
549210352 https://github.com/simonw/datasette/pull/602#issuecomment-549210352 https://api.github.com/repos/simonw/datasette/issues/602 MDEyOklzc3VlQ29tbWVudDU0OTIxMDM1Mg== simonw 9599 2019-11-04T02:50:15Z 2019-11-04T02:50:15Z OWNER

I wonder if the Format SQL button should disappear in the read-only case once it has been clicked? It won't do anything if it's clicked again and there's no textarea for the user to mess up the now-formatted SQL.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Offer to format readonly SQL 509535510  
549210237 https://github.com/simonw/datasette/pull/602#issuecomment-549210237 https://api.github.com/repos/simonw/datasette/issues/602 MDEyOklzc3VlQ29tbWVudDU0OTIxMDIzNw== simonw 9599 2019-11-04T02:49:18Z 2019-11-04T02:49:18Z OWNER

Live demo can now be seen here: https://latest.datasette.io/fixtures/%F0%9D%90%9C%F0%9D%90%A2%F0%9D%90%AD%F0%9D%90%A2%F0%9D%90%9E%F0%9D%90%AC

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Offer to format readonly SQL 509535510  

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