sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Add more JsonRawValue encode/decode impls.

Open Dirbaio opened this issue 7 months ago • 0 comments

This PR adds a Decode impl for Box<JsonRawValue>. This allows keeping structs that implement FromRow lifetime-free, previously you had to use &'a JsonRawValue.

struct Foo {
    bar: Box<JsonRawValue>,
}

I've also added Encode impls for JsonRawValue. There was a comment stating "We don't have to implement Encode for JsonRawValue because that's covered by the default implementation for Encode" but as far as I can tell that's not true, no default impl would cover JsonRawValue.

Dirbaio avatar May 15 '25 13:05 Dirbaio