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

cli: reusable code generation #145

Merged
merged 33 commits into from
Sep 27, 2024
Merged

cli: reusable code generation #145

merged 33 commits into from
Sep 27, 2024

Conversation

hgiasac
Copy link
Collaborator

@hgiasac hgiasac commented Sep 17, 2024

  • Support embedded fields.
  • If neither function nor procedure is generated, your project may use Go workspace. In this case, the CLI will print a warning to ask you to add the submodule path to the go.work file.
  • Move logs of /health and /metrics endpoints to the debug level
  • Make code generation reusable for other connector libraries:
    • Support the snake_case naming style for operation names via the --style=snake-case argument.
    • Generate the connector schema to Go code via the --schema-format=go argument.
    • Generate handlers in the same package as defined functions. The connector.generated.go file simply imports those handlers to execute the logic.
    • Add a new --type-only argument to skip generating the connector.generated.go file. Connector authors can customize the connector codes as they wish.

Copy link

github-actions bot commented Sep 17, 2024

Code Coverage

Package Line Rate Health
github.com/hasura/ndc-sdk-go/cmd/hasura-ndc-go/command/internal 83%
github.com/hasura/ndc-sdk-go/cmd/hasura-ndc-go/command 41%
github.com/hasura/ndc-sdk-go/cmd/hasura-ndc-go/version 43%
github.com/hasura/ndc-sdk-go/connector 52%
github.com/hasura/ndc-sdk-go/example/reference 65%
github.com/hasura/ndc-sdk-go/internal 53%
github.com/hasura/ndc-sdk-go/scalar 98%
github.com/hasura/ndc-sdk-go/schema 50%
github.com/hasura/ndc-sdk-go/utils 30%
Summary 54% (5921 / 10973)

Minimum allowed line rate is 40%

@hgiasac hgiasac merged commit ff5d6c0 into main Sep 27, 2024
1 check passed
@hgiasac hgiasac deleted the cli/generate-schema-codes-2 branch September 27, 2024 02:29
hgiasac added a commit that referenced this pull request Oct 1, 2024
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.

1 participant