# NOT RUN {
if (FALSE) {
  library(dplyr)
  src_sqlite <- dplyr::src_sqlite(":memory:", create = TRUE)
  iris_key <- mutate(iris, key = row_number())
  # setting key constraints currently doesn't work on
  # SQLite but this would be the code to set the PK
  # constraint on the DB
  iris_dm <- copy_dm_to(
    src_sqlite,
    dm(iris = iris_key),
    set_key_constraints = TRUE
  )
  # and this would be the code to learn
  # the `dm` from the SQLite DB
  iris_dm_learned <- dm_learn_from_db(src_sqlite)
}
# }
Run the code above in your browser using DataLab