home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 925320167 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

  • .transform(types=) turns rowid into a concrete column · 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
864419283 https://github.com/simonw/sqlite-utils/issues/284#issuecomment-864419283 https://api.github.com/repos/simonw/sqlite-utils/issues/284 MDEyOklzc3VlQ29tbWVudDg2NDQxOTI4Mw== simonw 9599 2021-06-19T15:15:34Z 2021-06-19T15:15:34Z OWNER

I think this code is at fault: https://github.com/simonw/sqlite-utils/blob/5b257949d996fe43dc5d218d4308b88796a90740/sqlite_utils/db.py#L1017-L1023

It's using .pks which adds rowid if it's missing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.transform(types=) turns rowid into a concrete column 925320167  
864416911 https://github.com/simonw/sqlite-utils/issues/284#issuecomment-864416911 https://api.github.com/repos/simonw/sqlite-utils/issues/284 MDEyOklzc3VlQ29tbWVudDg2NDQxNjkxMQ== simonw 9599 2021-06-19T14:55:45Z 2021-06-19T14:55:45Z OWNER

https://github.com/simonw/sqlite-utils/blob/dc94f4bb8cfe922bb2f9c89f8f0f29092ea63133/sqlite_utils/db.py#L805-L810

So I can indeed detect a rowid table by looking for no is_pk columns.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.transform(types=) turns rowid into a concrete column 925320167  
864416785 https://github.com/simonw/sqlite-utils/issues/284#issuecomment-864416785 https://api.github.com/repos/simonw/sqlite-utils/issues/284 MDEyOklzc3VlQ29tbWVudDg2NDQxNjc4NQ== simonw 9599 2021-06-19T14:54:41Z 2021-06-19T14:54:41Z OWNER

```pycon

db = sqlite_utils.Database(memory=True) db["rowid_table"].insert({"name": "Cleo"})

<Table rowid_table (name)> >>> db["regular_table"].insert({"id": 1, "name": "Cleo"}, pk="id") <Table regular_table (id, name)> >>> db["rowid_table"].pks ['rowid'] >>> db["regular_table"].pks ['id'] ``` I think I need an introspection property for working out if a table is a `rowid` table or not.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.transform(types=) turns rowid into a concrete column 925320167  
864358951 https://github.com/simonw/sqlite-utils/issues/284#issuecomment-864358951 https://api.github.com/repos/simonw/sqlite-utils/issues/284 MDEyOklzc3VlQ29tbWVudDg2NDM1ODk1MQ== simonw 9599 2021-06-19T05:30:00Z 2021-06-19T05:30:00Z OWNER

If this can be fixed it will be in the transform_sql() method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.transform(types=) turns rowid into a concrete column 925320167  
864358680 https://github.com/simonw/sqlite-utils/issues/284#issuecomment-864358680 https://api.github.com/repos/simonw/sqlite-utils/issues/284 MDEyOklzc3VlQ29tbWVudDg2NDM1ODY4MA== simonw 9599 2021-06-19T05:27:13Z 2021-06-19T05:27:13Z OWNER

How easy is it to detect a rowid table? Is it as simple as .pks returning None? If so the documentation should mention that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.transform(types=) turns rowid into a concrete column 925320167  

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