deps: upgrade sea-orm to 2.0.2 stable and sqlx 0.9 - #473
Merged
Conversation
|
Warning Review limit reachedNext included review available in 51 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (49)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sea-orm moves from the 2.0.0 release candidates (sqlx 0.8) to the stable line built on sqlx 0.9, unifying the dependency for awa-seaorm consumers (#443). sqlx's combined runtime+TLS features were removed in 0.9, so builds now select runtime-tokio + tls-rustls-ring explicitly — the same ring provider with webpki roots that runtime-tokio-rustls chose before. sqlx 0.9 requires query text to be &'static str or an explicit safety assertion, so dynamically assembled SQL opts in through a new audited_sql helper (pub on awa-model, re-exported from the awa facade). Its doc comment records the audit invariant: interpolated content is limited to identifiers validated by validate_ident ([a-z0-9_]+) and fixed fragments; every external value travels as a bind parameter. ~700 call sites across the workspace, bindings, and example app were wrapped mechanically; two maintenance rescue-sweep helpers also needed the wrapper because Query is now 'static over its SQL. No schema, migration, or behavioural changes. Full workspace suite, python bindings tests, and the example app build verified against postgres 17.
Follow-up review findings on the sea-orm 2.0.2 / sqlx 0.9 upgrade. The upgrade itself verifies as a semantic no-op — a normalized diff that unwraps `audited_sql(...)` and collapses whitespace leaves no change to SQL text, bind order, assertions, or control flow across all 43 touched Rust files, and static `&'static str` call sites were correctly left unwrapped. The gaps were in the audit trail the wrapper establishes: - `QueueStorage::active_schema` / `active_schema_in_tx` returned a schema name read straight out of `awa.runtime_storage_backends` with no `validate_ident` check. Three `batch_operations.rs` sites interpolated that raw String into query text without going through `QueueStorage`, so the invariant `audited_sql` documents did not actually hold. Both readers now re-validate, covering those three sites and the other 18 callers as defence in depth. Regression test included. - The eight Python `Transaction.execute` / `fetch_*` sites ran caller-supplied SQL through `audited_sql`, whose doc comment claims awa only interpolates validated identifiers. That claim is false for caller-owned text, and mixing the two makes `grep audited_sql` unverifiable. Those sites move to a separate `caller_provided_sql`. - `copy_in_raw` is outside sqlx 0.9's `SqlSafeStr` guard, so the two dynamic `COPY ... FROM STDIN` statements are dynamic SQL the wrapper cannot mark. Both now state the invariant inline, and the `audited_sql` docs say to sweep `copy_in_raw` alongside it. - `examples/rust-app-demo` used `awa::audited_sql` for its own application SQL, teaching downstream users to borrow awa's internal audit marker. Switched to `sqlx::AssertSqlSafe`, which is what an application should assert with. - That example is a third cargo workspace with a path dependency on awa and had no CI coverage at all, so an awa API or sqlx major change could break it while every job stayed green. Added fmt + clippy to the existing `rust-lint` job, mirroring the awa-python precedent there; it immediately caught pre-existing import-order drift in `seed_demo.rs`. Also records in the changelog that the upgrade drops `rsa` and its pkcs1/pkcs8/spki/der/num-bigint-dig chain — pulled in unconditionally via `sqlx-macros-core` -> `sqlx-mysql` on 0.8 despite this being a Postgres-only build, and unfixed for RUSTSEC-2023-0071 (the advisory lists no patched version) — and corrects the stated identifier pattern to `[a-z_][a-z0-9_]*`. Verified: fmt, clippy `-D warnings`, and build clean across all three workspaces (root, awa-python, examples/rust-app-demo); 97 awa-model unit tests pass. Claude-Session: https://claude.ai/code/session_019qZh23q9cPPXUtAoPhpfgc
hardbyte
force-pushed
the
brian/issue-443-seaorm-2-stable
branch
from
August 26, 2026 21:52
c6d03b5 to
c8febf9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #443.
What
2.0.0-rc.38→2.0.2stable (pulls sea-query1.0.0-rc.33→1.0.2), unifying sqlx forawa-seaormconsumers.0.8.6→0.9.0across the root workspace,awa-python, andexamples/rust-app-demo.runtime-tokio-rustls→runtime-tokio+tls-rustls-ring(same ring provider + webpki roots as before).The interesting part: sqlx 0.9's SqlSafeStr guard
Query functions now only accept
&'static stror an explicit assertion, so dynamically assembled SQL must opt in (~700 sites here). Addedaudited_sql()—pubon awa-model, re-exported from theawafacade next tomap_sqlx_error— whose doc comment records the audit invariant: interpolated content is limited to identifiers validated byvalidate_ident([a-z0-9_]+) and fixed fragments; every external value travels as a bind parameter.Two
maintenance.rsrescue-sweep helpers also needed the wrapper becauseQuery<'q>is now'staticover its SQL (E0521 otherwise).No schema, migration, or behavioural changes; no compile-time macros / offline cache in this repo, so no
.sqlxregeneration was needed.Verification
cargo fmt/cargo clippy --all-targets --all-features -D warnings/cargo build --workspace: green.external_wait_test::test_e19_wait_for_callback_happy_path(state observed mid-transition under load; sibling test flaked identically pre-upgrade). Also reproduced-and-dismissed: anadapter_api_testfailure caused by stale orphaned schemas in a shared dev database (fails identically onmain), and lock-exhaustion failures from running unsharded against a stock container (CI shards migrations tests; local container now runs withmax_locks_per_transaction=512).awa-python:maturin develop+ pytest — 311 passed / 1 skipped. The 7 pool-timeout setup errors intest_start_config.pyreproduce onmain(16 passed / 8 errors there) — pre-existing connection accumulation in that file's fixture, not upgrade-caused.examples/rust-app-demobuilds clean incl. clippy.mainlocally (66s vs 221s).Follow-ups noticed en route (separate PRs): the python
test_start_config.pyconnection leak above, and~/dotfiles/scripts/update-cli-tools.pyinstalling a Linux musl sccache binary on macOS (itsarchesmap has no Darwin targets).Summary by CodeRabbit