Learn R Programming

dm (version 0.1.0)

dm_has_fk: Check if foreign keys exists

Description

dm_has_fk() checks if a foreign key reference exists between two tables in a dm.

Usage

dm_has_fk(dm, table, ref_table)

Arguments

dm

A dm object.

table

A table in the dm.

ref_table

The table to be checked if it is referred to.

Value

A boolean value: TRUE if a reference from table to ref_table exists, FALSE otherwise.

See Also

Other foreign key functions: dm_add_fk(), dm_enum_fk_candidates(), dm_get_all_fks(), dm_get_fk()

Examples

Run this code
# NOT RUN {
dm_nycflights13() %>%
  dm_has_fk(flights, airports)
dm_nycflights13() %>%
  dm_has_fk(airports, flights)
# }

Run the code above in your browser using DataLab