dm_get_all_uks: Get all unique keys of a 'dm' object

View source: R/unique-keys.R

dm_get_all_uksR Documentation

Get all unique keys of a dm object

Description

dm_get_all_uks() checks the dm object for unique keys (primary keys, explicit and implicit unique keys) and returns the tables and the respective unique key columns.

Usage

dm_get_all_uks(dm, table = NULL, ...)

Arguments

dm

A dm object.

table

One or more table names, unquoted, to return unique key information for. The default NULL returns information for all tables.

...

These dots are for future extensions and must be empty.

Details

There are 3 kinds of unique keys:

  • PK: Primary key, set by dm_add_pk()

  • ⁠explicit UK⁠: Unique key, set by dm_add_uk()

  • ⁠implicit UK⁠: Unique key, not explicitly set, but referenced by a foreign key.

Value

A tibble with the following columns:

table

table name,

uk_col

column name(s) of primary key, as list of character vectors,

kind

kind of unique key, see details.

See Also

Other primary key functions: dm_add_pk(), dm_add_uk(), dm_get_all_pks(), dm_has_pk(), dm_rm_pk(), dm_rm_uk(), enum_pk_candidates()

Examples


dm_nycflights13() %>%
  dm_get_all_uks()


dm documentation built on Nov. 2, 2023, 6:07 p.m.