validate_fk: Validate foreign key column

View source: R/keys.R

validate_fkR Documentation

Validate foreign key column

Description

Checks if a foreign key column exists in the reference table and ensures make all values in the foreign key column match the existing values in the primary key column of the referenced table.

Usage

validate_fk(table_pk, name_pk, table_fk, name_fk)

Arguments

table_pk

A data frame that represents the table containing the primary key.

name_pk

A string indicating the name of the table to which reference.

table_fk

A data frame that represents the table containing the foreign key.

name_fk

A character string indicating the name of the reference table.

Value

'TRUE'. Generates warnings if the foreign key column is missing from the reference table or if it contains values that are not present in the column primary key of the referenced table.


tab2xml documentation built on April 4, 2025, 12:36 a.m.