Skip to contents

Check referential integrity (child FK -> parent PK)

Usage

check_referential_integrity(child, parent, child_key, parent_key)

Arguments

child

Data frame with foreign key.

parent

Data frame with primary key.

child_key, parent_key

Column names.

Value

A logical scalar.

Examples

child <- data.frame(fk = c(1, 2, 3))
parent <- data.frame(pk = c(1, 2, 3, 4))
res <- check_referential_integrity(child, parent, "fk", "pk")
res$passed
#> [1] TRUE