Formats a data dictionary as one Markdown table per database table, ready
to paste into a README or to print in a Quarto report (chunk option
output: asis).
Arguments
- dictionary
A
data.tablefromschema_dictionary().- tables
Character or
NULL. Tables to include;NULLfor all.- heading_level
Integer. Level of the heading written above each table (
0for no heading).
Value
A character string (print it with cat()).
Examples
schema <- list(document = "
CREATE TABLE IF NOT EXISTS document (
doc_id VARCHAR, -- <source>:<source_id>
year INTEGER -- year of publication
)")
cat(schema_markdown(schema_dictionary(schema)))
#> ### `document`
#>
#> | Column | Type | Description |
#> |---|---|---|
#> | `doc_id` | VARCHAR | <source>:<source_id> |
#> | `year` | INTEGER | year of publication |