home / github

Menu
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 1822938661

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: 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
1652722208 https://github.com/simonw/datasette/issues/2112#issuecomment-1652722208 https://api.github.com/repos/simonw/datasette/issues/2112 IC_kwDOBm6k_c5igoog simonw 9599 2023-07-27T00:24:50Z 2023-07-27T00:25:16Z OWNER I changed my mind, I'm not going to do this with a format hook. Also: https://github.com/simonw/datasette/issues/2109#issuecomment-1652715823 I've decided to let HTML have its own special context. I'm going to try formalizing that as a `@dataclass` with fields with `metadata={"help": ...}` to see what that looks like. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Build HTML version of /content?sql=... 1822938661  
1652723029 https://github.com/simonw/datasette/issues/2112#issuecomment-1652723029 https://api.github.com/repos/simonw/datasette/issues/2112 IC_kwDOBm6k_c5igo1V simonw 9599 2023-07-27T00:25:49Z 2023-07-27T00:25:49Z OWNER Getting the query page working with all of the necessary HTML context variables is a slog. I uploaded `query.html` to Claude and asked it "List of every template context variable with a detailed description of each one": <img width="518" alt="image" src="https://github.com/simonw/datasette/assets/9599/9c7f3292-d3f3-49bc-9263-dc39bed5aa58"> > Based on the template code provided, here is a list of the template context variables and a description of each one: > > - `database` - The name of the database being queried. > - `query` - The SQL query object containing the `sql` string. > - `canned_query` - The name of the canned query if this is a canned query. > - `private` - Boolean indicating if this is a private database. > - `urls` - Object containing URL helpers like `database()`. > - `canned_write` - Boolean indicating if this canned query allows writes. > - `db_is_immutable` - Boolean indicating if this database is immutable. > - `error` - Any query error message. > - `hide_sql` - Boolean indicating if the SQL should be hidden. > - `show_hide_link` - The URL to toggle showing/hiding the SQL. > - `show_hide_text` - The text for the show/hide SQL link. > - `editable` - Boolean indicating if the SQL can be edited. > - `allow_execute_sql` - Boolean indicating if custom SQL can be executed. > - `tables` - List of table objects in the database. > - `named_parameter_values` - Dictionary of parameter names/values. > - `csrftoken()` - Function to generate a CSRF token. > - `edit_sql_url` - URL to edit the SQL for a canned query. > - `display_rows` - List of result rows to display. > - `columns` - List of column names. > - `renderers` - Dictionary of renderer name to URL. > - `url_csv` - URL for CSV export. > - `metadata` - Metadata about the query/database. > - `crumbs` - Breadcrumb navigation object. > > So in summary, it includes variables for the database, query, results, URLs, permissions, and metadata to power the template. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Build HTML version of /content?sql=... 1822938661  
1652746185 https://github.com/simonw/datasette/issues/2112#issuecomment-1652746185 https://api.github.com/repos/simonw/datasette/issues/2112 IC_kwDOBm6k_c5igufJ simonw 9599 2023-07-27T00:46:37Z 2023-07-27T00:46:37Z OWNER Got Claude to generate this code: ```python from dataclasses import dataclass, field @dataclass class QueryContext: database: str = field(metadata={"help": "The name of the database being queried"}) query: dict = field(metadata={"help": "The SQL query object containing the `sql` string"}) canned_query: str = field(metadata={"help": "The name of the canned query if this is a canned query"}) private: bool = field(metadata={"help": "Boolean indicating if this is a private database"}) urls: dict = field(metadata={"help": "Object containing URL helpers like `database()`"}) canned_write: bool = field(metadata={"help": "Boolean indicating if this canned query allows writes"}) db_is_immutable: bool = field(metadata={"help": "Boolean indicating if this database is immutable"}) error: str = field(metadata={"help": "Any query error message"}) hide_sql: bool = field(metadata={"help": "Boolean indicating if the SQL should be hidden"}) show_hide_link: str = field(metadata={"help": "The URL to toggle showing/hiding the SQL"}) show_hide_text: str = field(metadata={"help": "The text for the show/hide SQL link"}) editable: bool = field(metadata={"help": "Boolean indicating if the SQL can be edited"}) allow_execute_sql: bool = field(metadata={"help": "Boolean indicating if custom SQL can be executed"}) tables: list = field(metadata={"help": "List of table objects in the database"}) named_parameter_values: dict = field(metadata={"help": "Dictionary of parameter names/values"}) csrftoken: callable = field(metadata={"help": "Function to generate a CSRF token"}) edit_sql_url: str = field(metadata={"help": "URL to edit the SQL for a canned query"}) display_rows: list = field(metadata={"help": "List of result rows to display"}) columns: list = field(metadata={"help": "List of column names"}) renderers: dict = field(metadata={"help": "Dictionary of renderer name to URL"}) url_csv: str = field(metadata={"help": "URL for CSV export… {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Build HTML version of /content?sql=... 1822938661  
1652751140 https://github.com/simonw/datasette/issues/2112#issuecomment-1652751140 https://api.github.com/repos/simonw/datasette/issues/2112 IC_kwDOBm6k_c5igvsk simonw 9599 2023-07-27T00:52:53Z 2023-07-27T00:52:53Z OWNER Maybe I teach `datasette.render_template()` to take a dataclass instance as an optional alternative to a dictionary, and if it gets one it turns it into something that works well in the template context. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Build HTML version of /content?sql=... 1822938661  
1668798642 https://github.com/simonw/datasette/issues/2112#issuecomment-1668798642 https://api.github.com/repos/simonw/datasette/issues/2112 IC_kwDOBm6k_c5jd9iy simonw 9599 2023-08-08T02:01:01Z 2023-08-08T02:01:01Z OWNER Shipped: https://latest.datasette.io/fixtures?sql=select+*+from+facetable {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} Build HTML version of /content?sql=... 1822938661  

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