Open jakubadamw opened 2 years ago
So this adds a few dependencies to keep the implementation concise. I, personally, subscribe to the “use as much of the crates.io ecosystem as you can possibly can” philosophy, but I can see how it may not be appropriate for the project. Still, that's what I did in the first version to gather feedback. Which dependency should be got rid of can perhaps be decided later.
Since this is a library, I think it would be better to avoid introducing external dependencies to keep compile times down.
@sfackler thoughts?
The case conversion code in serde_derive might be helpful.
@jakubadamw are you still working on this, would love this feature
@JaydenElliott hey, not really, no. I'll be happy for someone else to take over this. 🙂
It works both with composite types' fields and enum variants, although arguably it will be the most useful for the latter as that's where the naming conventions between Rust and a typical PostgreSQL schema differ.
Right now it supports the following casing styles, following serde:
"camelCase"
"kebab-case"
"lowercase"
"PascalCase"
"SCREAMING-KEBAB-CASE"
"SCREAMING_SNAKE_CASE"
"snake_case"
"UPPERCASE"
Addresses #934.