Repository navigation
Conversation
Contributor
Author
|
@chmodas Any thoughts on this one? |
Refresh existing PR chmodas#41 onto SQLx 0.9 / OpenTelemetry 0.33 without rewriting its history. Keep inference opt-in and explicit annotations authoritative. Anchor outer operations, handle MySQL comments conservatively, and cover literal/annotation edge cases. Validated with Rust 1.97.1: 214 unit tests, 119 SQLite tests, all-target/all-feature Clippy, rustdoc and formatting.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #41 +/- ##
==========================================
+ Coverage 99.85% 99.88% +0.03%
==========================================
Files 15 16 +1
Lines 2760 3497 +737
==========================================
+ Hits 2756 3493 +737
Misses 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add CTE depth and scope, malformed input, DDL, comment, quoted identifier, UTF-8 limit and structured property tests without changing production code. Validated with 225 unit tests, Clippy, rustfmt, and local LLVM coverage (682/682 summary.rs lines). Independently reviewed with Claude Opus 5.5.
torchello
added a commit
to torchello/sqlx-otel
that referenced
this pull request
Nov 2, 2026
Port reviewed query-summary corrections and coverage from upstream PR chmodas#41, including backend-aware comment handling and explicit inference limits. Preserve OTel 0.32, SQLSTATE error classification and pool metrics. Validation: 225 unit, 119 SQLite, 21 pool-metrics and 13 doc tests; Clippy and rustfmt pass. Independent Claude Opus 5.5 xhigh review approved.
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.
Unannotated queries currently keep generic database span names. This draft adds opt-in operation/target summaries such as
SELECT users, so callers can group query spans and operation metrics without annotating every query.PoolBuilder::with_query_summary_mode(QuerySummaryMode::Auto)enables inference. The default remainsOff. This is a proposal to discuss extraction scope and supported SQL forms.Behavior:
db.query.summaryfor the span name and operation metrics; do not inferdb.operation.nameordb.collection.name.QueryTextMode, includingOff, using the existing literal obfuscator and a lightweight tokenizer with no parser dependency.#comments without treating PostgreSQL#operators as comments. Limit generated summaries to 255 bytes, falling back to the operation rather than truncating an identifier.This is best-effort extraction, not a full dialect parser or a general SQL redaction boundary. Unsupported forms can be inaccurate or fall back to an operation-only/generic name. Recognized literals are scrubbed, but table/schema names still affect cardinality and can be sensitive. Keep automatic summaries off or use explicit annotations for sensitive SQL or dynamic object names; disabling query text alone does not disable summaries. The shared scrubber does not model PostgreSQL
standard_conforming_strings, SQLite literal backslashes, or MySQLNO_BACKSLASH_ESCAPES/default double-quoted strings; in those forms literal text can surface as the summary target. Use explicit annotations or keep inference off for queries relying on those semantics.Updated onto official
trunkate6c3de535843183d57a2ba084dc24be619743726(SQLx 0.9, OpenTelemetry 0.33). The existing PR history is preserved. This contains only automatic-summary functionality and its docs/tests; it does not carry downstream error classification or SQLx core/driver patches.Validation on this updated base (Rust 1.97.1):
cargo doc --no-deps --all-features: passed.--lib --all-features, macOS/Rust 1.97.1):src/summary.rs682/682 lines and 67/67 functions, with no missing lines. Added CTE depth/scope/materialization, malformed-input, DDL/modifier, comment/identifier, UTF-8 boundary and structured-input property tests; production code is unchanged by this coverage follow-up.The earlier PostgreSQL/MySQL full-suite results in the PR history predate this refresh; those services were not rerun for this update.