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

Add LoadTypes method for bulk type registration #2036

Closed
ewhauser opened this issue May 30, 2024 · 2 comments
Closed

Add LoadTypes method for bulk type registration #2036

ewhauser opened this issue May 30, 2024 · 2 comments

Comments

@ewhauser
Copy link

ewhauser commented May 30, 2024

Is your feature request related to a problem? Please describe.

We are loading a large number of enums/custom domain objects (50+) using AfterConnect and LoadType as described in #1549. The LoadType method issues a SQL query for every type which is inefficient for a large number of enums as it makes a two SQL queries against the pg catalog.

Describe the solution you'd like

A LoadTypes method that takes an slice of strings and returns a slice of pgtype.Type pointers would allow for a single roundtrip to the database.

@ewhauser
Copy link
Author

Actually, depending on the type, there are 3-4 queries run per item

@jackc
Copy link
Owner

jackc commented May 31, 2024

Duplicate of #2030.

@jackc jackc closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
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

No branches or pull requests

2 participants