scylla-rust-driver
scylla-rust-driver copied to clipboard
I have a a very large number of Parameters for a Query and I would like to merge 2 ValueLists
I have 2 ValueLists that I need to merge because I have a query with a very large number of parameters. I do not want to have to pass all the values individually. How would I go about doing this? ValueList seems to have a private buffer for the serialized values. Any help would be deeply appreciated.
More specifically, ValueList just takes a struct A
for example and turns it into a SerializedResult
of type
Result<Cow<SerializedValues>, SerializeValuesError>
. My goal is I want to be able to take 2 structs struct A
and struct B
that both implement ValueList
and pass them to a query
. So I want to be able to merge them into 1 ValueList
.
At the first glance, I don't immediately see a convenient solution to your problem.
In general though, I recommend using the new SerializeCql
/SerializeRow
trait tandem instead of the obsolete Value
/ValueList
pair.
What you could do is creating a wrapper struct that would take both A
and B
and implement SerializeRow
on it manually so that it achieves what want to.
We can consider implementing a general adapter that would take two structs implementing SerializeRow
and implement serialization of them consecutively as a row. At the moment I don't know yet whether this is even feasible, tbh.