dm_examine_constraints {dm}R Documentation

Validate your data model

Description

This function returns a tibble with information about which key constraints are met (is_key = TRUE) or violated (FALSE). The printing for this object is special, use as_tibble() to print as a regular tibble.

Usage

dm_examine_constraints(
  .dm,
  ...,
  .progress = NA,
  dm = deprecated(),
  progress = deprecated()
)

Arguments

.dm

A dm object.

...

These dots are for future extensions and must be empty.

.progress

Whether to display a progress bar, if NA (the default) hide in non-interactive mode, show in interactive mode. Requires the 'progress' package.

dm, progress

[Deprecated]

Details

For the primary key constraints, it is tested if the values in the respective columns are all unique. For the foreign key constraints, the tests check if for each foreign key constraint, the values of the foreign key column form a subset of the values of the referenced column.

Value

A tibble with the following columns:

table

the table in the dm,

kind

"PK" or "FK",

columns

the table columns that define the key,

ref_table

for foreign keys, the referenced table,

is_key

logical,

problem

if is_key = FALSE, the reason for that.

Examples


dm_nycflights13() %>%
  dm_examine_constraints()


[Package dm version 1.0.10 Index]