Skip to content

refactor: remove base module and flatten module hierarchy #1583

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 1 commit into from
Jun 21, 2025

Conversation

gvozdvmozgu
Copy link
Collaborator

No description provided.

@gvozdvmozgu gvozdvmozgu requested a review from Copilot May 5, 2025 12:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the project by removing the legacy “base” modules and flattening the module hierarchy, simplifying import paths throughout the codebase.

  • Updated import paths across multiple files by replacing references to "segments::base::ErasedSegment" with "segments::ErasedSegment".
  • Removed the legacy "base" modules (in both parser/grammar and dialects), consolidating their functionality into the updated module structure.

Reviewed Changes

Copilot reviewed 153 out of 153 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/lib-core/src/parser/node_matcher.rs Updated import path for ErasedSegment to reflect the new module structure.
crates/lib-core/src/parser/matchable.rs Updated import paths for grammar and segments.
crates/lib-core/src/dialects/base.rs Removed file as part of the module flattening refactor.
crates/lib-core/src/dialects.rs Adjusted module contents to consolidate dialect functionality.
(Other parser and grammar files) Similar updates to remove references to the "base" submodule.
Comments suppressed due to low confidence (2)

crates/lib-core/src/dialects/base.rs:1

  • The removal of this deprecated base module appears intentional. Please confirm that no remaining components rely on this file and that all dependencies have been updated to reflect the new module structure.
Entire file removed

crates/lib-core/src/parser/node_matcher.rs:7

  • The updated import path from 'segments::base::ErasedSegment' to 'segments::ErasedSegment' is consistent with the new module hierarchy. Please verify that all references throughout the codebase now correctly use the flattened structure.
+use crate::parser::segments::ErasedSegment;

@gvozdvmozgu gvozdvmozgu force-pushed the remove-base-flatten-hierarchy branch from 6bf2a25 to 8f1a080 Compare May 5, 2025 12:45
Copy link

github-actions bot commented May 5, 2025

Benchmark for 7466a1a

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.1±0.43µs 39.6±0.32µs -1.25%
fix_complex_query 9.2±0.11ms 9.7±0.73ms +5.43%
fix_superlong 89.5±5.85ms 96.6±6.27ms +7.93%
parse_complex_query 2.8±0.04µs 2.9±0.03µs +3.57%
parse_expression_recursion 5.0±0.05µs 5.2±0.09µs +4.00%
parse_simple_query 789.4±12.03ns 804.5±12.36ns +1.91%

Copy link

github-actions bot commented May 5, 2025

Benchmark for b0e17c0

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.2±0.40µs 40.1±0.46µs -0.25%
fix_complex_query 9.3±0.07ms 9.6±0.57ms +3.23%
fix_superlong 95.4±7.33ms 104.9±8.60ms +9.96%
parse_complex_query 2.9±0.02µs 2.9±0.03µs 0.00%
parse_expression_recursion 5.0±0.06µs 5.1±0.05µs +2.00%
parse_simple_query 800.6±12.77ns 791.5±7.76ns -1.14%

@gvozdvmozgu gvozdvmozgu force-pushed the remove-base-flatten-hierarchy branch from 8f1a080 to 7846400 Compare May 5, 2025 13:48
Copy link

github-actions bot commented May 5, 2025

Benchmark for 965ba91

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.1±0.41µs 39.8±0.76µs -0.75%
fix_complex_query 9.2±0.07ms 9.7±0.48ms +5.43%
fix_superlong 95.9±7.39ms 111.2±67.81ms +15.95%
parse_complex_query 2.9±0.03µs 2.9±0.05µs 0.00%
parse_expression_recursion 5.1±0.07µs 5.1±0.09µs 0.00%
parse_simple_query 811.3±8.92ns 812.2±14.39ns +0.11%

Copy link

Benchmark for b0fcc8c

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.9±0.40µs 40.4±0.78µs -1.22%
fix_complex_query 9.4±0.10ms 9.2±0.07ms -2.13%
fix_superlong 95.3±6.46ms 95.0±6.89ms -0.31%
parse_complex_query 2.9±0.03µs 2.8±0.03µs -3.45%
parse_expression_recursion 5.1±0.03µs 5.0±0.06µs -1.96%
parse_simple_query 828.1±11.72ns 798.8±9.20ns -3.54%

@gvozdvmozgu gvozdvmozgu force-pushed the remove-base-flatten-hierarchy branch 2 times, most recently from 6a3559c to facac49 Compare June 21, 2025 14:31
Copy link

Benchmark for 906e1d6

Click to view benchmark
Test Base PR %
DepthMap::from_parent 60.3±0.55µs 60.9±0.91µs +1.00%
fix_complex_query 12.1±0.20ms 12.1±0.07ms 0.00%
fix_superlong 158.6±20.26ms 149.6±14.16ms -5.67%
parse_complex_query 4.1±0.04µs 4.1±0.05µs 0.00%
parse_expression_recursion 7.4±0.17µs 7.2±0.09µs -2.70%
parse_simple_query 1071.6±25.41ns 1075.2±19.04ns +0.34%

@benfdking benfdking force-pushed the remove-base-flatten-hierarchy branch from facac49 to d87f60e Compare June 21, 2025 18:39
@benfdking
Copy link
Collaborator

I'll look into getting this in tonight

Copy link

Benchmark for 2059dec

Click to view benchmark
Test Base PR %
DepthMap::from_parent 62.6±7.35µs 59.5±0.74µs -4.95%
fix_complex_query 12.0±0.06ms 12.2±0.09ms +1.67%
fix_superlong 135.5±13.18ms 132.1±14.07ms -2.51%
parse_complex_query 4.2±0.03µs 4.2±0.04µs 0.00%
parse_expression_recursion 7.3±0.07µs 7.2±0.10µs -1.37%
parse_simple_query 1076.4±15.18ns 1064.9±11.20ns -1.07%

@benfdking benfdking merged commit 478914d into main Jun 21, 2025
41 checks passed
@benfdking benfdking deleted the remove-base-flatten-hierarchy branch June 21, 2025 20:08
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 6, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [quarylabs/sqruff](https://github.com/quarylabs/sqruff) | minor | `v0.26.8` -> `v0.27.0` |

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>quarylabs/sqruff (quarylabs/sqruff)</summary>

### [`v0.27.0`](https://github.com/quarylabs/sqruff/releases/tag/v0.27.0)

[Compare Source](quarylabs/sqruff@v0.26.8...v0.27.0)

#### What's Changed

- refactor: remove base module and flatten module hierarchy by [@&#8203;gvozdvmozgu](https://github.com/gvozdvmozgu) in quarylabs/sqruff#1583
- chore: update installation instructions by [@&#8203;benfdking](https://github.com/benfdking) in quarylabs/sqruff#1670
- chore: bump prettier from 3.5.3 to 3.6.0 by [@&#8203;dependabot](https://github.com/dependabot) in quarylabs/sqruff#1684
- chore: bump docker/setup-buildx-action from 3.10.0 to 3.11.1 by [@&#8203;dependabot](https://github.com/dependabot) in quarylabs/sqruff#1679
- chore: bump [@&#8203;vscode/test-web](https://github.com/vscode/test-web) from 0.0.69 to 0.0.70 by [@&#8203;dependabot](https://github.com/dependabot) in quarylabs/sqruff#1680
- chore: bump phf from 0.11.3 to 0.12.1 by [@&#8203;dependabot](https://github.com/dependabot) in quarylabs/sqruff#1678
- build(cargo): prune unused features `serde_with` by [@&#8203;gvozdvmozgu](https://github.com/gvozdvmozgu) in quarylabs/sqruff#1687
- chore: bump PyO3/maturin-action from 1.49.1 to 1.49.2 by [@&#8203;dependabot](https://github.com/dependabot) in quarylabs/sqruff#1682
- feat: Add T-SQL dialect support by [@&#8203;Fank](https://github.com/Fank) in quarylabs/sqruff#1664
- refactor: remove PHF dependency by [@&#8203;gvozdvmozgu](https://github.com/gvozdvmozgu) in quarylabs/sqruff#1686
- ci: add --no-fail-fast to cargo test commands by [@&#8203;Fank](https://github.com/Fank) in quarylabs/sqruff#1688
- fix: fix docker build by [@&#8203;benfdking](https://github.com/benfdking) in quarylabs/sqruff#1689
- fix: update Dockerfile to fix Python 3.11 build issue ([#&#8203;1676](quarylabs/sqruff#1676)) by [@&#8203;Fank](https://github.com/Fank) in quarylabs/sqruff#1677
- refactor(cli-lib): replace interactive fix prompt with --check flag by [@&#8203;gvozdvmozgu](https://github.com/gvozdvmozgu) in quarylabs/sqruff#1674
- chore: bump version by [@&#8203;benfdking](https://github.com/benfdking) in quarylabs/sqruff#1690

#### New Contributors

- [@&#8203;Fank](https://github.com/Fank) made their first contribution in quarylabs/sqruff#1664

**Full Changelog**: quarylabs/sqruff@v0.26.8...v0.27.0

</details>

---

### Configuration

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

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **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.

2 participants