chore: bump sqlformat from 0.3.5 to 0.5.0 - #6257
Conversation
prql-bot
left a comment
There was a problem hiding this comment.
Not a mechanical bump — this changes prqlc's user-visible SQL output. sqlformat::format is called with FormatOptions::default() in prqlc/prqlc/src/sql/mod.rs, and Options::format defaults to true, so every formatted compile changes shape. Running the suite on the merge commit: 175 failures in -p prqlc (7 lib, 3 bin, 165 integration), and -p mdbook-prql's documentation tests fail too, so the book's rendered SQL examples change as well.
The most visible change is CTE layout — the name now sits at column 0 while its body is indented:
-WITH table_0 AS (
- SELECT
- DISTINCT album_id,
+WITH
+table_0 AS (
+ SELECT DISTINCT
+ album_id,
genre_id
FROM
tracks
)PARTITION BY genre_id similarly splits onto two lines. PRQL emits CTEs for most non-trivial queries, so this hits nearly every output.
Two things worth knowing before deciding:
- The MSRV blocker is gone. #5441 (0.3.5 → 0.4.0) was reverted to a no-op because sqlformat 0.4.0 needed Rust 1.84 against a 1.75 MSRV. The workspace is now
rust-version = "1.85.0"and sqlformat 0.5.0 declaresrust-version = "1.84"—test-msrvis green here. - It can't be tuned back. I probed the new
max_inline_argumentsandmax_inline_top_leveloptions; none reproduce the 0.3.5 layout — they either inline far more aggressively or leaveSELECTarguments at column 0. And the unindented CTE name is the crate's intended behaviour, asserted in its ownformat_nested_selecttest, so it isn't going to change upstream.
So this comes down to a call I don't think a bot should make on its own: accept the new formatting as prqlc's output, or stay on 0.3.5. Happy to regenerate all the snapshots if the new formatting is wanted — say the word and I'll push it. If not, ignore for sqlformat in .github/dependabot.yaml would stop this PR reappearing each release.
How this was verified
Built and ran against the PR's merge commit (4855198d, merging 005aba7a into cbee4bae):
cargo test -p prqlc --no-fail-fast
lib 77 passed; 7 failed
bin 27 passed; 3 failed
integration 324 passed; 165 failed
cargo test -p mdbook-prql --no-fail-fast
documentation 5 passed; 2 failed (insta aborts a test at its first mismatch, so this undercounts the affected examples)
The formatting samples above come from feeding prqlc compile --no-format output of prqlc/prqlc/tests/integration/queries/distinct.prql and window.prql through sqlformat 0.5.0 with FormatOptions::default() and with the new inline options set, in a scratch test inside the crate (not committed).
005aba7 to
1951d40
Compare
Bumps [sqlformat](https://github.com/shssoichiro/sqlformat-rs) from 0.3.5 to 0.5.0. - [Release notes](https://github.com/shssoichiro/sqlformat-rs/releases) - [Changelog](https://github.com/shssoichiro/sqlformat-rs/blob/master/CHANGELOG.md) - [Commits](shssoichiro/sqlformat-rs@v0.3.5...v0.5.0) --- updated-dependencies: - dependency-name: sqlformat dependency-version: 0.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
1951d40 to
95b8ab7
Compare
Bumps sqlformat from 0.3.5 to 0.5.0.
Changelog
Sourced from sqlformat's changelog.
Commits
832fa6eVersion 0.5.0533e2afImprove array support (#106)cdc0732More inline fixes (#109)e47d31fSmall fixes (#108)9385670Add some initial debugging capabilitiesf910e6fVersion 0.4.0b251c7cfix: Place a whitespace between the array type specifier and a reserved word7d3ae8cfeat: Consistently space blocks after arguments1ce0359feat: Correctly inline opening parentheses (#100)d20763cSupport more conditionally top level tokens (#99)