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

Dynamically Loading values into Select Statements #1887

Closed
acycliczebra opened this Issue Oct 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@acycliczebra

acycliczebra commented Oct 15, 2018

I want to load values dynamically into my select statement. Is this possible in Diesel?

I would Ideally like to be able to pass a vector that I can dynamically generate, and get back as dynamically typed values in return.

Here's a simplified version of the problem:

let columns = binding_at_runtime(); // at runtime, either returns ("a",), ("b",), ("a", "b") or ("b", "a"), or ("a", "b", "c"), or ("a", "c", "b"), etc.
let data: Vec<Vec<Value>> = my_table.select(columns).load(&conn)?;

Thanks everyone!

@acycliczebra acycliczebra changed the title from Dynamically Loading values into to Dynamically Loading values into Select Statements Oct 15, 2018

@weiznich

This comment has been minimized.

Contributor

weiznich commented Oct 15, 2018

How would Value looks like in that case?

(I've closed this issue because our issue tracker should only contain actionable bugs where someone is actively working on or where we are looking for help. For feature request use our forum)

@weiznich weiznich closed this Oct 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment