Don't use SELECT * when joining profile tables #3130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This patch has no functional changes, it is just a cleanup in our Go
database models that I didn't want to send before the recent release.
If sqlc generates a model for a query that joins over two tables, it
autogenerates column names that are represented as structure members, so
you end up with a single structure with members such as
ID
andID_2
.This can be confusing and invite bugs. It's much cleaner to use
sqlc.embed
to make sure that each table is represented by a separateattribute in the models.
Change Type
Mark the type of change your PR introduces:
Testing
There is no tests for this functionality /right now in main/ but there are tests added in PR #2990, so maybe that one should go first.
Review Checklist: