sfackler / rust-postgres

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

Adds support for zero-copy FromSql derive #1070

Open JosephMoniz opened 10 months ago

JosephMoniz commented 10 months ago

Similar in spirit and implementation to how serde supports borrowed deserialization lifetimes. Like serde, it uses 'de as the lifetime of the trait (FromSql<'de>) and it adds all borrowed liftimes as lifetime bounds on 'de.

Also like serde all top level references automatically have their lifetimes borrowed, but container types carrying references must explicity be borrowed with the #[postgres(borrow)] annotation.

Follows up on: https://github.com/sfackler/rust-postgres/pull/574

JosephMoniz commented 9 months ago

Can anyone w/ maintainer privileges please kick off the test workflow 🙏