Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a a very large number of Parameters for a Query and I would like to merge 2 ValueLists #990

Open
WarrenN1 opened this issue Apr 24, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@WarrenN1
Copy link

WarrenN1 commented Apr 24, 2024

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.

@wprzytula
Copy link
Collaborator

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.

@wprzytula wprzytula added question Further information is requested enhancement New feature or request labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants