home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

issue 1

  • inspect() should detect many-to-many relationships · 6 ✖

author_association 1

  • OWNER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
495058104 https://github.com/simonw/datasette/issues/259#issuecomment-495058104 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDQ5NTA1ODEwNA== simonw 9599 2019-05-23T03:55:37Z 2019-05-23T03:55:37Z OWNER

I got rid of inspect in #462 - I will still be doing many-to-many detection (initially as part of #356) but it doesn't need a separate ticket.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  
409087501 https://github.com/simonw/datasette/issues/259#issuecomment-409087501 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDQwOTA4NzUwMQ== simonw 9599 2018-07-31T04:03:29Z 2018-07-31T04:03:29Z OWNER

Parent ticket: #354

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  
392214791 https://github.com/simonw/datasette/issues/259#issuecomment-392214791 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDM5MjIxNDc5MQ== simonw 9599 2018-05-25T23:43:15Z 2018-07-29T00:56:03Z OWNER

We may need to derive a usable name for each of these relationships that can be used in eg querystring parameters.

The name of the join table is a reasonable choice here. Say the join table is called event_tags - the querystring for returning all events that are tagged badger could be /db/events?_m2m_event_tags__tag=badger perhaps?

But what if event_tags has more than one foreign key back to events? Might need to specify the column in events that is referred back to by event_tags somehow in that case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  
399157944 https://github.com/simonw/datasette/issues/259#issuecomment-399157944 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDM5OTE1Nzk0NA== simonw 9599 2018-06-21T16:07:49Z 2018-06-21T16:07:49Z OWNER

Thanks to #319 the test suite now includes a m2m table: https://latest.datasette.io/fixtures-e14e080/searchable_tags

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  
392212119 https://github.com/simonw/datasette/issues/259#issuecomment-392212119 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDM5MjIxMjExOQ== simonw 9599 2018-05-25T23:22:26Z 2018-05-25T23:22:26Z OWNER

This should detect any table which can be linked to the current table via some other table, based on the other table having a foreign key to them both.

These join tables could be arbitrarily complicated. They might have foreign keys to more than two other tables, maybe even multiple foreign keys to the same column.

Ideally M2M defection would catch all of these cases. Maybe the resulting inspect data looks something like this:

"artists": { ... "m2m": [{ "other_table": "festivals", "through": "performances", "our_fk": "artist_id", "other_fk": "performance_id" }]

Let's ignore compound primary keys: we k it detect m2m relationships where the join table has foreign keys to a single primary key on the other two tables.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  
388797919 https://github.com/simonw/datasette/issues/259#issuecomment-388797919 https://api.github.com/repos/simonw/datasette/issues/259 MDEyOklzc3VlQ29tbWVudDM4ODc5NzkxOQ== simonw 9599 2018-05-14T12:23:11Z 2018-05-14T12:23:11Z OWNER

For M2M to work we will need a mechanism for applying IN queries to the table view, so you can select multiple M2M filters. Maybe this would work:

?_m2m_category=123&_m2m_category=865
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
inspect() should detect many-to-many relationships 322787470  

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