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

implement IntoMockRow from derive for FromQueryResult to support testing #1440

Open
mohs8421 opened this issue Feb 1, 2023 · 0 comments
Open

Comments

@mohs8421
Copy link
Contributor

mohs8421 commented Feb 1, 2023

Motivation

When creating structs with #[derive(FromQueryResult)] it is annoying to translate them into MockRow, because the type is not really supportive to any implementations. To achive that, the only way is to create a BTreeMap<&str, Value> which implements IntoMockRow.

Proposed Solutions

I think the best idea would be to drop the trait IntoMockRow as it is hard to implement from the outside and instead automatically implement From<R: FromQueryResult> for IntoMockRow however it might be necessary to do that through derive.

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

No branches or pull requests

1 participant