home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "OWNER", "created_at" is on date 2022-12-31 and issue = 627794879 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

  • Redesign default .json format · 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
1368269732 https://github.com/simonw/datasette/issues/782#issuecomment-1368269732 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5RjiOk simonw 9599 2022-12-31T19:32:33Z 2023-01-17T02:05:45Z OWNER

New thinking on the trimmed-down default. Previously I was going to use "row" and "next_url" - I now want to do this instead: json { "ok": true, "rows": [ { "pk1": "a", "pk2": "a", "pk3": "a", "content": "a-a-a" }, { "pk1": "a", "pk2": "a", "pk3": "b", "content": "a-a-b" } ], "next": "a,a,b" } If there isn't a next page it will return "next": null.

This is even more succinct. I'm OK with people having to request next_url if they don't want to construct the new URL themselves.

The "ok": true is there so it can be false for errors, consistently.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  
1368285442 https://github.com/simonw/datasette/issues/782#issuecomment-1368285442 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5RjmEC simonw 9599 2022-12-31T22:02:16Z 2022-12-31T22:02:16Z OWNER

https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now returns count:

json { "database": "fixtures", "table": "compound_three_primary_keys", "is_view": false, "human_description_en": "", "rows": [ { "pk1": "a", "pk2": "a", "pk3": "a", "content": "a-a-a" }, { "pk1": "a", "pk2": "a", "pk3": "b", "content": "a-a-b" } ], "truncated": false, "count": 1001,

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  
1368278278 https://github.com/simonw/datasette/issues/782#issuecomment-1368278278 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5RjkUG simonw 9599 2022-12-31T20:49:38Z 2022-12-31T20:49:38Z OWNER

I'm going to rename filtered_table_rows_count to count - to match the SQL count(*) function.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  
1368269811 https://github.com/simonw/datasette/issues/782#issuecomment-1368269811 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5RjiPz simonw 9599 2022-12-31T19:33:09Z 2022-12-31T19:33:09Z OWNER

Here's the so-far updated documentation for this change: https://github.com/simonw/datasette/blob/a2dca62360ad4a961d4c46f68eae41b7d5c7b2c9/docs/json_api.rst#different-shapes

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  
1368269283 https://github.com/simonw/datasette/issues/782#issuecomment-1368269283 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5RjiHj simonw 9599 2022-12-31T19:29:45Z 2022-12-31T19:29:45Z OWNER

https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now shows the new default: json { "database": "fixtures", "table": "compound_three_primary_keys", "is_view": false, "human_description_en": "", "rows": [ { "pk1": "a", "pk2": "a", "pk3": "a", "content": "a-a-a" }, { "pk1": "a", "pk2": "a", "pk3": "b", "content": "a-a-b" } ], The old format can be had like this: https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_shape=arrays

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  
1368268148 https://github.com/simonw/datasette/issues/782#issuecomment-1368268148 https://api.github.com/repos/simonw/datasette/issues/782 IC_kwDOBm6k_c5Rjh10 simonw 9599 2022-12-31T19:22:07Z 2022-12-31T19:22:07Z OWNER

It turned out the most significant part of this change - switching from an array of arrays to an array of objects for the "rows" key - was really easy: Datasette already had a ?_shape=arrays v.s. ?_shape=objects mechanism, so I switched which one was the default in https://github.com/simonw/datasette/commit/234230e59574ccb8d8a24c45ccd325f725812377

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign default .json format 627794879  

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