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/1528#issuecomment-988468238 | https://api.github.com/repos/simonw/datasette/issues/1528 | 988468238 | IC_kwDOBm6k_c466tQO | 30934 | 2021-12-08T03:35:45Z | 2021-12-08T03:35:45Z | NONE | FWIW I implemented something similar with a bit of plugin code: ```python @hookimpl def canned_queries(datasette: Datasette, database: str) -> Mapping[str, str]: # load "canned queries" from the filesystem under # www/sql/db/query_name.sql queries = {} sqldir = Path(__file__).parent.parent / "sql" if database: sqldir = sqldir / database if not sqldir.is_dir(): return queries for f in sqldir.glob('*.sql'): try: sql = f.read_text('utf8').strip() if not len(sql): log(f"Skipping empty canned query file: {f}") continue queries[f.stem] = { "sql": sql } except OSError as err: log(err) return queries ``` | { "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 } |
1060631257 | |
https://github.com/simonw/datasette/pull/2052#issuecomment-1722943484 | https://api.github.com/repos/simonw/datasette/issues/2052 | 1722943484 | IC_kwDOBm6k_c5msgf8 | 30934 | 2023-09-18T08:14:47Z | 2023-09-18T08:14:47Z | NONE | This is such a well thought out contribution. I don't think I've seen such a thoroughly considered PR on any project in recent memory. | { "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 } |
1651082214 |