{"html_url": "https://github.com/simonw/datasette/pull/1204#issuecomment-951731255", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1204", "id": 951731255, "node_id": "IC_kwDOBm6k_c44ukQ3", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-10-26T09:01:28Z", "updated_at": "2021-10-26T09:01:28Z", "author_association": "NONE", "body": "> Writing the tests will be a bit tricky since we need to confirm that the `include_table_top(datasette, database, actor, table)` arguments were all passed correctly but the only thing we get back from the plugin is a list of templates. Maybe encode those values into the template names somehow?\r\n\r\nWhy not return a data structure instead of just a template name?\r\n\r\nI've already done some custom hacking to modify datasette but the plugin mechanism you are building here would be much cleaner than what I've built. I'd be happy to help with testing this PR and fleshing it out further if you are still considering merging this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 793002853, "label": "WIP: Plugin includes"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/878#issuecomment-951740637", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/878", "id": 951740637, "node_id": "IC_kwDOBm6k_c44umjd", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-10-26T09:12:15Z", "updated_at": "2021-10-26T09:12:15Z", "author_association": "NONE", "body": "This sounds really ambitious but also really awesome. I like the idea that basically any piece of a page could be selectively replaced.\r\n\r\nIt sort of sounds like a python asyncio version of https://github.com/observablehq/runtime", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 648435885, "label": "New pattern for views that return either JSON or HTML, available for plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1532#issuecomment-981966693", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1532", "id": 981966693, "node_id": "IC_kwDOBm6k_c46h59l", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-11-29T19:56:52Z", "updated_at": "2021-11-29T19:56:52Z", "author_association": "NONE", "body": "FWIW I've written some web components that consume the json api and I think it's a really nice way to work with datasette. I like the combination with datasette+sqlite as a back-end feeding data to a front-end that's entirely javascript + html.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1065429936, "label": "Use datasette-table Web Component to guide the design of the JSON API for 1.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1304#issuecomment-981980048", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1304", "id": 981980048, "node_id": "IC_kwDOBm6k_c46h9OQ", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-11-29T20:13:53Z", "updated_at": "2021-11-29T20:14:11Z", "author_association": "NONE", "body": "There isn't any way to do this with sqlite as far as I know. The only option is to insert the right number of ? placeholders into the sql template and then provide an array of values.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 863884805, "label": "Document how to send multiple values for \"Named parameters\" "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1532#issuecomment-982745406", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1532", "id": 982745406, "node_id": "IC_kwDOBm6k_c46k4E-", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-11-30T15:28:57Z", "updated_at": "2021-11-30T15:28:57Z", "author_association": "NONE", "body": "It's a really great API and the documentation is really great too. Honestly, in more than 20 years of professional experience, I haven't worked with any software API that was more of a joy to use. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1065429936, "label": "Use datasette-table Web Component to guide the design of the JSON API for 1.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1304#issuecomment-988461884", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1304", "id": 988461884, "node_id": "IC_kwDOBm6k_c466rs8", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-12-08T03:20:26Z", "updated_at": "2021-12-08T03:20:26Z", "author_association": "NONE", "body": "The easiest or most straightforward thing to do is to use named parameters like:\r\n\r\n```sql\r\nselect * where key IN (:p1, :p2, :p3)\r\n```\r\n\r\nAnd simply construct the list of placeholders dynamically based on the number of values.\r\n\r\nDoing this is possible with datasette if you forgo \"canned queries\" and just use the raw query endpoint and pass the query sql, along with p1, p2 ... in the request.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 863884805, "label": "Document how to send multiple values for \"Named parameters\" "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1304#issuecomment-988463455", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1304", "id": 988463455, "node_id": "IC_kwDOBm6k_c466sFf", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-12-08T03:23:14Z", "updated_at": "2021-12-08T03:23:14Z", "author_association": "NONE", "body": "I actually think it would be a useful thing to add support for in datasette. It wouldn't be difficult to unwind an array of params and add the placeholders automatically.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 863884805, "label": "Document how to send multiple values for \"Named parameters\" "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1528#issuecomment-988468238", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1528", "id": 988468238, "node_id": "IC_kwDOBm6k_c466tQO", "user": {"value": 30934, "label": "20after4"}, "created_at": "2021-12-08T03:35:45Z", "updated_at": "2021-12-08T03:35:45Z", "author_association": "NONE", "body": "FWIW I implemented something similar with a bit of plugin code:\r\n\r\n```python\r\n@hookimpl\r\ndef canned_queries(datasette: Datasette, database: str) -> Mapping[str, str]:\r\n # load \"canned queries\" from the filesystem under\r\n # www/sql/db/query_name.sql\r\n queries = {}\r\n\r\n sqldir = Path(__file__).parent.parent / \"sql\"\r\n if database:\r\n sqldir = sqldir / database\r\n\r\n if not sqldir.is_dir():\r\n return queries\r\n\r\n for f in sqldir.glob('*.sql'):\r\n try:\r\n sql = f.read_text('utf8').strip()\r\n if not len(sql):\r\n log(f\"Skipping empty canned query file: {f}\")\r\n continue\r\n queries[f.stem] = { \"sql\": sql }\r\n except OSError as err:\r\n log(err)\r\n\r\n return queries\r\n\r\n\r\n\r\n```", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1060631257, "label": "Add new `\"sql_file\"` key to Canned Queries in metadata?"}, "performed_via_github_app": null}