chore(executor): extract explain.rs (#116 step 5)#515
Merged
Conversation
Pulls the tri-dialect EXPLAIN machinery (issue #272 / T1.10) into explain.rs (241 LOC): - `ExplainOptions` knob struct (analyze / buffers / verbose / format). - `ExplainFormat` enum (Text / Json / Yaml / Xml). - `impl ExplainOptions::to_clause` — renders `(ANALYZE, BUFFERS, FORMAT JSON)` parenthesized PG clause. - `explain_pool` — tri-dialect dispatcher that emits PG's `EXPLAIN (FORMAT ...) <stmt>`, MySQL's `EXPLAIN [ANALYZE] [FORMAT=JSON|TREE] <stmt>`, or SQLite's `EXPLAIN QUERY PLAN <stmt>`. The `QuerySet::explain` / `QuerySet::explain_on` inherent methods stay in mod.rs since they're impls on the QuerySet inherent surface; they consume `ExplainOptions` / `ExplainFormat` re-exported from the new module. mod.rs: 3852 → 3640 LOC (-212). Build clean across sqlite,tenancy litmus + all-features. 1482 lib tests pass.
ujeenet
added a commit
that referenced
this pull request
May 23, 2026
## Summary Rolls 11 PRs from \`develop\` into \`main\`. ## Features (5) - **#507** \`i18n::middleware::LocaleMiddleware\` — tower layer (cookie + Accept-Language) + documented \`Router::nest(\"/<lang>\", ...)\` pattern for URL-prefix locales. Closes #406, #424. - **#508** \`Translator::with_fallback_chain(&[...])\` — explicit fallback locale chain. Closes #425. - **#509** \`notifications::slack::webhook_callback(url)\` — Slack incoming-webhook provider for the \`broadcast\` channel. Closes #418. Also bumps \`free-disk-space\` reclaim (\`large-packages: true\`). - **#510** Notifications fix — gate the \`database\` channel behind the \`postgres\` feature so non-PG builds compile. ## Refactor: executor reorg (#116, 7 PRs) Pulled \`crates/rustango/src/sql/executor.rs\` (4830 LOC) apart into \`crates/rustango/src/sql/executor/\` with 9 sibling files. - **#511** Mount as dir. - **#512** \`page.rs\` + \`iter.rs\` + \`get_or_create.rs\`. - **#513** \`values.rs\` (Django \`.values()\` / \`.values_list()\`). - **#514** \`atomic.rs\` (\`transaction.atomic\` + \`on_commit\`) + \`tx.rs\` (\`PoolTx\`). - **#515** \`explain.rs\` (tri-dialect \`EXPLAIN\`). - **#516** \`prefetch.rs\` (tri-dialect \`_pool\` prefetch). - **#517** \`row_to_json.rs\` (per-dialect dynamic row → JSON). mod.rs is now at 2923 LOC (-1907, **-39%**). Zero public-API change throughout — every symbol still reachable from \`use rustango::sql::*\`. ## Test plan Every constituent PR landed with sqlite_litmus + sqlite_live + mysql_live + postgres_test all green. The merge itself is a no-conflict fast-forward — no new code lands beyond what's already merged into develop. Re-running CI on the merged main confirms the integration shape.
6 tasks
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.
Summary
Step 5 of the executor reorg (#116). Pulls the tri-dialect EXPLAIN machinery (#272 / T1.10) into `explain.rs` (241 LOC):
The `QuerySet::explain` / `QuerySet::explain_on` inherent methods stay in `mod.rs` since they're impls on the QuerySet surface; they consume the re-exported types.
mod.rs: 3852 → 3640 LOC (-212). Cumulative reduction across steps 1-5: 4830 → 3640 LOC (-1190, ~25%).
Closes
#116 (partial — step 5 of 6 planned)
Test plan