-
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
Add SCREAMING_SNAKE_CASE rename_all option #478
Conversation
#[derive(PartialEq, Debug, sqlx::Type)] | ||
#[sqlx(rename = "color_screaming_snake")] | ||
#[sqlx(rename_all = "screaming_snake_case")] | ||
enum ColorScreamingSnake { |
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.
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.
We don't have any standing policy right now dictating that everything must be tested on all databases. I think in general we want to keep the bar for landing contributions as low as possible while still having a minimal level of assurance that a given feature works. Not everyone is willing or able to write and run tests for all DB flavors.
For something like this that is pretty database-agnostic, I think is okay being tested on just one database. For PRs that may potentially have DB-specific issues like adding new types, we definitely want to cover all our (data)bases.
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.
That makes sense, thanks for the clarification!
@FuegoFro awesome! Excited to see this! After adding uppercase, I realized I needed screaming snake for some of my enums but I've just been manually adding names. |
tests/postgres/derives.rs
Outdated
@@ -58,6 +58,14 @@ enum ColorUpper { | |||
Blue, | |||
} | |||
|
|||
#[derive(PartialEq, Debug, sqlx::Type)] | |||
#[sqlx(rename = "color_screaming_snake")] | |||
#[sqlx(rename_all = "screaming_snake_case")] |
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.
Looks like the case for this and line 54 need to be updated.
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.
Ah yup, my bad for missing this!
This mirrors the addition of `uppercase` in launchbadge#304, but for all uppercase snake case.
b10f670
to
f42b65c
Compare
@abonander I'm fairly new to Rust dev and the errors in CI here are a bit opaque to me. They seem to be unrelated to the changes I've made, and when I try to reproduce them locally (eg by running Do you have any tips for how I can track down and fix these CI failures? |
That failure looks unrelated to your PR. Thanks for the contribution. 💯 |
Thank you for the merge! 😀 |
This mirrors the addition of
uppercase
in #304, but for all uppercase snake case.