Skip to content

Derive transparent#857

Merged
sfackler merged 1 commit into
rust-postgres:masterfrom
malobre:feature/derive-transparent
Dec 30, 2021
Merged

Derive transparent#857
sfackler merged 1 commit into
rust-postgres:masterfrom
malobre:feature/derive-transparent

Conversation

@malobre

@malobre malobre commented Dec 29, 2021

Copy link
Copy Markdown
Contributor

#[postgres(transparent)]

Acknowledgments

Example

#[derive(ToSql, FromSql)]
#[postgres(transparent)]
struct UserId(i32);

Comment thread postgres-derive/src/overrides.rs Outdated
@sfackler

Copy link
Copy Markdown
Collaborator

Nice! Would also be good to have a few quick tests.

@malobre

malobre commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

I added basic tests and updated some of the logic.

@malobre malobre marked this pull request as ready for review December 30, 2021 19:20
Comment thread postgres-derive-test/src/compile-fail/invalid-transparent.rs
@sfackler

Copy link
Copy Markdown
Collaborator

Can you add a little bit of docs to the postgres-types crate?

LTGM otherwise!

Comment thread postgres-derive/src/fromsql.rs
@malobre

malobre commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

I added documentation and squashed all the commits into one.
Edit: Had to squash again, I missed one of your comment.

@sfackler sfackler merged commit 774016d into rust-postgres:master Dec 30, 2021
@malobre malobre deleted the feature/derive-transparent branch December 30, 2021 23:10
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.

2 participants