{"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686163754", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686163754, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjE2Mzc1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T00:46:21Z", "updated_at": "2020-09-03T00:46:21Z", "author_association": "MEMBER", "body": "Challenge: the `dogsheep-beta.yml` configuration file that is passed to the `dogsheep-beta index` command needs to also be made available to Datasette itself, so that it can read the configuration.\r\n\r\nLet's say it can either be duplicated in the `plugins` configuration block of the `metadata.yml` OR you can do this in `metadata.yml`:\r\n\r\n```yaml\r\nplugins:\r\n dogsheep-beta:\r\n config_file: dogsheep-beta.yml\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686767208", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686767208, "node_id": "MDEyOklzc3VlQ29tbWVudDY4Njc2NzIwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T21:12:14Z", "updated_at": "2020-09-03T21:12:14Z", "author_association": "MEMBER", "body": "Documentation: https://github.com/dogsheep/dogsheep-beta/blob/0.4/README.md#custom-results-display", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686688963", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686688963, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjY4ODk2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T18:42:59Z", "updated_at": "2020-09-03T18:42:59Z", "author_association": "MEMBER", "body": "I'm pleased with how this works now.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686154627", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686154627, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjE1NDYyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T00:19:22Z", "updated_at": "2020-09-03T00:19:22Z", "author_association": "MEMBER", "body": "If this performs well enough (100 displayed items will be 100 extra `display_sql` calls) then I'll go with this as the design for the feature.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686158454", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686158454, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjE1ODQ1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T00:32:42Z", "updated_at": "2020-09-03T00:32:42Z", "author_association": "MEMBER", "body": "If this turns out to be too inefficient I could add a `display` text column to the `search_index` table which is designed to be populated with arbitrary JSON by the indexing query, which can then be used to render the template fragment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686153967", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686153967, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjE1Mzk2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T00:17:16Z", "updated_at": "2020-09-03T00:17:55Z", "author_association": "MEMBER", "body": "Maybe I can take advantage of https://sqlite.org/np1queryprob.html here - I could define a SQL query for fetching the \"display\" version of each item, and include a Jinja template fragment in the configuration as well. Maybe something like this:\r\n```yaml\r\nphotos.db:\r\n photos_with_apple_metadata:\r\n sql: |-\r\n select\r\n sha256 as key,\r\n 'Photo in ' || coalesce(place_city, 'unknown') as title,\r\n (\r\n select\r\n group_concat(normalized_string, ' ')\r\n from\r\n labels\r\n where\r\n labels.uuid = photos_with_apple_metadata.uuid\r\n ) as search_1,\r\n date as timestamp,\r\n 1 as category\r\n from\r\n photos_with_apple_metadata\r\n display_sql: |-\r\n select\r\n sha256, place_city, date\r\n from photos_with_apple_metadata\r\n where sha256 = :key\r\n display: |-\r\n \r\n

Taken in {{ display.place_city }} on {{ display.date }}

\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686689122", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686689122, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjY4OTEyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T18:43:20Z", "updated_at": "2020-09-03T18:43:20Z", "author_association": "MEMBER", "body": "Needs documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/9#issuecomment-686154486", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/9", "id": 686154486, "node_id": "MDEyOklzc3VlQ29tbWVudDY4NjE1NDQ4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-03T00:18:54Z", "updated_at": "2020-09-03T00:18:54Z", "author_association": "MEMBER", "body": "`display_sql` could be optional. If it's not defined, a `row` object is passed to the template which is the row that's stored in `search_index`. If `display_sql` IS defined then it's executed and the result is made available as a `display` object in addition to the `row` object.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 691521965, "label": "Mechanism for defining custom display of results"}, "performed_via_github_app": null}