home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 421348146 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

  • URL hashing now optional: turn on with --config hash_urls:1 (#418) · 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
473717052 https://github.com/simonw/datasette/pull/416#issuecomment-473717052 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzcxNzA1Mg== simonw 9599 2019-03-17T21:32:24Z 2019-03-17T21:33:16Z OWNER

Since this feature is now controlled by a config setting, I'm inclined to make it also available via a URL parameter.

If you hit this URL:

/fixtures/table.json?_hash=1

We can redirect to:

/fixtures-c2342/table.json

In this way developers can opt-in to a hashed (and hence far-future cached) response on a per-query basis.

This option won't be available against mutable databases though, which are coming in #419

This means that the hash_urls:1 config basically has the effect of assuming ?_hash=1 on all URLs to mutable databases.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473715254 https://github.com/simonw/datasette/pull/416#issuecomment-473715254 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzcxNTI1NA== simonw 9599 2019-03-17T21:11:37Z 2019-03-17T21:11:37Z OWNER

The code for this has got a bit tricky. I need to make a decision at some point as to if the current request is a hashed_url request (if it includes a DB hash in the URL which is the current correct hash). I then need to be able to use that fact to decide which default TTL value to apply when returning the response.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473714545 https://github.com/simonw/datasette/pull/416#issuecomment-473714545 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzcxNDU0NQ== simonw 9599 2019-03-17T21:03:08Z 2019-03-17T21:04:17Z OWNER

I'm going to introduce a new config setting: default_cache_ttl_hashed - and set the default value for default_cache_ttl to 10s (to protect against dog-piling).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473310026 https://github.com/simonw/datasette/pull/416#issuecomment-473310026 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzMxMDAyNg== simonw 9599 2019-03-15T14:35:53Z 2019-03-15T14:35:53Z OWNER

See #418

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473160702 https://github.com/simonw/datasette/pull/416#issuecomment-473160702 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzE2MDcwMg== simonw 9599 2019-03-15T05:08:13Z 2019-03-15T05:08:13Z OWNER

This also needs extensive tests to ensure that with the option turned on all of the redirects behave as they should.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473159679 https://github.com/simonw/datasette/pull/416#issuecomment-473159679 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzE1OTY3OQ== simonw 9599 2019-03-15T05:01:27Z 2019-03-15T05:01:27Z OWNER

Also: if the option is False and the user visits a URL with a hash in it, should we redirect them?

I'm inclined to say no: furthermore, I'd be OK continuing to serve a far-future cache header for that case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473156513 https://github.com/simonw/datasette/pull/416#issuecomment-473156513 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzE1NjUxMw== simonw 9599 2019-03-15T04:40:29Z 2019-03-15T04:40:29Z OWNER

Still TODO: need to figure out what to do about cache TTL. Defaulting to 365 days no longer makes sense without the hash_urls setting.

Maybe drop that setting default to 0?

Here's the setting:

https://github.com/simonw/datasette/blob/9743e1d91b5f0a2b3c1c0bd6ffce8739341f43c4/datasette/app.py#L84-L86

And here's where it takes affect:

https://github.com/simonw/datasette/blob/4462a5ab2817ac0d9ffe20dafbbf27c5c5b81466/datasette/views/base.py#L491-L501

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  
473154643 https://github.com/simonw/datasette/pull/416#issuecomment-473154643 https://api.github.com/repos/simonw/datasette/issues/416 MDEyOklzc3VlQ29tbWVudDQ3MzE1NDY0Mw== simonw 9599 2019-03-15T04:27:47Z 2019-03-15T04:28:00Z OWNER

Deployed a demo: https://datasette-optional-hash-demo.now.sh/

datasette publish now \
    ../demo-databses/russian-ads.db \
    ../demo-databses/polar-bears.db \
    --branch=optional-hash \
    -n datasette-optional-hash \
    --alias datasette-optional-hash-demo \
    --install=datasette-cluster-map \
    --install=datasette-json-html
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
URL hashing now optional: turn on with --config hash_urls:1 (#418) 421348146  

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