dm_has_pk()
checks if a given table has columns marked as its primary key.
dm_has_pk(dm, table, ...)
A dm
object.
A table in the dm
.
These dots are for future extensions and must be empty.
A logical value: TRUE
if the given table has a primary key, FALSE
otherwise.
Other primary key functions:
dm_add_pk()
,
dm_get_all_pks()
,
dm_rm_pk()
,
enum_pk_candidates()
dm_nycflights13() %>%
dm_has_pk(flights)
#> [1] FALSE
dm_nycflights13() %>%
dm_has_pk(planes)
#> [1] TRUE