edgedb-go icon indicating copy to clipboard operation
edgedb-go copied to clipboard

Fix #287: Adds -pubtypes, -pubfuncs, and -jsontag CLI flags

Open chirino opened this issue 1 year ago • 2 comments

  • -pubtypes make the generated types public
  • -pubfuncs makes the generated functions public
  • -jsontag add a json:”...” field tag

chirino avatar May 05 '24 16:05 chirino

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.

fmoor avatar May 06 '24 17:05 fmoor

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.

chirino avatar Jun 12 '24 19:06 chirino

Closing in favor of https://github.com/edgedb/edgedb-go/pull/317 and https://github.com/edgedb/edgedb-go/pull/318.

fmoor avatar Jul 09 '24 16:07 fmoor