home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 541467590 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

  • Template debug mode that outputs template context · 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
568276548 https://github.com/simonw/datasette/issues/654#issuecomment-568276548 https://api.github.com/repos/simonw/datasette/issues/654 MDEyOklzc3VlQ29tbWVudDU2ODI3NjU0OA== simonw 9599 2019-12-22T16:13:11Z 2019-12-22T16:13:11Z OWNER

Documentation: https://datasette.readthedocs.io/en/latest/config.html#template-debug

Demos: * https://latest.datasette.io/?_context=1 * https://latest.datasette.io/fixtures?_context=1 * https://latest.datasette.io/fixtures/roadside_attractions?_context=1

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Template debug mode that outputs template context 541467590  
568274570 https://github.com/simonw/datasette/issues/654#issuecomment-568274570 https://api.github.com/repos/simonw/datasette/issues/654 MDEyOklzc3VlQ29tbWVudDU2ODI3NDU3MA== simonw 9599 2019-12-22T15:52:43Z 2019-12-22T15:52:43Z OWNER

One problem with this: what if secrets end up being dumped out in this debug view?

This won't happen with default Datasette but could potentially happen with a plugin.

This feature should be opt-in - maybe a template_debug:1 config setting.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Template debug mode that outputs template context 541467590  
568274520 https://github.com/simonw/datasette/issues/654#issuecomment-568274520 https://api.github.com/repos/simonw/datasette/issues/654 MDEyOklzc3VlQ29tbWVudDU2ODI3NDUyMA== simonw 9599 2019-12-22T15:51:58Z 2019-12-22T15:51:58Z OWNER

Proof of concept: ```diff diff --git a/datasette/views/base.py b/datasette/views/base.py index 5182479..39d1f77 100644 --- a/datasette/views/base.py +++ b/datasette/views/base.py @@ -1,6 +1,7 @@ import asyncio import csv import itertools +import json import re import time import urllib @@ -138,28 +139,31 @@ class BaseView(AsgiView): ) extra_template_vars.update(extra_vars)

  • template_context = {
  • **context,
  • **{
  • "app_css_hash": self.ds.app_css_hash(),
  • "select_templates": select_templates,
  • "zip": zip,
  • "body_scripts": body_scripts,
  • "extra_css_urls": self._asset_urls(
  • "extra_css_urls", template, context
  • ),
  • "extra_js_urls": self._asset_urls(
  • "extra_js_urls", template, context
  • ),
  • "format_bytes": format_bytes,
  • "database_url": self.database_url,
  • "database_color": self.database_color,
  • },
  • **extra_template_vars,
  • }
  • if request.args.get("_context"):
  • return Response.html("
    {}
    ".format(
  • escape(json.dumps(template_context, default=repr, indent=4))
  • )) return Response.html(
  • await template.render_async(
  • {
  • **context,
  • **{
  • "app_css_hash": self.ds.app_css_hash(),
  • "select_templates": select_templates,
  • "zip": zip,
  • "body_scripts": body_scripts,
  • "extra_css_urls": self._asset_urls(
  • "extra_css_urls", template, context
  • ),
  • "extra_js_urls": self._asset_urls(
  • "extra_js_urls", template, context
  • ),
  • "format_bytes": format_bytes,
  • "database_url": self.database_url,
  • "database_color": self.database_color,
  • },
  • **extra_template_vars,
  • }
  • )
  • await template.render_async(template_context) ) ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Template debug mode that outputs template context 541467590  

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