-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: use try_into
in sqlx::query_as!
conversions
#2649
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
Conversation
This is a breaking change. |
should the blanket |
IMO this would be a great improvement — @abonander, could you perhaps expand a little on your previous comment? If this is indeed a breaking change, are you outright rejecting this PR, or do you see a path forward to getting this merged, perhaps in an upcoming release that would permit breaking changes? |
If I'm honest, it's mostly a gut feeling that a sweeping change like this should not sneak into a minor release. Even if it seems like it should be backward-compatible, there may be some subtle detail that we're not seeing that comes back to bite us later. We should also be considerate of forward compatibility. If this change goes out in a minor release and someone updates their code to rely on it, then has to downgrade for whatever reason (e.g. to work around a bug), they're going to have a huge headache. In all, my gut is telling me this is something that should be reserved for 0.8.0. |
Separately from the question of whether it's a breaking change, is this really the right thing to do? It would allow querying a table with an |
That is a fair concern as well. It has a lot of potential to turn compile-time errors into runtime errors, which is exactly the opposite of what we want. |
Thank you for your comments, I definitely understand the concerns and agree about avoiding turning compile time errors into runtime errors. I also agree this is too large of a change to be a small patch. Would a |
I think it would be better to be able to opt into this on a per-field basis, and require the user to explicitly specify the type to decode to ensure type-safety. Ultimately, we want I have an alternative, more immediately actionable idea which I'll elaborate on in the motivating issue, #2648. I'm going to close this PR as I'm not prepared to merge it as written because of the problems we've discussed. |
closes #2648