dm (version 0.0.3.9003)

cdm_check_constraints: Validate your dm: are all key constraints met?

Description

This function returns a tibble with information, which key constraints are met (is_key = TRUE) or violated (FALSE).

Usage

cdm_check_constraints(dm)

Arguments

dm

A dm object.

Value

A tibble with 5 columns:

  1. table: the table in the dm

  2. kind: "PK" or "FK"

  3. column: column of table

  4. is_key: logical

  5. problem: in case is_key = FALSE the reason for that

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 are a subset of those of the referenced column.

Examples

Run this code
# NOT RUN {
cdm_check_constraints(cdm_nycflights13())
# }

Run the code above in your browser using DataLab