dm (version 0.0.3.9003)

enum_pk_candidates: Which columns are candidates for a primary key column?

Description

enum_pk_candidates() checks for each column of a table if this column contains only unique values and is therefore a candidate for a primary key of this table.

cdm_enum_pk_candidates() performs these checks for a table in a dm object.

Usage

enum_pk_candidates(table)

cdm_enum_pk_candidates(dm, table)

Arguments

table

A table in the dm

dm

A dm object.

See Also

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

Examples

Run this code
# NOT RUN {
nycflights13::flights %>% enum_pk_candidates()

cdm_nycflights13() %>% cdm_enum_pk_candidates(flights)
cdm_nycflights13() %>% cdm_enum_pk_candidates(airports)
# }

Run the code above in your browser using DataCamp Workspace