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

feat: add support for diagnose report #2

Merged
merged 22 commits into from
Oct 27, 2024

Conversation

yadazula
Copy link
Contributor

This pull request introduces a new diagnose feature in the pg-extras library, which includes methods to run various diagnostic checks on a PostgreSQL database and generate a report.

Functionality mostly ported from the ruby-pg-extras repository.

New Features:

  • Diagnose Method and Report:
    • Added a diagnose method for running a set of diagnostic checks and generating a report with recommendations.
    • Added a recommendation module to provide suggestions based on the diagnostic results.

Dependency Updates:

  • Cargo.toml:
    • Updated the version of the pg-extras library to 0.6.2.
    • Added new dependencies: unicode-width and textwrap for formatting the diagnostic report.

Documentation:

  • README.md:
    • Added documentation for the new diagnose method, including an example and an image of the diagnose report.

Utility Functions:

  • Size Parser:
    • Added a utility function to parse size strings into bytes.

Introduced a new `Diagnose` struct with a `run` method to execute various diagnostic checks. Currently, not all diagnostic checks are fully implemented.
Removed the strum dependency from the project and adjusted the Check enum and related code to use standard Rust features.
Replaced the CheckResult::new() constructor with struct literal initialization.
Refactor to use concise if-let-else syntax.
Moved diagnose logic into a dedicated submodule with separate files for the run logic and recommendations. Implemented a new recommendation system for diagnosis checks and added structured report rendering.
@pawurb pawurb merged commit d2fd3c1 into pawurb:main Oct 27, 2024
3 checks passed
@pawurb
Copy link
Owner

pawurb commented Oct 27, 2024

awesome, thank you!

@yadazula yadazula deleted the feature/add-diagnose-command branch October 28, 2024 19:22
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