home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "OWNER" and issue = 1160432941 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

  • Use dash encoding for table names and row primary keys in URLs · 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
1060067031 https://github.com/simonw/datasette/pull/1648#issuecomment-1060067031 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_L1bX simonw 9599 2022-03-06T23:50:40Z 2022-03-06T23:58:31Z OWNER

I may have to do extra work here python def database(self, database, format=None): db = self.ds.databases[database] if self.ds.setting("hash_urls") and db.hash: path = self.path( f"{dash_encode(database)}-{db.hash[:HASH_LENGTH]}", format=format ) else: path = self.path(dash_encode(database), format=format) return path The URLs that incorporate a hash have a dbname-hash format - will that - in the middle there mess up the dash decoding mechanism? I think it will.

Might be able to solve that like so:

python async def resolve_db_name(self, request, db_name, **kwargs): hash = None name = None decoded_name = dash_decode(db_name) if decoded_name not in self.ds.databases and "-" in db_name: # No matching DB found, maybe it's a name-hash? name_bit, hash_bit = db_name.rsplit("-", 1) if dash_decode(name_bit) not in self.ds.databases: raise NotFound(f"Database not found: {name}") else: name = dash_decode(name_bit) hash = hash_bit else: name = decoded_name

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  
1060065736 https://github.com/simonw/datasette/pull/1648#issuecomment-1060065736 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_L1HI simonw 9599 2022-03-06T23:43:00Z 2022-03-06T23:43:11Z OWNER
  • Maybe use dash encoding for database name too?

Yes, I'm going to do this. At the moment if a DB file is called fixx%tures.db when you run it in Datasette the path is /fix%2525tures - which is liable to break.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  
1060056510 https://github.com/simonw/datasette/pull/1648#issuecomment-1060056510 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_Ly2- simonw 9599 2022-03-06T23:02:05Z 2022-03-06T23:04:24Z OWNER

Just spotted this: https://github.com/simonw/datasette/blob/de810f49cc57a4f88e4a1553d26c579253ce4531/datasette/views/base.py#L203-L216

Maybe the db name should use dash encoding too?

If so, relevant code includes this bit:

https://github.com/simonw/datasette/blob/de810f49cc57a4f88e4a1553d26c579253ce4531/datasette/url_builder.py#L30-L38

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  
1060044592 https://github.com/simonw/datasette/pull/1648#issuecomment-1060044592 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_Lv8w simonw 9599 2022-03-06T21:42:35Z 2022-03-06T21:42:35Z OWNER

For consistency, I'm going to change how ?_next= tokens work too. Right now they work like this:

https://github.com/simonw/datasette/blob/de810f49cc57a4f88e4a1553d26c579253ce4531/datasette/views/table.py#L501-L507

https://github.com/simonw/datasette/blob/de810f49cc57a4f88e4a1553d26c579253ce4531/datasette/utils/init.py#L114-L116

I'm going to change those to use dash-encoding instead.

I considered looking for % in those values and replacing that as - too, but since Datasette isn't 1.0 yet I'm going to risk breaking any pagination tokens that people might have saved away somewhere!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  
1060034562 https://github.com/simonw/datasette/pull/1648#issuecomment-1060034562 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_LtgC simonw 9599 2022-03-06T20:36:12Z 2022-03-06T20:36:12Z OWNER

Updated documentation:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  
1060016221 https://github.com/simonw/datasette/pull/1648#issuecomment-1060016221 https://api.github.com/repos/simonw/datasette/issues/1648 IC_kwDOBm6k_c4_LpBd simonw 9599 2022-03-06T18:37:59Z 2022-03-06T18:37:59Z OWNER

Change of plan: based on extensive conversations on Twitter - see https://github.com/simonw/datasette/issues/1439#issuecomment-1059851259 - I'm going to try a variant of this which is basically percent-encoding but with a hyphen instead of a percent symbol.

Reason being that the current scheme doesn't handle the case of % being part of the table name, which could cause weird breakage due to some proxies decoding percent encoding before it gets to Datasette.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dash encoding for table names and row primary keys in URLs 1160432941  

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