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 mechanism for generating public query functions and types #287

Open
fmoor opened this issue Oct 4, 2023 · 2 comments
Open

Add mechanism for generating public query functions and types #287

fmoor opened this issue Oct 4, 2023 · 2 comments

Comments

@fmoor
Copy link
Member

fmoor commented Oct 4, 2023

Currently edgeql-go generates private query functions and return types. The user can export these types but it requires a few lines of code for each query. There should be a way to make the generator generate public instead of private functions and types.

Maybe this should be configurable on a per query basis?

@chirino
Copy link

chirino commented May 5, 2024

I would default to being public, if a user really wants to keep it private he can place it under an internal directory so that it's public to external packages.

chirino added a commit to chirino/edgedb-go that referenced this issue May 5, 2024
* -pubtypes make the generated types public
* -pubfuncs makes the generated functions public
* -jsontag add a `json:”...”` field tag

Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
@fmoor
Copy link
Member Author

fmoor commented May 6, 2024

I would default to being public, if a user really wants to keep it private he can place it under an internal directory so that it's public to external packages.

Public by default seems reasonable, but I think there should still be a way to make them private to a package. In a large enough project it is reasonable to want to restrict some things more than just internal/.

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

No branches or pull requests

2 participants