Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ignoring attributes for deriving FromRow #2366

Merged
merged 5 commits into from
Mar 14, 2023

Conversation

grgi
Copy link
Contributor

@grgi grgi commented Feb 22, 2023

This pull request adds a new attribute flag skip for deriving FromRow (similar to serde's skip). It allows to add additional fields to a struct which will be filled with Default::default().

This is PR #2341 reopened since the branch 0.7-dev was deleted.

@saiintbrisson
Copy link
Contributor

This is reaaaaally nice. I hope it makes the cut in time for 0.7

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

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

@grgi can you please add a mention of this to the docs for #[derive(FromRow)]? It'd be pretty difficult to discover otherwise.

@grgi grgi force-pushed the fromrow-skip-dev branch from 15713ba to 8929f74 Compare March 3, 2023 09:46
@grgi
Copy link
Contributor Author

grgi commented Mar 3, 2023

@abonander Sorry, my bad! I have just added a skip section to the FromRow documentation.

@grgi grgi requested a review from abonander March 3, 2023 09:51
sqlx-core/src/from_row.rs Outdated Show resolved Hide resolved
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
@grgi grgi requested a review from abonander March 4, 2023 11:33
@grgi
Copy link
Contributor Author

grgi commented Mar 11, 2023

@abonander Is it ok now?

@abonander abonander merged commit 70934d7 into launchbadge:main Mar 14, 2023
@grgi grgi deleted the fromrow-skip-dev branch October 6, 2023 09:31
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.

3 participants