home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

issue 1

  • Introspection property for telling if a table is a rowid table · 7 ✖

author_association 1

  • OWNER 7
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
864418795 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864418795 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxODc5NQ== simonw 9599 2021-06-19T15:11:05Z 2021-06-19T15:11:14Z OWNER

Actually I'm going to go with use_rowid instead - because the table doesn't inherently use a rowid itself, but you should use one if you want to query it in a way that gives you back a primary key.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864418188 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864418188 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxODE4OA== simonw 9599 2021-06-19T15:05:53Z 2021-06-19T15:05:53Z OWNER

python @property def uses_rowid(self): return not any(column for column in self.columns if column.is_pk)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864417808 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864417808 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxNzgwOA== simonw 9599 2021-06-19T15:03:00Z 2021-06-19T15:03:00Z OWNER

I think I like table.uses_rowid best - it reads well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864417765 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864417765 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxNzc2NQ== simonw 9599 2021-06-19T15:02:42Z 2021-06-19T15:02:42Z OWNER

Some options:

  • table.rowid_only
  • table.rowid_as_pk
  • table.no_pks
  • table.no_pk
  • table.uses_rowid
  • table.use_rowid
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864417493 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864417493 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxNzQ5Mw== simonw 9599 2021-06-19T15:00:43Z 2021-06-19T15:00:43Z OWNER

I have to be careful about the language I use here. Here's the official definition: https://www.sqlite.org/rowidtable.html

A "rowid table" is any table in an SQLite schema that

  • is not a virtual table, and
  • is not a WITHOUT ROWID table.

Most tables in a typical SQLite database schema are rowid tables.

Rowid tables are distinguished by the fact that they all have a unique, non-NULL, signed 64-bit integer rowid that is used as the access key for the data in the underlying B-tree storage engine.

So it's not correct to call a table a "rowid table" only if it is missing its own primary keys.

Maybe table.has_rowid is the right language to use here? No, that's no good - because tables with their own primary keys usually also have a rowid.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864417133 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864417133 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxNzEzMw== simonw 9599 2021-06-19T14:57:36Z 2021-06-19T14:57:36Z OWNER

So the logic is: python [column.name for column in self.columns if column.is_pk] I need to decide on a property name. Existing names are documented here: https://sqlite-utils.datasette.io/en/stable/python-api.html#introspection

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  
864417031 https://github.com/simonw/sqlite-utils/issues/285#issuecomment-864417031 https://api.github.com/repos/simonw/sqlite-utils/issues/285 MDEyOklzc3VlQ29tbWVudDg2NDQxNzAzMQ== simonw 9599 2021-06-19T14:56:45Z 2021-06-19T14:56:45Z 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'] ``` But that's because the `.pks` property hides the difference: https://github.com/simonw/sqlite-utils/blob/dc94f4bb8cfe922bb2f9c89f8f0f29092ea63133/sqlite_utils/db.py#L805-L810
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introspection property for telling if a table is a rowid table 925410305  

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