dm_get_fk() returns the names of the
columns marked as foreign key of table
table with respect to table
ref_table within a
If no foreign key is set between the tables, an empty character vector is returned.
dm_get_fk(dm, table, ref_table)
A table in the
The table that is referenced from
A list of character vectors with the column name(s) of
pointing to the primary key of
Currently, keys consisting of more than one column are not supported. This feature is planned for dm 0.2.0. Therefore the function may return vectors of length greater than one in the future.
dm_nycflights13() %>% dm_get_fk(flights, airports)#> <list_of<character>> #> [] #>  "origin" #>dm_nycflights13(cycle = TRUE) %>% dm_get_fk(flights, airports)#> <list_of<character>> #> [] #>  "origin" #> #> [] #>  "dest" #>