Content pfp
Content
@
0 reply
0 recast
0 reaction

Brenner pfp
Brenner
@brenner.eth
Does any one have a pattern they like when using prost and sqlx? Specifically for enums? I want to go from proto enum -> rust enum -> sql enum without having to manually write conversions, or call `to_string()` on my enums I'm using tonic_build / prost_build Any ideas?
2 replies
0 recast
2 reactions

Shriphani Palakodety pfp
Shriphani Palakodety
@shriphani
Prost should give you rust structs tor each message. If there is a trait you want impled on these generated structs, the tonic/prost config has a config.type_attribute you can use to derive then
1 reply
0 recast
0 reaction

Brenner pfp
Brenner
@brenner.eth
I want the default value they return to be the string representation, not the int32, and I am 99% convinced there’s not a way to do that
0 reply
0 recast
0 reaction