sfackler / rust-postgres

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

Derive Clone for Row #1152

Closed levkk closed 3 months ago

levkk commented 3 months ago

Feature

Derive a Clone implementation for tokio_postgres::Row.

Use case

I want to clone the row. I can't see why I shouldn't be able to, the actual data is stored in bytes::Bytes, which is made to be cloned, and the Statement (including columns, etc) is behind an Arc, which is exactly the same as bytes::Bytes.

Workarounds

I could place the row in an Arc, but that would be pretty silly since underneath it would be two Arcs stored inside another Arc.