{"html_url": "https://github.com/simonw/datasette/issues/1832#issuecomment-1267918117", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1832", "id": 1267918117, "node_id": "IC_kwDOBm6k_c5LkuUl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-05T04:19:52Z", "updated_at": "2022-10-05T04:19:52Z", "author_association": "OWNER", "body": "Code can go here:\r\n\r\nhttps://github.com/simonw/datasette/blob/b6ba117b7978b58b40e3c3c2b723b92c3010ed53/datasette/database.py#L511-L515\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1397193691, "label": "__bool__ method on Results"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1832#issuecomment-1267925830", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1832", "id": 1267925830, "node_id": "IC_kwDOBm6k_c5LkwNG", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-05T04:31:57Z", "updated_at": "2022-10-05T04:31:57Z", "author_association": "OWNER", "body": "Turns out this already works - `__bool__` falls back on `__len__`: https://docs.python.org/3/reference/datamodel.html#object.__bool__\r\n\r\n> When this method is not defined, [`__len__()`](https://docs.python.org/3/reference/datamodel.html#object.__len__ \"object.__len__\") is called, if it is defined, and the object is considered true if its result is nonzero.\r\n\r\nI'll add a test to demonstrate this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1397193691, "label": "__bool__ method on Results"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1824#issuecomment-1268398461", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1824", "id": 1268398461, "node_id": "IC_kwDOBm6k_c5Lmjl9", "user": {"value": 562352, "label": "CharlesNepote"}, "created_at": "2022-10-05T12:55:05Z", "updated_at": "2022-10-05T12:55:05Z", "author_association": "NONE", "body": "Here is some working javascript code. There might be better solution, I'm not a JS expert.\r\n```javascript\r\n var show_hide = document.querySelector(\".show-hide-sql > a\");\r\n\r\n // Hide SQL query if the URL opened with #_hide_sql\r\n var hash = window.location.hash;\r\n if(hash === \"#_hide_sql\") {\r\n hide_sql();\r\n }\r\n show_hide.setAttribute(\"href\", \"#\");\r\n show_hide.addEventListener(\"click\", toggle_sql_display);\r\n\r\n function toggle_sql_display() {\r\n if (show_hide.innerText === \"hide\") {\r\n hide_sql();\r\n return;\r\n }\r\n if (show_hide.innerText === \"show\") {\r\n show_sql();\r\n return;\r\n }\r\n }\r\n\r\n function hide_sql() {\r\n sql_element.style.cssText=\"display:none\";\r\n show_hide.innerHTML = \"show\";\r\n show_hide.setAttribute(\"href\", \"#_hide_sql\");\r\n }\r\n\r\n function show_sql() {\r\n sql_element.style.cssText=\"display:block\";\r\n show_hide.innerHTML = \"hide\";\r\n show_hide.setAttribute(\"href\", \"#_show_sql\");\r\n }\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1387712501, "label": "Convert &_hide_sql=1 to #_hide_sql"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1480#issuecomment-1268613335", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1480", "id": 1268613335, "node_id": "IC_kwDOBm6k_c5LnYDX", "user": {"value": 536941, "label": "fgregg"}, "created_at": "2022-10-05T15:45:49Z", "updated_at": "2022-10-05T15:45:49Z", "author_association": "CONTRIBUTOR", "body": "running into this as i continue to grow my labor data warehouse.\r\n\r\nHere a CloudRun PM says the container size should **not** count against memory: https://stackoverflow.com/a/56570717", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1015646369, "label": "Exceeding Cloud Run memory limits when deploying a 4.8G database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1480#issuecomment-1268629159", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1480", "id": 1268629159, "node_id": "IC_kwDOBm6k_c5Lnb6n", "user": {"value": 536941, "label": "fgregg"}, "created_at": "2022-10-05T16:00:55Z", "updated_at": "2022-10-05T16:00:55Z", "author_association": "CONTRIBUTOR", "body": "as a next step, i'll fetch the docker image from the google registry, and see what memory and disk usage looks like when i run it locally.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1015646369, "label": "Exceeding Cloud Run memory limits when deploying a 4.8G database"}, "performed_via_github_app": null}