sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.49k stars 443 forks source link

Derive Generic FromSql/ToSql #931

Closed matt-duch closed 2 years ago

matt-duch commented 2 years ago

Allows for derivation of FromSql and ToSql for generic types. Borrowed types are allowed for ToSql, but not meaningful to support for FromSql (so not supported). (also noted in #570)

Would you be interested in this change? A test was added. Happy to iterate.

matt-duch commented 2 years ago

Updated to fix the two issues (lint and failing test).

AngusWaller commented 2 years ago

Hope this gets in soon, derive is breaking on any struct thats borrowed/lifetimes

sfackler commented 2 years ago

Sorry for the delay - LGTM other than the clippy failures!

matt-duch commented 2 years ago

@sfackler Sorry about that. Fixed, clippy runs locally, and pushed.

sfackler commented 2 years ago

Thanks! I will cut a release tomorrow.