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 script to generate CLI structure #629

Merged
merged 6 commits into from
Jan 28, 2025
Merged

Conversation

SferaDev
Copy link
Member

@SferaDev SferaDev commented Jan 27, 2025

Add script to generate the structure of the CLI for calling it programmatically and validating params. It will also be useful to generate documentation for pgroll.com.

cmd/root.go Show resolved Hide resolved
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Copy link
Collaborator

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

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

This looks great; thanks for doing it 🙏

To merge I think we also need:

  • A Makefile rule to generate cli-definition.json
  • Invoke the Makefile rule from CI and fail the build if cli-definition.json is out of sync.

bin/build-cli-json-schema.go Outdated Show resolved Hide resolved
bin/build-cli-json-schema.go Outdated Show resolved Hide resolved
Signed-off-by: Alexis Rico <[email protected]>
Short: "Convert SQL statements to pgroll operations",
Args: cobra.ExactArgs(1),
Hidden: true,
Use: "sql <sql statement>",
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
Use: "sql <sql statement>",
Use: "sql <statement>",

@SferaDev
Copy link
Member Author

@andrew-farries Added it to the generate rule, let me know if that works or we should have a different one for this

@andrew-farries
Copy link
Collaborator

@andrew-farries Added it to the generate rule, let me know if that works or we should have a different one for this

That works for me.

@SferaDev SferaDev merged commit c237001 into xataio:main Jan 28, 2025
28 checks passed
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.

2 participants