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

Add example for manual implemenation of the FromRow trait #1495

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

Erik1000
Copy link
Contributor

After a discussion on the discord server, i decided to add an example for a manual implemenation of the FromRow trait. A manual implementation is useful if you can't use the derive macro (e.g. because of a external type from another crate)

sqlx-core/src/from_row.rs Outdated Show resolved Hide resolved
@abonander
Copy link
Collaborator

If you rebase it should fix the MySQL build failure.

@Erik1000
Copy link
Contributor Author

Okay 👍

sqlx-core/src/from_row.rs Outdated Show resolved Hide resolved
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.

One nit.

sqlx-core/src/from_row.rs Outdated Show resolved Hide resolved
@abonander
Copy link
Collaborator

Also looks like a rebase is needed.

@Erik1000
Copy link
Contributor Author

Also looks like a rebase is needed.

I've rebased.
Also, have you seen my comment in the first thread about the dev-dependency? I had to update one example in 844342f because it interfered with the new dev-dependency.

@abonander
Copy link
Collaborator

@Erik1000 I'm really sorry to have neglected this PR for so long. It got pushed onto the second page for a while, which I often forget to check.

We did end up adding sqlx as a dev-dependency to sqlx-core exactly so it can be used in doctests. I think you should only have to rebase your PR and drop the change to sqlx-core/Cargo.toml and it should work now.

@Erik1000
Copy link
Contributor Author

I'll have a look at it next week 👍

@Erik1000
Copy link
Contributor Author

@abonander I've rebased and it's ready to be merged.

@abonander abonander merged commit 78a0a59 into launchbadge:main Jul 19, 2022
@abonander
Copy link
Collaborator

Great, thanks!

@Erik1000 Erik1000 deleted the from-row-example branch July 19, 2022 21: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