Learn R Programming

dm (version 0.0.6.9000)

dm_has_pk: Does a table of a dm object have columns set as primary key?

Description

dm_has_pk() checks if a given table has columns marked as its primary key.

Usage

dm_has_pk(dm, table)

Arguments

dm

A dm object.

table

A table in the dm.

Value

A logical value: TRUE if the given table has a primary key, FALSE otherwise.

See Also

Other primary key functions: dm_add_pk(), dm_get_all_pks(), dm_get_pk(), enum_pk_candidates()

Examples

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

nycflights_dm %>%
  dm_has_pk(planes)
# }

Run the code above in your browser using DataLab