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

Copy batches into db #50

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Copy batches into db #50

merged 2 commits into from
Dec 6, 2023

Conversation

southeo
Copy link
Contributor

@southeo southeo commented Dec 5, 2023

Uses postgres copy to batch insert values into temp tables

Temp tables now have the following name pattern: given source system ID TEST/ABC-123-XYZ, the table names will be:
abc_123_xyz_dwc_identification, abc_123_xyz_gbif_multimedia, etc. We also replace "/" and "." characters with "_".

The above characters are illegal in postgres table names, and the sql statement couldn't recognize capitalized table names (would get error messages like "the table ABC_123_XYZ_dwc_identification does not exist"). Not 100% sure how these tables were able to have these names, probably some fancy jooq abstraction we can't use with postgres copy.

On an exception, we rollback all the temp tables and log the sql error.

Jira

Copy link

sonarcloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

89.5% 89.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@samleeflang samleeflang left a comment

Choose a reason for hiding this comment

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

🐎

@southeo southeo merged commit f8b6d4c into main Dec 6, 2023
3 checks passed
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.

2 participants