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
[Feature Request] Concrete type WhereIn
helpers
#344
Comments
First of all I'm not 100% sure why this would be a breaking change. Sounds like you just want some extra helpers to convert say |
Spot on @aarondl. |
Something like that: names := []string{"bernd", "werner", "urs"}
namesInterface := make([]interface{}, len(names))
for i, v := range names {
namesInterface[i] = v
} |
@aarondl, I guess the breaking change comment was if changes were made to the |
This will be superceded by #426 |
Not sure where to comment as both issues are closed, but I just realised #426 never actually implemented a helper for the Any chance of this getting re-opened until that's done? Cheers. |
We have methods that accept 1 or more lists of values for certain queries, a simple example might be something like this:
But.. the types aren't interfaces, they're often just strings or UUIDs, sometimes ints or enums. So we need to write a helper to convert our concrete slices to
interface{}
an slice. We can't use varargs, because the input values aren't hard-coded or fixed length.Would it be worth the query mod system supporting these concrete types somehow? Maybe not
WhereInString
but ratherWhereIn("type in ?", qm.InStrings(types))
or maybe theWhere
could be more powerful by accepting a parameter implementing anIn
interface of some sort instead?I understand this would probably look like a breaking change, but I'm hoping you've already got some ideas on this? 😃
The text was updated successfully, but these errors were encountered: