Lists the columns of a data dictionary that a documentation file (the
README, a data report) never mentions as `column`. Run it in the
sanity check: the README documents every table and column, and must
follow the schema when a column is added.
Arguments
- dictionary
A data dictionary from
schema_dictionary(), or a schema (named list ofCREATE TABLEstatements).- doc
Character. Path of the documentation file (Markdown or Quarto).
Details
The check is deliberately simple: a column counts as documented when its
name appears between backticks anywhere in the file. A column name shared
by several tables (doc_id) is therefore documented once for all.
See also
Other schema:
add_missing_columns(),
check_schema(),
create_schema(),
schema_dictionary(),
schema_markdown()
Examples
schema <- list(document = "
CREATE TABLE IF NOT EXISTS document (doc_id VARCHAR, year INTEGER)")
readme <- tempfile(fileext = ".md")
writeLines("| `doc_id` | identifier |", readme)
check_documented_columns(schema, readme)
#> ✔ Every column of the schema is documented in file799806e6d0bea.md.
#> Empty data.table (0 rows and 2 cols): table,column