edgedb-go
edgedb-go copied to clipboard
Fix #287: Adds -pubtypes, -pubfuncs, and -jsontag CLI flags
- -pubtypes make the generated types public
- -pubfuncs makes the generated functions public
- -jsontag add a
json:”...”field tag
Awesome, thanks for this!
Would you add test cases for this? Copy the cmd/edgeql-go/testdata/no-args directory and rename once for each of the new options. Adjust the directory content for the behavior with the option being tested. Then add a test case for each new directory here.
It would be great if the new options were added to the usage example in the docs.
I'm wondering if the -jsontag should perhaps be more general. Maybe it could be -tags and accept name+strategy pairs like json:snakecase. This would allow adding multiple tags and being able to choose the name transformation strategy. I think it would be nice to split this into its own PR. I don't want the design discussion for this to hold up the other two options.
Feel free to make any changes you need. I thought I would send you this contribution to get you started. But I'm fine using a fork.
Closing in favor of https://github.com/edgedb/edgedb-go/pull/317 and https://github.com/edgedb/edgedb-go/pull/318.