home / github

Menu
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 1452457263

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: user, author_association, created_at (date), updated_at (date)

id ▼ html_url issue_url node_id user created_at updated_at author_association body reactions issue performed_via_github_app
1317838892 https://github.com/simonw/datasette/issues/1897#issuecomment-1317838892 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OjKAs simonw 9599 2022-11-16T23:55:42Z 2022-11-16T23:55:42Z OWNER Here's where the schema is hard-coded at the moment: https://github.com/simonw/datasette/blob/00e233d7a7f6443cb95fb5227c23580c48551cad/datasette/templates/_codemirror_foot.html#L2-L7 I figured out how to extract that data from the `_internal` table in this comment: https://github.com/simonw/datasette/pull/1893#issuecomment-1317475720 Although that used JSON functions which may (in a real edge-case) not be available in the version of SQLite that Datasette is running on, so probably going to use a regular SQL query and then assemble the JSON separately. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1317839781 https://github.com/simonw/datasette/issues/1897#issuecomment-1317839781 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OjKOl simonw 9599 2022-11-16T23:56:47Z 2022-11-16T23:56:47Z OWNER I'm going to call this `table_columns` in the template context (because `schema` might mean `CREATE TABLE ...`. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1317840727 https://github.com/simonw/datasette/issues/1897#issuecomment-1317840727 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OjKdX simonw 9599 2022-11-16T23:57:52Z 2022-11-16T23:57:52Z OWNER In terms of permissions: if you have `execute-sql` permission for a database then it's OK for you to see the table columns for that database. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319401843 https://github.com/simonw/datasette/issues/1897#issuecomment-1319401843 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OpHlz simonw 9599 2022-11-18T00:42:03Z 2022-11-18T00:42:23Z OWNER This function works even if the SQLite JSON functions are not available: ```python async def _table_columns(datasette, database_name): internal = datasette.get_database("_internal") result = await internal.execute( "select table_name, name from columns where database_name = ?", [database_name], ) table_columns = {} for row in result.rows: table_columns.setdefault(row["table_name"], []).append(row["name"]) return table_columns ``` {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319435374 https://github.com/simonw/datasette/issues/1897#issuecomment-1319435374 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OpPxu simonw 9599 2022-11-18T01:33:30Z 2022-11-18T01:33:30Z OWNER Just noticed that this isn't including views, which it should. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319477721 https://github.com/simonw/datasette/issues/1897#issuecomment-1319477721 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OpaHZ simonw 9599 2022-11-18T02:51:40Z 2022-11-18T02:51:40Z OWNER Views aren't currently available in the `_internal` schema. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319478811 https://github.com/simonw/datasette/issues/1897#issuecomment-1319478811 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OpaYb simonw 9599 2022-11-18T02:53:57Z 2022-11-18T02:53:57Z OWNER I decided to just go for the view names, not their columns. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319533445 https://github.com/simonw/datasette/issues/1897#issuecomment-1319533445 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5OpnuF bgrins 95570 2022-11-18T04:38:03Z 2022-11-18T04:38:03Z CONTRIBUTOR Are you tracking the change to send the JSON over to the frontend separately or was that part of this? Something like this is probably pretty close https://github.com/bgrins/datasette/commit/8431c98850c7a552dbcde2a4dd0c3dc942a97d25#diff-0c93232bfd5477eeac96382e52769108b41433d960d5277ffcccf2f464e60abdR9 {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  
1319570586 https://github.com/simonw/datasette/issues/1897#issuecomment-1319570586 https://api.github.com/repos/simonw/datasette/issues/1897 IC_kwDOBm6k_c5Opwya simonw 9599 2022-11-18T05:33:20Z 2022-11-18T05:33:20Z OWNER One of the big changes still left to do for Datasette 1.0 is to unify the JSON representation with the context psssed to the templates (via an `?_extra=` mechanism to add extra context needed by the HTML templates), because a goal for 1.0 is for the template context to be a documented API contract such that custom templates won't break with future releases. As such I expect to do quite a bit of refactoring and cleanup on how the template context works later on. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Serve schema JSON to the SQL editor to enable autocomplete 1452457263  

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 30.447ms · About: simonw/datasette-graphql