% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/primary-keys.R
\name{dm_has_pk}
\alias{dm_has_pk}
\title{Check for primary key}
\usage{
dm_has_pk(dm, table, ...)
}
\arguments{
\item{dm}{A \code{dm} object.}

\item{table}{A table in the \code{dm}.}

\item{...}{These dots are for future extensions and must be empty.}
}
\value{
A logical value: \code{TRUE} if the given table has a primary key, \code{FALSE} otherwise.
}
\description{
\code{dm_has_pk()} checks if a given table has columns marked as its primary key.
}
\examples{
\dontshow{if (rlang::is_installed("nycflights13")) withAutoprint(\{ # examplesIf}
dm_nycflights13() \%>\%
  dm_has_pk(flights)
dm_nycflights13() \%>\%
  dm_has_pk(planes)
\dontshow{\}) # examplesIf}
}
\seealso{
Other primary key functions:
\code{\link[=dm_add_pk]{dm_add_pk()}},
\code{\link[=dm_add_uk]{dm_add_uk()}},
\code{\link[=dm_get_all_pks]{dm_get_all_pks()}},
\code{\link[=dm_get_all_uks]{dm_get_all_uks()}},
\code{\link[=dm_rm_pk]{dm_rm_pk()}},
\code{\link[=dm_rm_uk]{dm_rm_uk()}},
\code{\link[=enum_pk_candidates]{enum_pk_candidates()}}
}
\concept{primary key functions}
