Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide way to check referential integrity #56

Closed
krlmlr opened this issue Sep 14, 2019 · 2 comments · Fixed by #82
Closed

Provide way to check referential integrity #56

krlmlr opened this issue Sep 14, 2019 · 2 comments · Fixed by #82
Assignees
Milestone

Comments

@krlmlr
Copy link
Collaborator

krlmlr commented Sep 14, 2019

After b23b969, we need an easy way to check integrity of all pk and fk constraints, with an option to show where integrity is violated:

  • one function that returns a data frame with results of the integrity check
  • one function that throws an error if integrity is violated, calls the first function

What's a good name?

@krlmlr krlmlr changed the title Provide way to check Provide way to check referential integrity Sep 14, 2019
@krlmlr krlmlr added this to the 0.0.3 milestone Sep 19, 2019
@krlmlr
Copy link
Collaborator Author

krlmlr commented Sep 19, 2019

Code snippet:

cdm_check_constraints <- function(dm) {
  pks <- cdm_get_all_pks()
  pk_results <- pmap(pks, ~ is_unique_key(...))
  fks <- cdm_get_all_fks()
  fk_results <- pmap(fks, ~ is_subset(...))

  list(
    pk = pk_results,
    fk = fk_results
  )
}

Needs #24 for consistent output.

@krlmlr krlmlr closed this as completed in #82 Oct 8, 2019
krlmlr added a commit that referenced this issue Oct 8, 2019
- New `cdm_check_constraints()` to check referential integrity of a `dm` (#56).
@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants