Skip to content

chore(executor): extract values.rs (#116 step 3)#513

Merged
ujeenet merged 1 commit into
developfrom
chore/116-executor-reorg-step3-extract-values
May 22, 2026
Merged

chore(executor): extract values.rs (#116 step 3)#513
ujeenet merged 1 commit into
developfrom
chore/116-executor-reorg-step3-extract-values

Conversation

@ujeenet
Copy link
Copy Markdown
Owner

@ujeenet ujeenet commented May 22, 2026

Summary

Step 3 of the executor reorg (#116). Pulls Django `.values()` / `.values_list()` / `.values_list_flat()` machinery into `executor/values.rs`:

  • Per-dialect `cell_to_sqlvalue` decoders.
  • `fetch_values_dict` / `fetch_values_list` / `fetch_values_flat` entry points.
  • `MaybePgScalar` / `MaybeMyScalar` / `MaybeSqliteScalar` trait gates.
  • `bind_query_scalar_{pg,my,sqlite}` helpers.
  • `impl ValuesQuerySet` / `impl ValuesListQuerySet` / `impl ValuesFlatQuerySet` bridge methods.

Required visibility bumps on `bind_match!` macros and `bind_query_*` fns to `pub(super)` so siblings can reach them — unlocks future extraction of the pool/tx modules in steps 4–6.

mod.rs: 4490 → 4139 LOC. values.rs: 397 LOC.

Closes

#116 (partial — step 3 of 6 planned)

Test plan

  • `cargo check --no-default-features --features sqlite,tenancy` clean.
  • `cargo check --all-features` clean.
  • `cargo test --lib --no-default-features --features sqlite,tenancy` — 1482 passing.
  • No public API change.

Pulls Django `.values()` / `.values_list()` / `.values_list_flat()`
machinery into a dedicated module:

- Per-dialect `pg/my/sqlite_cell_to_sqlvalue` decoders (private to
  values.rs since nothing else consumes them).
- `fetch_values_dict` / `fetch_values_list` / `fetch_values_flat`
  pool-level entry points.
- `MaybePgScalar` / `MaybeMyScalar` / `MaybeSqliteScalar` trait
  gates for the typed-scalar flat-fetch path.
- `bind_query_scalar_{pg,my,sqlite}` helpers.
- `impl ValuesQuerySet` / `impl ValuesListQuerySet` /
  `impl ValuesFlatQuerySet` bridge methods.

Required visibility bumps on `bind_match!`, `bind_match_mysql!`,
`bind_match_sqlite!` macros (now `pub(super)` via
`pub(super) use bind_match;`) and `bind_query` / `bind_query_my` /
`bind_query_sqlite` (now `pub(super) fn`) so siblings under
`executor/` can reach them.

mod.rs: 4490 → 4139 LOC. values.rs: 397 LOC.

1482 lib tests pass on the sqlite,tenancy litmus.
@ujeenet ujeenet merged commit bc92e41 into develop May 22, 2026
8 checks passed
@ujeenet ujeenet deleted the chore/116-executor-reorg-step3-extract-values branch May 22, 2026 21:58
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.
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