Skip to content

feat(web): generate table + column descriptions for Datasette's `metadata.json`

I.e.

{
	"databases": {
		"dmd": {
			"tables": {
				"sboms_endoflife": {
					"description_html": "<code>sboms_endoflife</code> contains a mapping between packages found in the <code>sboms</code> table, and <code>endoflifedate_products</code>. <br> <br> This table is a utility table, and is expected to be `JOIN`d to other tables. See <code>endoflifedate_products</code> for more details.",
					"columns": {
						"package_name": "what package is this? <br> Foreign key: <code>sboms.package_name</code>"
					}
				}
			}
		}
	}
}

Shows:

2024-04-16-120737_906x292_scrot

Note that the column headers aren't HTML, so should probably be the first line of the description

Note this should be merged in with a provided --metadata flag

If --debug'd, log the generated config to the console

Edited by Jamie Tanna