Minimize non-"meta" contents of pgrx::datum: uuid, json, net, num#2359
Open
ChronicallyJD wants to merge 4 commits into
Open
Minimize non-"meta" contents of pgrx::datum: uuid, json, net, num#2359ChronicallyJD wants to merge 4 commits into
pgrx::datum: uuid, json, net, num#2359ChronicallyJD wants to merge 4 commits into
Conversation
Moves `Uuid` and `UuidBytes` out of `pgrx::datum` into a new top-level `pgrx::uuid` module. Everything remains accessible from the previous paths via re-export, so this is purely organizational with no end-user impact except new path options. Part of pgcentralfoundation#2194. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Moves `Json`, `JsonB`, and `JsonString` out of `pgrx::datum` into a new top-level `pgrx::json` module. Everything remains accessible from the previous paths via re-export, so this is purely organizational with no end-user impact except new path options. Part of pgcentralfoundation#2194. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Moves `Inet` out of `pgrx::datum` into a new top-level `pgrx::net` module. Everything remains accessible from the previous paths via re-export, so this is purely organizational with no end-user impact except new path options. Part of pgcentralfoundation#2194. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Moves `AnyNumeric`, `Numeric`, and their numeric_support module out of `pgrx::datum` into a new top-level `pgrx::num` module (with the support code at `pgrx::num::support`). Everything remains accessible from the previous paths via re-export, including the `pgrx::datum::numeric` and `pgrx::datum::numeric_support` module paths, so this is purely organizational with no end-user impact except new path options. Part of pgcentralfoundation#2194. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Note: the failing `verify package can build` check on this PR is a pre-existing issue on `develop`, unrelated to this change. That workflow builds with nightly, which promotes the `semicolon_in_expressions_from_macros` lint (rust-lang/rust#79813) to a hard error, tripping some `bail!(...)` calls used in expression position. This PR does not touch that code. Fixed separately in #2360. |
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
Continues #2194 by moving the remaining basic-datatype items out of
pgrx::datuminto dedicated top-level modules, following thedatetimeprecedent from #2199. This covers the outstanding checklist items:uuid→pgrx::uuidjson→pgrx::jsonnet(inet) →pgrx::netnumeric→pgrx::num(with its support code atpgrx::num::support)Each type group is a separate commit.
Everything remains accessible from the previous paths via re-export, so this is purely organizational with no end-user impact except new path options. In particular, the module paths
pgrx::datum::numericandpgrx::datum::numeric_supportare preserved, along with the re-exports flowing throughpgrx::preludeand the crate root (pgrx::Uuid,pgrx::Inet,pgrx::Json,pgrx::JsonB,pgrx::AnyNumeric,pgrx::Numeric,pgrx::numeric).pgrx::numuses the samenum.rs+num/layout thatdatetime.rs+datetime/uses.Note on clippy
Moving code out of
datumdrops the module-level#![allow(...)]ondatum/mod.rs, so the numeric move surfaces twoclippy::unnecessary_fallible_conversionswarnings (tracked in #1525). This matches thedatetimemigration exactly:datetime.rscarries no such allows and already surfaces the same lint ondevelop. No new allows were added, to stay consistent with that precedent.Testing
Against PostgreSQL 18:
cargo test --all --features "pg18 pg_test cshim proptest" --no-default-features— all suites pass (977 tests, 0 failures, including the 603-testpgrx-testsintegration suite).cargo fmt --all --check— clean.cargo clippy -p pgrx-sql-entity-graph -- -Dwarnings— clean.Part of #2194.