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

Added xlsx output #13

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Added xlsx output #13

merged 2 commits into from
Nov 20, 2023

Conversation

noborus
Copy link
Owner

@noborus noborus commented Nov 20, 2023

Summary by CodeRabbit

  • New Features

    • Support for executing SQL queries on various file formats, including xlsx, CSV, and JSON.
    • Output results can now be saved in xlsx format with options to specify the output file, sheet, and starting cell.
    • Ability to clear a sheet before outputting results to it.
  • Enhancements

    • Added a --debug option for enabling debug mode to assist with troubleshooting.
    • Introduced --skip option to bypass a specified number of lines during processing.
  • Documentation

    • Updated help text and README to reflect new features and options.

Copy link

coderabbitai bot commented Nov 20, 2023

Walkthrough

The xlsxsql CLI tool has been enhanced to support advanced features for handling and querying data within xlsx files and other formats like CSV and JSON. It now allows users to output query results directly into xlsx files with options to specify the output file, sheet, and cell, and even clear the sheet before outputting. A debug mode has also been introduced for troubleshooting.

Changes

File(s) Change Summary
README.md Added features for xlsx output, debug mode, and updated help text.

🐇🌟
In the code's weave, a new thread,
Queries dance, results spread.
As autumn leaves in breezes whirl,
Our data finds a new world. 🍂📊


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d296683 and c206c32.
Files selected for processing (1)
  • README.md (7 hunks)
Additional comments: 4
README.md (4)
  • 6-8: The image link provided seems to be an example of the output. Ensure that the image is up-to-date and accurately reflects the new functionality for exporting to xlsx format. If the image does not represent the new features, consider updating or adding a new image that demonstrates the xlsx output capability.

  • 74-90: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [60-89]

The help text has been updated to reflect the new --clear-sheet, --debug, --out-cell, --out-file, and --out-sheet flags. Ensure that the help text is consistent with the actual behavior of the command-line interface and that all new options are tested for functionality.

  • 124-146: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [124-170]

The documentation provides examples of basic usage and advanced features like specifying sheets and cells, as well as joining data from multiple sources. Ensure that these examples are tested and work as expected with the new xlsx output functionality. Additionally, verify that the shorthand table command works with the new features.

  • 189-245: The documentation now includes examples of how to use the new --out-file, --out-sheet, --out-cell, and --clear-sheet options. It is important to ensure that these examples are clear and that they accurately demonstrate how to use the new functionality. Additionally, the notes regarding overwriting contents and specifying the .xlsx extension are crucial; make sure they are prominent enough to avoid user errors.

README.md Outdated
Comment on lines 16 to 17
Execute SQL on xlsx files and output the results to xlsx format using [xcelize](https://github.com/qax-os/excelize) and [trdsql](https://github.com/noborus/trdsql).
Output to various formats.
Copy link

Choose a reason for hiding this comment

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

The description here is slightly misleading. It suggests that the tool can output to various formats, but it doesn't explicitly mention that it can now also read from xlsx files and execute SQL queries on them. Consider rephrasing to clarify that the tool supports both reading from and writing to xlsx files.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c206c32 and 4488048.
Files selected for processing (1)
  • README.md (7 hunks)
Additional comments: 5
README.md (5)
  • 3-9: The introduction of the image in the README is a good visual aid for users to understand the functionality of the tool. However, ensure that the image is kept up-to-date with the tool's interface and features to avoid any confusion.

  • 74-90: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [60-89]

The help output has been updated to include the new flags and options. This is crucial for users to understand how to use the new features. Ensure that the help output is synchronized with the actual behavior of the tool.

  • 124-146: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [124-170]

The explanation of how to execute SQL on files such as CSV and JSON, and the ability to join data from different sources, is a valuable addition to the documentation. It provides users with examples of more complex queries they can perform with the tool.

  • 164-170: The note about how the tool interprets the table when a cell is specified is an important detail that helps users understand the behavior of the tool. This should help prevent confusion when specifying cells in queries.

  • 189-245: The documentation provides clear examples of how to use the new features such as the --skip option, output formats, and how to output to an xlsx file. It's important to ensure that these examples are tested and accurately reflect the tool's functionality.

Comment on lines +16 to +17
A CLI tool that executes SQL queries on xlsx files and outputs the results to various files, and also executes SQL queries on various files and outputs them to xlsx files.
Built using [excelize](https://github.com/qax-os/excelize) and [trdsql](https://github.com/noborus/trdsql).
Copy link

Choose a reason for hiding this comment

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

The description has been updated to reflect the new capabilities of the tool, which is good for clarity. However, it might be beneficial to separate the two functionalities into distinct sentences for better readability.

@noborus noborus merged commit 4a4e0d0 into main Nov 20, 2023
1 check passed
@noborus noborus deleted the README-writer branch November 20, 2023 23:19
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.

None yet

1 participant