-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Rename sqlx(rename) attribute to sqlx(type_name) #940
Conversation
120214a
to
90b99ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of how the deprecation error turned out, at the very least it needs to be clear it's talking about attributes. Also, would you mind adjusting the documentation here
sqlx/sqlx-core/src/types/mod.rs
Line 111 in 02eea35
/// * `#[sqlx(rename = "<SQL type name>")]` on struct definition: instead of inferring the SQL type name from the inner |
10 | compile_error!("trybuild test needs to fail for stderr checking"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: use of deprecated function `sqlx::_rename`: sqlx(rename) is now called sqlx(type_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, this isn't great. In our experience, people get confused easily if the error messages aren't direct enough. I would make sure to be clear we're talking about #[sqlx(rename = "...")]
and #[sqlx(type_name = "...")]
if we can, otherwise it'd just be better to emit an error.
It's nice that it's pointing at the correct span at least.
02eea35
to
05712e1
Compare
Updated the docs and deprecation note, is this better? |
As suggested on Discord.