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 edgeql to go code generator #236

Merged
merged 16 commits into from
Oct 24, 2022
Merged

Add edgeql to go code generator #236

merged 16 commits into from
Oct 24, 2022

Conversation

fmoor
Copy link
Member

@fmoor fmoor commented Aug 5, 2022

This change implements the default behavior outlined in edgedb/edgedb#4244. All arguments and options to the generator command are left for future work along with query hashing.

The documentation, help text, and cmd/edgeql-go/testdata directory may be areas of interest for reviewers.

This is related to #182

@fmoor
Copy link
Member Author

fmoor commented Aug 5, 2022

Is edgeql-go an appropriate name for the go codegen binary?

cc @1st1 @colinhacks

@fmoor fmoor requested a review from elprans August 6, 2022 00:02
@fmoor
Copy link
Member Author

fmoor commented Aug 6, 2022

This PR still needs tests added.

@fmoor
Copy link
Member Author

fmoor commented Aug 16, 2022

Ready for review

@fmoor
Copy link
Member Author

fmoor commented Aug 24, 2022

@divan and anyone else that would like, we would love to have early feedback from the community on this feature if you are interested in trying it out.

@fmoor
Copy link
Member Author

fmoor commented Aug 27, 2022

Currently all generated query functions are public. I think they should be private by default. Then if people ask for it we can provide a mechanism to tell the generator to make query functions public on a per query basis.

Copy link
Member

@fantix fantix left a comment

Choose a reason for hiding this comment

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

Pretty cool overall! The anonymous "inline structs" in the generated code saved a lot of naming trouble 👍

edgedb.go.backup Outdated Show resolved Hide resolved
errors_gen.go Outdated Show resolved Hide resolved
cmd/edgeql-go/gen.go Show resolved Hide resolved
@fmoor
Copy link
Member Author

fmoor commented Oct 17, 2022

TODO: I need to look at linked property support

@fmoor fmoor merged commit 49aa101 into master Oct 24, 2022
@fmoor fmoor deleted the codegen branch October 24, 2022 21:09
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.

3 participants