dm_get_fk()
returns the names of the
columns marked as foreign key of table table
with respect to table ref_table
within a dm
object.
If no foreign key is set between the tables, an empty character vector is returned.
dm_get_fk(dm, table, ref_table)
dm | A |
---|---|
table | A table in the |
ref_table | The table that is referenced from |
A list of character vectors with the column name(s) of table
,
pointing to the primary key of ref_table
.
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.
Other foreign key functions:
dm_add_fk()
,
dm_enum_fk_candidates()
,
dm_get_all_fks()
,
dm_has_fk()
#> <list_of<character>[1]> #> [[1]] #> [1] "origin" #>#> <list_of<character>[2]> #> [[1]] #> [1] "origin" #> #> [[2]] #> [1] "dest" #>