home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where "created_at" is on date 2022-11-01, issue = 1428630253 and "updated_at" is on date 2022-11-01 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 3

issue 1

  • Ensure insert API has good tests for rowid and compound primark key tables · 3 ✖

author_association 1

  • OWNER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1298919552 https://github.com/simonw/datasette/issues/1873#issuecomment-1298919552 https://api.github.com/repos/simonw/datasette/issues/1873 IC_kwDOBm6k_c5Na_CA simonw 9599 2022-11-01T18:11:27Z 2022-11-01T18:11:27Z OWNER

I forgot to document ignore and replace. Also I need to add tests that cover:

  • Forgetting to include a primary key on a non-autoincrement table
  • Compound primary keys
  • Rowid only tables with and without rowid specified

I think my validation logic here will get caught out by the fact that rowid does not show up as a valid column name: https://github.com/simonw/datasette/blob/9bec7c38eb93cde5afb16df9bdd96aea2a5b0459/datasette/views/table.py#L1151-L1160

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ensure insert API has good tests for rowid and compound primark key tables 1428630253  
1298905135 https://github.com/simonw/datasette/issues/1873#issuecomment-1298905135 https://api.github.com/repos/simonw/datasette/issues/1873 IC_kwDOBm6k_c5Na7gv simonw 9599 2022-11-01T17:59:59Z 2022-11-01T17:59:59Z OWNER

It's a bit surprising that you can send "ignore": true, "return_rows": true and the returned "inserted" key will list rows that were NOT inserted (since they were ignored).

Three options:

  1. Ignore that and document it
  2. Fix it so "inserted" only returns rows that were actually inserted (bit tricky)
  3. Change the name of "inserted" to something else

I'm picking 3 - I'm going to change it to be called "rows" instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ensure insert API has good tests for rowid and compound primark key tables 1428630253  
1298885451 https://github.com/simonw/datasette/issues/1873#issuecomment-1298885451 https://api.github.com/repos/simonw/datasette/issues/1873 IC_kwDOBm6k_c5Na2tL simonw 9599 2022-11-01T17:42:20Z 2022-11-01T17:42:20Z OWNER

Design decision: json { "rows": [{"id": 1, "title": "The title"}], "ignore": true } Or "replace": true.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ensure insert API has good tests for rowid and compound primark key tables 1428630253  

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