Skip to content

fix fromsql for domains#1189

Merged
paolobarbolini merged 2 commits intorust-postgres:masterfrom
zacknewman:master
Sep 21, 2025
Merged

fix fromsql for domains#1189
paolobarbolini merged 2 commits intorust-postgres:masterfrom
zacknewman:master

Conversation

@zacknewman
Copy link
Copy Markdown
Contributor

Fixes #1188.

@sfackler
Copy link
Copy Markdown
Collaborator

Can you add a test for the case that was failing before this fix?

@zacknewman
Copy link
Copy Markdown
Contributor Author

Added a test.

@zacknewman
Copy link
Copy Markdown
Contributor Author

zacknewman commented Feb 5, 2025

@sfackler, ping. Is it possible this gets merged? Currently one has to maintain their own fork that isn't affected by this bug, manually implement FromSql instead of deriveing it, or live without the ability to construct certain types in PostgreSQL (which ideally would be documented at least). Can I improve the PR somehow?

@ZakSingh
Copy link
Copy Markdown

Would really love to see this merged! Ran into this issue recently.

Copy link
Copy Markdown
Member

@paolobarbolini paolobarbolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlx ended up merging the PR mentioned in #1188 (comment), and their fix is very similar to yours https://github.com/launchbadge/sqlx/blob/c52e129e8341c46b2ea5c9b912e1af665be1ef83/sqlx-postgres/src/type_info.rs#L1039-L1050. They haven't tagged a release yet, so it hasn't really been tested in the wild, but the fix looks right so I'm merging it.

@paolobarbolini paolobarbolini merged commit dd291a4 into rust-postgres:master Sep 21, 2025
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.

unreachable code entered when SELECTing nested composite types and DOMAINs

4 participants