dm (version 0.0.3.9003)

cdm_has_pk: Does a table of a dm object have a column set as primary key?

Description

cdm_has_pk() checks in the data_model part of the dm object if a given table has a column marked as primary key.

Usage

cdm_has_pk(dm, table)

Arguments

dm

A dm object.

table

A table in the dm

See Also

Other primary key functions: cdm_add_pk, cdm_get_all_pks, cdm_get_pk, cdm_rm_pk, enum_pk_candidates

Examples

Run this code
# NOT RUN {
library(dplyr)
nycflights_dm <- cdm_nycflights13()

nycflights_dm %>%
  cdm_has_pk(planes)
# }

Run the code above in your browser using DataLab