{"id": 1504352503, "node_id": "I_kwDOBm6k_c5Zqpj3", "number": 1968, "title": "Allow to hide some queries in metadata.yml", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "open", "locked": 0, "assignee": null, "milestone": null, "comments": 0, "created_at": "2022-12-20T10:45:41Z", "updated_at": "2022-12-20T10:45:41Z", "closed_at": null, "author_association": "NONE", "pull_request": null, "body": "By default all queries are displayed.\r\n\r\nBut there are many cases where it would be interesting to hide the queries by default:\r\n* the website is targeting non-tech people\r\n* the query is veeeeeery long ([eg.](https://mirabelle.openfoodfacts.org/products/energy_calculator))\r\n* reading the query is not important for the users, they only want to see the result\r\n\r\nOf course, the user still could have the option to see the query.\r\n\r\nIt could be an option in the metadata file:\r\n```yml\r\ndatabases:\r\n awesome_db:\r\n tables:\r\n products:\r\n hide_sql: true\r\n queries:\r\n great_query:\r\n hide_sql: true\r\n sql: select * from products where code = :barcode\r\n```\r\n\r\nThe priority could be:\r\n* no option in the metadata and nothing in the URL: query displayed\r\n* hide_sql in the metadata and nothing in the URL: query displayed as asked in the metadata\r\n* hide_sql in the metadata and &_hide_sql= in the URL: query as asked in the URL\r\n\r\nSee also: #1824\r\n", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1968/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": null} {"id": 1424378012, "node_id": "I_kwDOBm6k_c5U5kic", "number": 1860, "title": "SQL query field can't begin by a comment", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 12, "created_at": "2022-10-26T16:55:31Z", "updated_at": "2022-10-27T18:57:37Z", "closed_at": "2022-10-27T04:21:40Z", "author_association": "NONE", "pull_request": null, "body": "![image](https://user-images.githubusercontent.com/562352/198085197-f26fcd61-4dac-4ca4-a346-e70f88a30ecc.png)\r\n\r\nSQL comments are **very** useful to explain the meaning of the query. It's currently impossible to put it at the beginning of the field as seen on the screen capture: it leads to an error: `Statement must be a SELECT`.\r\n\r\nIt would be great to make it possible because:\r\n* as the request is the title of the page:\r\n * it eases the search with search engines\r\n * it eases the search in the browsers' url field\r\n* it acts as a kind of title: the global meaning of the query is immediately understandable\r\n* some tools, such as Slack, are shortening long URLs and displaying the beginning of the URLs (eg. `https://example.org/products?sql=select+%28length%28data_quality_errors_ta[...]+%21%3D+%22%22+group+by+NB_of_issues+order+by+NB_of_issues+desc+limit+200`)\r\n\r\nBeginning a query with a comment is possible with SQLite.\r\n", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1860/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"} {"id": 1387712501, "node_id": "I_kwDOBm6k_c5Sts_1", "number": 1824, "title": "Convert &_hide_sql=1 to #_hide_sql", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "open", "locked": 0, "assignee": null, "milestone": null, "comments": 1, "created_at": "2022-09-27T12:53:31Z", "updated_at": "2022-10-05T12:56:27Z", "closed_at": null, "author_association": "NONE", "pull_request": null, "body": "Hiding the SQL textarea with `&_hide_sql=1` enforces a page reload, which can take several seconds and use server resource (which is annoying for big database or complex queries).\r\n\r\nIt could probably be done with a few lines of Javascript (I'm going to see if I can do that).", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1824/reactions\", \"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": null} {"id": 1363552780, "node_id": "I_kwDOBm6k_c5RRioM", "number": 1805, "title": "truncate_cells_html does not work for links?", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "open", "locked": 0, "assignee": null, "milestone": null, "comments": 7, "created_at": "2022-09-06T16:41:29Z", "updated_at": "2022-10-03T09:18:06Z", "closed_at": null, "author_association": "NONE", "pull_request": null, "body": "We have many links inside our dataset (please don't blame us ;-).\r\n\r\nWhen I use `--settings truncate_cells_html 60` it is not working for the links.\r\n\r\nEg. https://images.openfoodfacts.org/images/products/000/000/000/088/nutrition_fr.5.200.jpg (87 chars) is not truncated:\r\n![image](https://user-images.githubusercontent.com/562352/188689045-1946d776-2305-47cf-bfc5-b5685b9206b7.png)\r\n\r\nIMHO It would make sense that links should be treated as HTML. The link should work of course, but Datasette could truncate it:\r\n[https://images.openfoodfacts.org/images/products/00[...].jpg](https://images.openfoodfacts.org/images/products/000/000/000/088/nutrition_fr.5.200.jpg)\r\n\r\n", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1805/reactions\", \"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "reopened"} {"id": 1375792876, "node_id": "I_kwDOBm6k_c5SAO7s", "number": 1811, "title": "Drop-down menu with \"REGEXP\" choice", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "open", "locked": 0, "assignee": null, "milestone": null, "comments": 0, "created_at": "2022-09-16T11:06:18Z", "updated_at": "2022-09-16T15:30:31Z", "closed_at": null, "author_association": "NONE", "pull_request": null, "body": "Drop-down menu below could add \"REGEXP\" choice when REGEXP sqlite extension is installed and used\r\n![image](https://user-images.githubusercontent.com/562352/190675352-810fbdca-0827-4034-8b9f-fd67d5c35afb.png)\r\n\r\nNot sure. Close the issue if you don't find it relevant.", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1811/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": null} {"id": 1359557737, "node_id": "I_kwDOBm6k_c5RCTRp", "number": 1798, "title": "Parts of YAML file do not work when db name is \"off\"", "user": {"value": 562352, "label": "CharlesNepote"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 4, "created_at": "2022-09-01T22:10:57Z", "updated_at": "2022-09-02T00:02:53Z", "closed_at": "2022-09-01T23:56:33Z", "author_association": "NONE", "pull_request": null, "body": "I guess this issue is not very important and probably rare.\r\n\r\nTo reproduce:\r\n* create and populate a db named `off.db`\r\n* in the yaml file, add any kind of information below `databases:\\n off:`\r\n* the data are not taken into account (because \"off\" is interpreted as \"false\")\r\n\r\nYAML file:\r\n```yaml\r\ntitle: Some title\r\ndescription_html: |-\r\n

This is an experiment.

\r\ndatabases:\r\n off:\r\n tables:\r\n products_from_owners:\r\n title: products_from_owners*\r\n description_html: |-\r\n

Description

\r\n```\r\n\r\nThe result for http://xxxx.xxx/-/metadata gives:\r\n```json\r\n{\r\n \"title\": \"Some title\",\r\n \"description_html\": \"

This is an experiment.

\",\r\n \"databases\": {\r\n \"false\": {\r\n \"tables\": {\r\n \"products_from_owners\": {\r\n \"title\": \"products_from_owners*\",\r\n \"description_html\": \"

Description

\"\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n=> see the `\"false\"` instead of `\"off\"`.", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/1798/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"}