home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where author_association = "OWNER", "created_at" is on date 2022-03-05 and issue = 973139047 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 8

issue 1

  • Rethink how .ext formats (v.s. ?_format=) works before 1.0 · 8 ✖

author_association 1

  • OWNER · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1059854864 https://github.com/simonw/datasette/issues/1439#issuecomment-1059854864 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_LBoQ simonw 9599 2022-03-05T23:59:05Z 2022-03-05T23:59:05Z OWNER

OK, for that percentage thing: the Python core implementation of URL percentage escaping deliberately ignores two of the characters we want to escape: . and -:

https://github.com/python/cpython/blob/6927632492cbad86a250aa006c1847e03b03e70b/Lib/urllib/parse.py#L780-L783

python _ALWAYS_SAFE = frozenset(b'ABCDEFGHIJKLMNOPQRSTUVWXYZ' b'abcdefghijklmnopqrstuvwxyz' b'0123456789' b'_.-~') It also defaults to skipping / (passed as a safe= parameter to various things).

I'm going to try borrowing and modifying the core of the Python implementation: https://github.com/python/cpython/blob/6927632492cbad86a250aa006c1847e03b03e70b/Lib/urllib/parse.py#L795-L814 ```python class _Quoter(dict): """A mapping from bytes numbers (in range(0,256)) to strings. String values are percent-encoded byte values, unless the key < 128, and in either of the specified safe set, or the always safe set. """ # Keeps a cache internally, via missing, for efficiency (lookups # of cached keys don't call Python code at all). def init(self, safe): """safe: bytes object.""" self.safe = _ALWAYS_SAFE.union(safe)

def __repr__(self):
    return f"<Quoter {dict(self)!r}>"

def __missing__(self, b):
    # Handle a cache miss. Store quoted string in cache and return.
    res = chr(b) if b in self.safe else '%{:02X}'.format(b)
    self[b] = res
    return res

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059853526 https://github.com/simonw/datasette/issues/1439#issuecomment-1059853526 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_LBTW simonw 9599 2022-03-05T23:49:59Z 2022-03-05T23:49:59Z OWNER

I want to try regular percentage encoding, except that it also encodes both the - and the . characters, AND it uses - instead of % as the encoding character.

Should check what it does with emoji too.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059851259 https://github.com/simonw/datasette/issues/1439#issuecomment-1059851259 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_LAv7 simonw 9599 2022-03-05T23:35:47Z 2022-03-05T23:35:59Z OWNER

This comment from glyph got me thinking:

Have you considered replacing % with some other character and then using percent-encoding?

What happens if a table name includes a % character and that ends up getting mangled by a misbehaving proxy?

I should consider % in the escaping system too. And maybe go with that suggestion of using percent-encoding directly but with a different character.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059850369 https://github.com/simonw/datasette/issues/1439#issuecomment-1059850369 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_LAiB simonw 9599 2022-03-05T23:28:56Z 2022-03-05T23:28:56Z OWNER

Lots of great conversations about the dash encoding implementation on Twitter: https://twitter.com/simonw/status/1500228316309061633

@dracos helped me figure out a simpler regex: https://twitter.com/dracos/status/1500236433809973248

^/(?P<database>[^/]+)/(?P<table>[^\/\-\.]*|\-/|\-\.|\-\-)*(?P<format>\.\w+)?$

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059836599 https://github.com/simonw/datasette/issues/1439#issuecomment-1059836599 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_K9K3 simonw 9599 2022-03-05T21:52:10Z 2022-03-05T21:52:10Z OWNER

Blogged about this here: https://simonwillison.net/2022/Mar/5/dash-encoding/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059822391 https://github.com/simonw/datasette/issues/1439#issuecomment-1059822391 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_K5s3 simonw 9599 2022-03-05T19:50:12Z 2022-03-05T19:50:12Z OWNER

I'm going to move this work to a PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059822151 https://github.com/simonw/datasette/issues/1439#issuecomment-1059822151 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_K5pH simonw 9599 2022-03-05T19:48:35Z 2022-03-05T19:48:35Z OWNER

Those new docs: https://github.com/simonw/datasette/blob/d1cb73180b4b5a07538380db76298618a5fc46b6/docs/internals.rst#dash-encoding

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  
1059802318 https://github.com/simonw/datasette/issues/1439#issuecomment-1059802318 https://api.github.com/repos/simonw/datasette/issues/1439 IC_kwDOBm6k_c4_K0zO simonw 9599 2022-03-05T17:34:33Z 2022-03-05T17:34:33Z OWNER

Wrote documentation:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how .ext formats (v.s. ?_format=) works before 1.0 973139047  

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