Skip to content

bypass sqlparser #193

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

Merged
merged 2 commits into from
Jul 24, 2025
Merged

bypass sqlparser #193

merged 2 commits into from
Jul 24, 2025

Conversation

achristmascarl
Copy link
Owner

@achristmascarl achristmascarl commented Jul 24, 2025

closes #143

  • add option to bypass query parser
  • refactor for bypassing

Important

Add option to bypass SQL parser with new action and popup confirmation, updating query handling across database drivers.

  • Behavior:
    • Add SubmitEditorQueryBypassParser action in action.rs to bypass SQL parser.
    • Modify start_query() in mysql.rs, postgresql.rs, and sqlite.rs to handle bypass_parser flag.
    • Add ConfirmBypass popup in confirm_bypass.rs to confirm bypass action.
  • Refactoring:
    • Update Query action in action.rs to include bypass_parser boolean.
    • Modify get_execution_type() in mod.rs to return Option<Statement>.
    • Change statement_type to Option<Statement> in QueryResultsWithMetadata in mod.rs.
  • Keybindings:
    • Add <F7> keybinding in .config/rainfrog_config.toml for SubmitEditorQueryBypassParser.

This description was created by Ellipsis for 6baab08. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 6baab08 in 2 minutes and 59 seconds. Click for details.
  • Reviewed 523 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 10 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .config/rainfrog_config.toml:23
  • Draft comment:
    Added new F7 keybinding for bypass query submission. Looks good.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/action.rs:29
  • Draft comment:
    New action variant 'SubmitEditorQueryBypassParser' and updated Query variant now carrying a bypass_parser flag. The design is clear.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/app.rs:387
  • Draft comment:
    In the Action::Query branch, bypass logic is implemented with a condition if *bypass && !confirmed. Ensure that the dereferencing is intentional; consider destructuring by value for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This appears to be a purely stylistic suggestion. The current code is perfectly functional and clear. Whether to use dereferencing or destructuring is a matter of personal/team preference. The comment doesn't identify any actual problems or risks. I could be undervaluing the readability benefits of consistent parameter handling patterns across a codebase. While consistency is good, this is too minor of a stylistic issue to warrant a PR comment. The code is clear as-is and works correctly. This comment should be removed as it addresses a purely stylistic preference without identifying any actual problems or important improvements.
4. src/app.rs:388
  • Draft comment:
    Matching on *bypass && *confirmed for execution info is consistent. Verify that all parts handle booleans as references appropriately to avoid confusion.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that all parts handle booleans as references appropriately, which is against the rules. It does not provide a specific suggestion or point out a specific issue in the code.
5. src/database/mysql.rs:50
  • Draft comment:
    The start_query implementation correctly bypasses parsing when bypass_parser is true (returns (query, None)). This pattern is consistent across drivers.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
6. src/components/editor.rs:169
  • Draft comment:
    Editor now distinguishes between normal and bypass submission via the new action. This clear separation is well done.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
7. src/popups/confirm_bypass.rs:23
  • Draft comment:
    The ConfirmBypass popup correctly handles Y/N keys and produces the expected payload. The UI integration is solid.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
8. src/popups/confirm_query.rs:36
  • Draft comment:
    Usage of statement_type_string(Some(*statement.clone())) is acceptable, but consider reducing unnecessary cloning or dereferencing for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
9. src/popups/confirm_tx.rs:41
  • Draft comment:
    ConfirmTx popup now accepts an Option, aligning with the new design. The handling of None and message formatting is clear.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
10. src/popups/mod.rs:19
  • Draft comment:
    PopUpPayload enum updated with ConfirmBypass variant – integration looks solid.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_QTRNtStZMjXSkHzt

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@achristmascarl achristmascarl merged commit 19196ef into main Jul 24, 2025
10 checks passed
@achristmascarl achristmascarl deleted the feat/bypass-sqlparser branch July 24, 2025 21:12
Copy link

Included in release v0.3.4

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [achristmascarl/rainfrog](https://github.com/achristmascarl/rainfrog) | patch | `v0.3.3` -> `v0.3.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>achristmascarl/rainfrog (achristmascarl/rainfrog)</summary>

### [`v0.3.4`](https://github.com/achristmascarl/rainfrog/releases/tag/v0.3.4)

[Compare Source](achristmascarl/rainfrog@v0.3.3...v0.3.4)

<!-- Release notes generated using configuration in .github/release.yml at v0.3.4 -->

#### What's Changed

- Use the common default pattern for the password save prompt by [@&#8203;richardhapb](https://github.com/richardhapb) in achristmascarl/rainfrog#190
- more generic cancellation handling by [@&#8203;achristmascarl](https://github.com/achristmascarl) in achristmascarl/rainfrog#192
- bypass sqlparser by [@&#8203;achristmascarl](https://github.com/achristmascarl) in achristmascarl/rainfrog#193
- upgrade sqlparser to 0.58.0 by [@&#8203;achristmascarl](https://github.com/achristmascarl) in achristmascarl/rainfrog#194

#### New Contributors

- [@&#8203;richardhapb](https://github.com/richardhapb) made their first contribution in achristmascarl/rainfrog#190

**Full Changelog**: achristmascarl/rainfrog@v0.3.3...v0.3.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

allow bypass parser
1 participant