{"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319570586", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319570586, "node_id": "IC_kwDOBm6k_c5Opwya", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T05:33:20Z", "updated_at": "2022-11-18T05:33:20Z", "author_association": "OWNER", "body": "One of the big changes still left to do for Datasette 1.0 is to unify the JSON representation with the context psssed to the templates (via an `?_extra=` mechanism to add extra context needed by the HTML templates), because a goal for 1.0 is for the template context to be a documented API contract such that custom templates won't break with future releases.\r\n\r\nAs such I expect to do quite a bit of refactoring and cleanup on how the template context works later on.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319533445", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319533445, "node_id": "IC_kwDOBm6k_c5OpnuF", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-18T04:38:03Z", "updated_at": "2022-11-18T04:38:03Z", "author_association": "CONTRIBUTOR", "body": "Are you tracking the change to send the JSON over to the frontend separately or was that part of this? Something like this is probably pretty close https://github.com/bgrins/datasette/commit/8431c98850c7a552dbcde2a4dd0c3dc942a97d25#diff-0c93232bfd5477eeac96382e52769108b41433d960d5277ffcccf2f464e60abdR9", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319478811", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319478811, "node_id": "IC_kwDOBm6k_c5OpaYb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T02:53:57Z", "updated_at": "2022-11-18T02:53:57Z", "author_association": "OWNER", "body": "I decided to just go for the view names, not their columns.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319477721", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319477721, "node_id": "IC_kwDOBm6k_c5OpaHZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T02:51:40Z", "updated_at": "2022-11-18T02:51:40Z", "author_association": "OWNER", "body": "Views aren't currently available in the `_internal` schema.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319435374", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319435374, "node_id": "IC_kwDOBm6k_c5OpPxu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T01:33:30Z", "updated_at": "2022-11-18T01:33:30Z", "author_association": "OWNER", "body": "Just noticed that this isn't including views, which it should.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1897#issuecomment-1319401843", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1897", "id": 1319401843, "node_id": "IC_kwDOBm6k_c5OpHlz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T00:42:03Z", "updated_at": "2022-11-18T00:42:23Z", "author_association": "OWNER", "body": "This function works even if the SQLite JSON functions are not available:\r\n\r\n```python\r\nasync def _table_columns(datasette, database_name):\r\n internal = datasette.get_database(\"_internal\")\r\n result = await internal.execute(\r\n \"select table_name, name from columns where database_name = ?\",\r\n [database_name],\r\n )\r\n table_columns = {}\r\n for row in result.rows:\r\n table_columns.setdefault(row[\"table_name\"], []).append(row[\"name\"])\r\n return table_columns\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452457263, "label": "Serve schema JSON to the SQL editor to enable autocomplete"}, "performed_via_github_app": null}