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

Allow overwriting inserts #91

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Allow overwriting inserts #91

merged 2 commits into from
Oct 30, 2024

Conversation

bamader
Copy link
Collaborator

@bamader bamader commented Oct 29, 2024

Allow overwriting inserts

Summary

This PR modifies the INSERT statement of our InsertValueSet function to allow for duplicated uniqueIDs to overwrite those of existing entries. Our DB creation process will go through a fair number of duplicate value sets after pulling down the eRSD, so simply overwriting them with the same data will allow the seeding process to proceed more smoothly than error-ing and breaking the transaction.

Related Issue

Fixes #81

Additional Information

I created a test branch here https://github.com/CDCgov/dibbs-query-connector/tree/test-vs-overwrite that removes database seeding in migrations 2 through 6, and instead adds a button to the landing page that tests a couple cases of inserting valuesets and duplicates into the DB. No errors get thrown and viewing the DB in DBeaver shows all rows correctly entered.

@bamader bamader requested a review from m-goggins October 30, 2024 13:41
Copy link
Collaborator

@m-goggins m-goggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just want to get @DanPaseltiner to take a look to make sure we correctly understood what he wanted here.

@bamader bamader requested a review from DanPaseltiner October 30, 2024 15:49
@bamader
Copy link
Collaborator Author

bamader commented Oct 30, 2024

Adding Dan as a reviewer to get any thoughts

Copy link
Collaborator

@DanPaseltiner DanPaseltiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@bamader bamader merged commit 8cc0597 into main Oct 30, 2024
5 checks passed
@bamader bamader deleted the upsert-oid-valueset branch October 30, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change ValueSet insertion function to overwrite rather than error if duplicate entries are inserted
3 participants