home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

12 rows where issue = 299760684 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 2

  • simonw 7
  • carlmjohnson 5

author_association 2

  • OWNER 7
  • NONE 5

issue 1

  • Metadata should be a nested arbitrary KV store · 12 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
412663658 https://github.com/simonw/datasette/issues/185#issuecomment-412663658 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDQxMjY2MzY1OA== carlmjohnson 222245 2018-08-13T21:04:11Z 2018-08-13T21:04:11Z NONE

That seems good to me.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
412299013 https://github.com/simonw/datasette/issues/185#issuecomment-412299013 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDQxMjI5OTAxMw== simonw 9599 2018-08-11T20:14:54Z 2018-08-11T20:14:54Z OWNER

I've been worrying about how this one relates to #260 - I'd like to validate metadata (to help protect against people e.g. misspelling license_url and then being confused when their license isn't displayed properly), but this issue requests the ability to add arbitrary additional keys to the metadata structure.

I think the solution is to introduce a metadata key called extra_metadata_keys which allows you to specifically list the extra keys that you want to enable. Something like this:

{ "title": "My title", "source": "Source", "source_url": "https://www.example.com/", "release_date": "2018-04-01", "extra_metadata_keys": ["release_date"] }

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
379595253 https://github.com/simonw/datasette/issues/185#issuecomment-379595253 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3OTU5NTI1Mw== simonw 9599 2018-04-09T00:24:10Z 2018-04-09T00:24:10Z OWNER

@carlmjohnson in case you aren't following along with #189 I've shipped the first working prototype of sort-by-column - you can try it out here: https://datasette-issue-189-demo-2.now.sh/salaries-7859114-7859114/2017+Maryland+state+salaries?_search=university&_sort_desc=annual_salary

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376614973 https://github.com/simonw/datasette/issues/185#issuecomment-376614973 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjYxNDk3Mw== carlmjohnson 222245 2018-03-27T17:49:00Z 2018-03-27T17:49:00Z NONE

@simonw Other than metadata, the biggest item on wishlist for the salaries project was the ability to reorder by column. Of course, that could be done with a custom SQL query, but we didn't want to have to reimplement all the nav/pagination stuff from scratch.

@carolinp, feel free to add your thoughts.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376604558 https://github.com/simonw/datasette/issues/185#issuecomment-376604558 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjYwNDU1OA== simonw 9599 2018-03-27T17:16:27Z 2018-03-27T17:16:27Z OWNER

I am SO inspired by what you've done with https://salaries.news.baltimoresun.com/ - that's pretty much my ideal use-case for Datasette, and it's by far the most elaborate customization I've seen so far. I'd love to hear other ideas that came up while building that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376592044 https://github.com/simonw/datasette/issues/185#issuecomment-376592044 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjU5MjA0NA== carlmjohnson 222245 2018-03-27T16:38:23Z 2018-03-27T16:38:23Z NONE

It would be nice to also allow arbitrary keys (maybe under a parent key called params or something to prevent conflicts). For our datasette project, we just have a bunch of dictionaries defined in the base template for things like site URL and column humanized names: https://github.com/baltimore-sun-data/salaries-datasette/blob/master/templates/base.html It would be cleaner if this were in the metadata.json.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376590265 https://github.com/simonw/datasette/issues/185#issuecomment-376590265 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjU5MDI2NQ== carlmjohnson 222245 2018-03-27T16:32:51Z 2018-03-27T16:32:51Z NONE

I think the templates themselves should be able to indicate if they want the inherited values or not. That way we could support arbitrary key/values and avoid the application code having special knowledge of license_url etc.

Yes, you could have metadata that works like metadata does currently and inherited_metadata that works with inheritance.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376589591 https://github.com/simonw/datasette/issues/185#issuecomment-376589591 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjU4OTU5MQ== simonw 9599 2018-03-27T16:30:51Z 2018-03-27T16:30:51Z OWNER

Also needed: the ability to unset metadata. If the root metadata specifies a license_url it should be possible to set "license_url": null on a child database or table. The current implementation will ignore null (or empty string) values and default to the top level value.

I think the templates themselves should be able to indicate if they want the inherited values or not. That way we could support arbitrary key/values and avoid the application code having special knowledge of license_url etc.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376587017 https://github.com/simonw/datasette/issues/185#issuecomment-376587017 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjU4NzAxNw== simonw 9599 2018-03-27T16:22:59Z 2018-03-27T16:22:59Z OWNER

One thing that's missing from this: if you set source/license data at the individual database level they should be inherited by tables within that database.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
376585911 https://github.com/simonw/datasette/issues/185#issuecomment-376585911 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3NjU4NTkxMQ== simonw 9599 2018-03-27T16:19:43Z 2018-03-27T16:19:43Z OWNER

OK, I have an implementation of this. I realised that not ALL metadata should be inherited: it makes sense for source/source_url/license/license_url to be inherited, but it doesn't make sense for the title and description to be inherited down to the individual databases and tables.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
370461231 https://github.com/simonw/datasette/issues/185#issuecomment-370461231 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3MDQ2MTIzMQ== carlmjohnson 222245 2018-03-05T15:43:56Z 2018-03-05T15:44:27Z NONE

Yes. I think the simplest implementation is to change lines like

python metadata = self.ds.metadata.get('databases', {}).get(name, {})

to

python metadata = { **self.ds.metadata, **self.ds.metadata.get('databases', {}).get(name, {}), }

so that specified inner values overwrite outer values, but only if they exist.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  
370273359 https://github.com/simonw/datasette/issues/185#issuecomment-370273359 https://api.github.com/repos/simonw/datasette/issues/185 MDEyOklzc3VlQ29tbWVudDM3MDI3MzM1OQ== simonw 9599 2018-03-04T23:10:56Z 2018-03-04T23:10:56Z OWNER

Are you talking specifically about accessing metadata from HTML templates? That makes a lot of sense, I'll think about how this could work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Metadata should be a nested arbitrary KV store 299760684  

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