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

refactor(codegen): remove golang and json settings from plugin proto #2822

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

andrewmbenton
Copy link
Collaborator

@andrewmbenton andrewmbenton commented Oct 11, 2023

In order to simplify the codegen plugin proto, I've removed the Go and JSON plugin settings and instead pass those settings encoded as JSON to their respective plugins.

I introduce a new struct type, opts in each codegen package, for deserialization of the passed settings. These are essentially the Go types formerly generated from the proto, but now isolated.

In order to simplify the codegen plugin proto, I've removed the Go
and JSON plugin settings and instead pass those settings encoded as
JSON to their respective plugins.
Comment on lines +111 to +113
enums := buildEnums(req, options)
structs := buildStructs(req, options)
queries, err := buildQueries(req, options, structs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think some of these funcs won't need to take the req as a param at all, once we figure out how to handle overrides and renames.

@andrewmbenton andrewmbenton marked this pull request as ready for review October 11, 2023 15:55
@andrewmbenton andrewmbenton merged commit 5ef20c6 into main Oct 11, 2023
8 checks passed
@andrewmbenton andrewmbenton deleted the andrew/codegen-opts-from-json branch October 11, 2023 19:14
This pull request was closed.
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