Skip to content

Minimize non-"meta" contents of pgrx::datum: uuid, json, net, num#2359

Open
ChronicallyJD wants to merge 4 commits into
pgcentralfoundation:developfrom
ChronicallyJD:issue-2194-datum-reorg
Open

Minimize non-"meta" contents of pgrx::datum: uuid, json, net, num#2359
ChronicallyJD wants to merge 4 commits into
pgcentralfoundation:developfrom
ChronicallyJD:issue-2194-datum-reorg

Conversation

@ChronicallyJD

Copy link
Copy Markdown
Member

Summary

Continues #2194 by moving the remaining basic-datatype items out of pgrx::datum into dedicated top-level modules, following the datetime precedent from #2199. This covers the outstanding checklist items:

  • uuidpgrx::uuid
  • jsonpgrx::json
  • net (inet) → pgrx::net
  • numericpgrx::num (with its support code at pgrx::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::numeric and pgrx::datum::numeric_support are preserved, along with the re-exports flowing through pgrx::prelude and the crate root (pgrx::Uuid, pgrx::Inet, pgrx::Json, pgrx::JsonB, pgrx::AnyNumeric, pgrx::Numeric, pgrx::numeric).

pgrx::num uses the same num.rs + num/ layout that datetime.rs + datetime/ uses.

Note on clippy

Moving code out of datum drops the module-level #![allow(...)] on datum/mod.rs, so the numeric move surfaces two clippy::unnecessary_fallible_conversions warnings (tracked in #1525). This matches the datetime migration exactly: datetime.rs carries no such allows and already surfaces the same lint on develop. 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-test pgrx-tests integration suite).
  • cargo fmt --all --check — clean.
  • cargo clippy -p pgrx-sql-entity-graph -- -Dwarnings — clean.

Part of #2194.

ChronicallyJD and others added 4 commits July 16, 2026 18:10
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>
@ChronicallyJD

Copy link
Copy Markdown
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.

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