Skip to content

build(deps): sea-query 1.0 + sea-query-sqlx 0.8 - #252

Merged
shankar-gpio merged 1 commit into
mainfrom
deps/sea-query-1.0
Aug 14, 2026
Merged

build(deps): sea-query 1.0 + sea-query-sqlx 0.8#252
shankar-gpio merged 1 commit into
mainfrom
deps/sea-query-1.0

Conversation

@shankar-gpio

Copy link
Copy Markdown
Contributor

Supersedes #250 — that PR can be closed once this lands.

Why #250 was stuck

Bumping sea-query alone cannot resolve: sea-query-binder 0.7 pins sea-query ^0.32. Upstream superseded sea-query-binder with a renamed crate, sea-query-sqlx, which is what unblocks the upgrade.

Version choice

from to
sea-query 0.32.7 1.0.2
sea-query-bindersea-query-sqlx 0.7.0 0.8.1

sea-query-sqlx 0.8.1, not 0.9.x, on purpose: 0.8.x is the line that still targets sqlx ^0.8 and declares rust-version = 1.88.0. So sqlx stays on 0.8 and the MSRV 1.88 promise in CLAUDE.md holds. 0.9 moves to sqlx 0.9 + Rust 1.94 — a separate, larger decision. Cargo says so itself while resolving: available: v0.9.1, requires Rust 1.94.0.

The port

Compiler- and clippy-driven throughout, not hand-hunted:

  • Crate rename (31 sites). The binder type only ever surfaces behind storage::build_sqlx and the DbPool/DbTransaction execute helpers, so it is a rename and nothing else. build_any_sqlx was removed in 0.8 (1.0 replaced dyn QueryBuilder with impl QueryBuilder), but Orion never used it — build_sqlx already matches on DbBackend and calls the monomorphised builder.
  • ExprTrait: comparison operators moved off Expr onto a trait, so 11 modules and 2 test files gained use sea_query::ExprTrait;. Without it .eq() resolves to PartialEq::eq, which is why the first check reported expected Expr, found bool.
  • Ord::max vs ExprTrait::max: ExprTrait is blanket-implemented for everything convertible into an Expr, so a bare .max(0) on an i64 becomes ambiguous (E0034). Four sites now spell it Ord::max(a, b).
  • Expr::cust takes Into<Cow<'static, str>>. trace_dlq threaded non-'static &str through it: now is only ever helpers::sql_now, so it is typed &'static str; lease_until arrives from sql_now_plus_secs as an owned String, so those two sites clone.
  • SimpleExpr is now an alias of Expr and From<Expr> for SimpleExpr is gone, so 62 Expr::val(x).into() calls became identity conversions and tripped clippy::useless_conversion under -D warnings. Applied with cargo clippy --fix; it correctly left the real &str/boolExpr conversions alone.
  • Value variants are unboxed: one test assertion drops a Box::new.

schema.rs needed no change — all 11 Iden enums use the derive, which still snake_cases variants, and Iden::to_string survives, so the pinned column-identifier test holds. Nothing matches on ColumnRef/TableRef, so 1.0's AST rework and new #[non_exhaustive] are inert.

Deliberately not done: renaming SimpleExprExpr (the alias is not deprecated), and turning Alias::new(x) into bare xIden is implemented for &'static str only, and that path skips identifier escaping.

No golden SQL assertion changed. 1.0 renders byte-identical SQL for everything Orion builds, on all three dialects.

Dependencies

The graph shrinks: sea-query 1.0.2 has no mandatory dependencies, dropping inherent and postgres-types. sea-query-sqlx lists jiff-sqlx (Unlicense OR MIT) as optional behind with-jiff, which is off — so it lands in Cargo.lock but is never compiled. Noted in the manifest, since Unlicense is not in deny.toml's allowlist and it clears only via the MIT arm.

cargo deny: advisories, bans, licenses, sources — all ok.

Verification

Gate Result
cargo fmt --all --check ok
cargo clippy --workspace --all-targets -- -D warnings clean
cargo test --workspace --all-targets 1091 lib + 657 integration, all pass
cargo test --doc ok
cargo deny check advisories/bans/licenses/sources ok
cargo package --locked --workspace verify-builds all 4 crates
RUSTDOCFLAGS="-D warnings" cargo doc clean
cargo +1.88 test --workspace all pass — MSRV holds
storage_postgres / storage_mysql / schema_parity 6 / 4 / 1 pass
cluster (Docker) 17 pass
container-backed integration set 26 pass
tests/e2e/run.sh 75 pass

Postgres/MySQL rendering is only executed under Docker, so those suites were run rather than left to CI.

Two things for the reviewer

  1. Kafka container tests are flaky at default parallelism on the machine this was verified on: failures are producer-side MessageTimedOut before any SQL runs, the count varied run to run (7, then 2), and all 20 pass with --test-threads=2. That is the contention ci.yml already predicts for this step, not a regression from this change — but the CI job runs without that flag, so it may need the flag added.
  2. MSRV headroom is now zero: sea-query, sea-query-derive and sea-query-sqlx all declare exactly 1.88.0. Any future 1.0.x patch that raises rust-version will break the msrv job on the next cargo update.

Dependabot's #250 could not merge on its own: sea-query-binder 0.7 pins
sea-query ^0.32, so bumping sea-query alone fails to resolve. Upstream
superseded sea-query-binder with a renamed crate, sea-query-sqlx, which
is what unblocks it.

Picked sea-query-sqlx 0.8.1 over 0.9.x deliberately: 0.8.x is the line
that still targets sqlx ^0.8 and declares rust-version 1.88.0, so sqlx
stays on 0.8 and the MSRV 1.88 promise holds. 0.9 moves to sqlx 0.9 and
Rust 1.94 — a separate, larger decision. Cargo says as much when it
resolves ("available: v0.9.1, requires Rust 1.94.0").

The port, all of it compiler- or clippy-driven rather than hand-hunted:

- sea_query_binder:: -> sea_query_sqlx:: (31 sites). The binder type only
  ever appears behind storage::build_sqlx and the DbPool/DbTransaction
  execute helpers, so this is a rename and nothing more. build_any_sqlx
  was dropped in 0.8 (sea-query 1.0 replaced `dyn QueryBuilder` with
  `impl QueryBuilder`), but Orion never used it — build_sqlx already
  matches on DbBackend and calls the monomorphised builder.
- The comparison operators moved off Expr onto the ExprTrait trait, so 11
  modules and 2 test files gained `use sea_query::ExprTrait;`. Without it
  `.eq()` silently resolves to PartialEq::eq, which is why the first
  check reported "expected Expr, found bool".
- ExprTrait is blanket-implemented for everything convertible into an
  Expr, which makes a bare `.max(0)` on an i64 ambiguous with Ord::max
  (E0034). Four sites now spell it Ord::max(a, b).
- Expr::cust takes Into<Cow<'static, str>> in 1.0. trace_dlq threaded
  non-'static &str through it: `now` is only ever helpers::sql_now, so it
  is typed &'static str; `lease_until` comes from sql_now_plus_secs as an
  owned String, so those two sites clone. Signatures of the pinned
  golden-SQL helpers keep their literal arguments either way.
- SimpleExpr is now a plain alias of Expr and From<Expr> for SimpleExpr
  is gone, so 62 `Expr::val(x).into()` calls became identity conversions
  and tripped clippy::useless_conversion under -D warnings. Applied via
  `cargo clippy --fix`; it correctly left the real &str/bool -> Expr
  conversions in connectors.rs, cluster.rs and packages.rs alone.
- Value variants are unboxed: one test assertion drops a Box::new.

schema.rs needed no change — all 11 Iden enums use the derive, which
still snake_cases variants, and Iden::to_string survives, so the pinned
column-identifier test holds. Nothing here matches on ColumnRef/TableRef,
so 1.0's AST rework and new #[non_exhaustive] are inert. Deliberately
not done: renaming SimpleExpr to Expr (the alias is not deprecated), and
turning Alias::new(x) into bare x — Iden is implemented for &'static str
only, and that path skips identifier escaping.

No golden SQL assertion changed. 1.0 renders byte-identical SQL for
everything Orion builds, on all three dialects.

Dependency graph shrinks: sea-query 1.0.2 has no mandatory dependencies,
dropping `inherent` and `postgres-types`. sea-query-sqlx lists jiff-sqlx
(Unlicense OR MIT) as optional behind with-jiff, which is off, so it
lands in the lock but is never compiled; noted in the manifest since
Unlicense is not in deny.toml's allowlist and it clears only via the MIT
arm. cargo deny: advisories, bans, licenses, sources all ok.

Verified: fmt; clippy --workspace --all-targets -D warnings; the full
workspace suite and --doc; cargo deny; cargo package --locked --workspace
(verify-builds all four crates); rustdoc -D warnings; and the whole suite
again on Rust 1.88 for the MSRV job. Postgres/MySQL rendering is only
executed under Docker, so those ran too: storage_postgres, storage_mysql,
schema_parity, cluster (17) and the container-backed integration set (26)
are green, as is e2e (75).

One caveat: the Kafka container tests are flaky at default parallelism on
this machine — failures are producer-side MessageTimedOut before any SQL
runs, the count varied run to run, and all 20 pass with --test-threads=2.
That is the contention ci.yml already predicts for this step, not a
regression from this change, but the CI job runs without that flag.
MSRV headroom is now zero: sea-query, sea-query-derive and
sea-query-sqlx all declare exactly 1.88.0.
@shankar-gpio
shankar-gpio merged commit 235cf3b into main Aug 14, 2026
25 of 26 checks passed
shankar-gpio added a commit that referenced this pull request Aug 14, 2026
…253)

cargo-mutants v27.1.0 (2026-06-02) links its prebuilt binaries against
glibc 2.39. ubuntu-22.04 carries 2.35, so install-action fetched the
binary, verified its checksum, and then could not run it:

  cargo-mutants: /lib/x86_64-linux-gnu/libc.so.6:
  version `GLIBC_2.39' not found (required by cargo-mutants)

That failed the job on PR #252 before a single mutant was generated, and
would have failed every PR from here on.

The repo-wide ubuntu-22.04 pin exists so shipped binaries stay loadable
on older glibc. This job ships nothing — it builds mutants and throws
them away — so the pin buys it nothing while costing it the tool. Bump
the runner rather than pinning an older cargo-mutants, which keeps the
tool on `latest` like every other install-action call in ci.yml and does
not re-break when 22.04 falls further behind.

Claude-Session: https://claude.ai/code/session_01DNWvvwKcgrpc15bsSNdXhY
@shankar-gpio
shankar-gpio deleted the deps/sea-query-1.0 branch August 14, 2026 06:18
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.

1 participant