chore(executor): extract pg_on.rs (#116 step 9)#520
Merged
Conversation
Pulls the PG-typed _on CRUD family out of mod.rs into a dedicated file (181 LOC): - insert_on / update_on / delete_on - select_rows_on / select_one_row_on - insert_returning_on - bulk_insert_on These accept any sqlx executor (&PgPool / &mut PgConnection / Transaction). Tenant-scoped writes need them — schema-mode tenants share the registry pool and rely on per-checkout SET search_path; passing a fresh &PgPool would silently hit the wrong schema. Mounted under #[cfg(feature = postgres)] in mod.rs, so per-function postgres cfg gates were dropped inside the file. raw_query_on + fetch_aggregate_on still live in mod.rs — they're at lines 1038+ in a different section and will move in a later step. mod.rs: 2803 → 2637 LOC (-166). pg_on.rs: 181 LOC. No public-API change. 1482 lib tests pass on sqlite,tenancy litmus. Part of #116 (step 9).
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 9 of the executor reorg (#116). Pulls the PG-typed `_on` CRUD family into `executor/pg_on.rs` (181 LOC):
These accept any sqlx executor (`&PgPool` / `&mut PgConnection` / `Transaction`). Tenant-scoped writes need them — schema-mode tenants share the registry pool and rely on per-checkout `SET search_path`; passing a fresh `&PgPool` would silently hit the wrong schema.
Mounted under `#[cfg(feature = "postgres")]` in mod.rs so the per-function `postgres` cfg gates were dropped inside the file.
mod.rs: 2803 → 2637 LOC (-166). pg_on.rs: 181 LOC.
`raw_query_on` + `fetch_aggregate_on` still live in mod.rs (they're at lines 1038+ in a different section) — separate step.
Part of
#116 (step 9)
Test plan