cornucopia-rs / cornucopia

Generate type-checked Rust from your PostgreSQL.
Other
759 stars 31 forks source link

feat: Support NUMERIC to rust_decimal::Decimal #162

Closed jacobsvante closed 1 year ago

jacobsvante commented 1 year ago

Sorry for not adding any unit tests, stressful days. Think of this as a reminder for the time being. It seems to be working though.

LouisGariepy commented 1 year ago

Yeah we'll need some testing to ensure that everything is OK, but this is indeed the right way to support new types.

One minor concern I have is that the ToSql and FromSql impls for rust_decimal_Decimal are not maintained by the rust-postgres org. I don't think this is overly problematic though.

LouisGariepy commented 1 year ago

Oh by the way, I can add the tests myself, no worries :smile: You can look at the diff to see how I did it if you're interested. I'll try to get to it soon.

Thanks for the PR Jacob!

jacobsvante commented 1 year ago

Great, thanks!