issue_comments: 1317475720
This data as json
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/pull/1893#issuecomment-1317475720 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317475720 | IC_kwDOBm6k_c5OhxWI | 9599 | 2022-11-16T18:25:16Z | 2022-11-16T18:25:16Z | OWNER | Here's a query that returns the exact JSON we need to pass to the schema: https://latest.datasette.io/_internal?sql=with+inner+as+%28%0D%0A++select%0D%0A++++table_name%2C%0D%0A++++json_group_array%28name%29+as+table_columns%0D%0A++from%0D%0A++++columns%0D%0A++where%0D%0A++++database_name+%3D+%3Adatabase%0D%0A++group+by%0D%0A++++table_name%0D%0A%29%0D%0Aselect%0D%0A++json_group_object%28table_name%2C+table_columns%29%0D%0Afrom%0D%0A++inner&database=fixtures ```sql with inner as ( select table_name, json_group_array(name) as table_columns from columns where database_name = :database group by table_name ) select json_group_object(table_name, table_columns) from inner ``` Returns (after pretty-printing): ```json { "123_starts_with_digits": [ "content" ], "Table With Space In Name": [ "content", "pk" ], "attraction_characteristic": [ "name", "pk" ], "binary_data": [ "data" ], "complex_foreign_keys": [ "f1", "f2", "f3", "pk" ], "compound_primary_key": [ "content", "pk1", "pk2" ], "compound_three_primary_keys": [ "content", "pk1", "pk2", "pk3" ], "custom_foreign_key_label": [ "foreign_key_with_custom_label", "pk" ], "facet_cities": [ "id", "name" ], "facetable": [ "_city_id", "_neighborhood", "complex_array", "created", "distinct_some_null", "n", "on_earth", "pk", "planet_int", "state", "tags" ], "foreign_key_references": [ "foreign_key_compound_pk1", "foreign_key_compound_pk2", "foreign_key_with_blank_label", "foreign_key_with_label", "foreign_key_with_no_label", "pk" ], "infinity": [ "value" ], "no_primary_key": [ "a", "b", "c", "content" ], "primary_key_multiple_columns": [ "content", "content2", "id" ], "primary_key_multiple_columns_explicit_label": [ "content", "content2", "id" ], "roadside_attraction_characteristics": [ "attraction_id", "characteristic_id" ], "roadside_attractions": [ "address", "latitude", "longitude", "name", "pk", "url" ], "searchable": [ "name with . and spaces", "pk", "text1", "text2" ], "searchable_fts": [ "__langid", "docid", "name with . and spaces", "searchable_fts", "text1", "text2" ], "searchable_fts_docsize": [ "docid", "size" ], "searchable_fts_segdir": [ "end_block", "idx", "leaves_end_block", "level", "root", "start_block" ], "searchable_fts_segments": [ "block", "blockid" ], "searchable_fts_stat": [ "id", "value" ], "searchable_tags": [ "searchable_id", "tag" ], "select": [ "and", "group", "having", "json" ], "simple_primary_key": [ "content", "id" ], "sortable": [ "content", "pk1", "pk2", "sortable", "sortable_with_nulls", "sortable_with_nulls_2", "text" ], "table/with/slashes.csv": [ "content", "pk" ], "tags": [ "tag" ], "units": [ "distance", "frequency", "pk" ] } ``` | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1450363982 |