github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/860#issuecomment-733175454 | https://api.github.com/repos/simonw/datasette/issues/860 | 733175454 | MDEyOklzc3VlQ29tbWVudDczMzE3NTQ1NA== | 9599 | 2020-11-24T19:06:07Z | 2020-11-24T19:06:07Z | OWNER | I see two ways this plugin hook could work. It could be asked about a specific instance, database or table and return the full metadata for that object. OR it could ask for a specific metadata field - e.g. `source_url` for table X, and return that. The more finely grained one would allow plugins to implement their own cascading rules pretty easily. Is there a reason it would be better for the hook to return an entire block of JSON for a specific table or database? I also need to decide if this hook is just going to be about source/license/about displayed metadata, or if it will include the functionality that has been sneaking into `metadata.json` over time - stuff like page size, default sort order or default facets. Perhaps I should split those out into a "configuration" concept first, after renaming `--config` to `--setting` in #992. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
642651572 | |
https://github.com/simonw/datasette/issues/860#issuecomment-733287416 | https://api.github.com/repos/simonw/datasette/issues/860 | 733287416 | MDEyOklzc3VlQ29tbWVudDczMzI4NzQxNg== | 9599 | 2020-11-24T23:15:44Z | 2020-11-24T23:15:44Z | OWNER | I'm going to go with a plugin hook (and Datasette method) that returns individual values - so you ask it for e.g. the `license_url` for a specific table and it returns a string or `None`. The default plugin hook implementation that ships with Datasette will then implement cascading lookups against `metadata.json` - but other plugins will be able to provide their own implementations, which should make it easy to build a plugin that lets you keep metadata in a database file and edit it interactively. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
642651572 | |
https://github.com/simonw/datasette/issues/860#issuecomment-733287619 | https://api.github.com/repos/simonw/datasette/issues/860 | 733287619 | MDEyOklzc3VlQ29tbWVudDczMzI4NzYxOQ== | 9599 | 2020-11-24T23:16:21Z | 2020-11-24T23:16:21Z | OWNER | I'll also allow any key to be looked up - so if users want to invent their own metadata keys other than the default `license_url` etc they can do so. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
642651572 | |
https://github.com/simonw/datasette/issues/860#issuecomment-733288522 | https://api.github.com/repos/simonw/datasette/issues/860 | 733288522 | MDEyOklzc3VlQ29tbWVudDczMzI4ODUyMg== | 9599 | 2020-11-24T23:18:47Z | 2020-11-24T23:18:47Z | OWNER | In #942 I want to add support for per-column metadata - which means this new lookup mechanism will need to be able to answer the question "what description is available for this column". So what should the `.metadata()` method look like? A couple of options: - `datasette.metadata("description", table=x, database=y)` - can take optional `column=` too. - `datasette.table_metadata("description", table=x, database=y)` and `datasette.database_metadata("description", database=y)` and so on - multiple methods for the different types of metadata. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
642651572 | |
https://github.com/simonw/datasette/issues/860#issuecomment-733288841 | https://api.github.com/repos/simonw/datasette/issues/860 | 733288841 | MDEyOklzc3VlQ29tbWVudDczMzI4ODg0MQ== | 9599 | 2020-11-24T23:19:47Z | 2020-11-24T23:20:24Z | OWNER | Here's what I have today - it's an undocumented `datasette.metadata()` method that returns a full JSON dictionary of values OR a single value if the optional `key=` argument is provided: https://github.com/simonw/datasette/blob/f2e2bfcdd9ad4891f3f66c9104c09943d943ffe4/datasette/app.py#L357-L388 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
642651572 |