scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
582 stars 104 forks source link

Missing `SerializeRow` impl for `Box<dyn SerializeRow>` #1043

Closed wprzytula closed 3 weeks ago

wprzytula commented 3 months ago

A user reported the following use case:

I'm trying to do a Batch query where there is one insert into table A and N inserts into table B. I'm having trouble figuring out how to create BatchValues for this. Since they are different length tuples I can't just construct a Vec of the tuples. Any suggestions on how to do this?

Implementing SerializeRow for Box<dyn SerializeRow> would allow passing Vec<Box<dyn SerializeRow>> as BatchValues.

piodul commented 3 months ago

There should just be an impl for Box<T: SerializeRow>. AFAIK &dyn Trait already implements Trait.