-
Notifications
You must be signed in to change notification settings - Fork 118
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
Should not have to wrap all WHERE values. #379
Comments
Accounts.ID.EQ(Book.ID.ADD(Int(3)) Since golang doesn't allow method name overloading this is the only way. Alternatively, we can add a new method for each type, but that would be just a marginally improvements: Accounts.ID.EQ(Uint64(id)),
// vs
Accounts.ID.EQUint64(id), Note just |
Why not have |
Then it wouldn't be a |
Could it accept a generics-constraint/interface that includes both the correct Expression type, and also the base primitives? |
The last time I tried with generics, the issue was that it was not possible to have generic method on a type. The whole type has to be generic. Maybe that has changed in the meantime. Or maybe there is some other workaround. |
It has not changed, and as far as I've read it is unlikely to change in the future too. Some technical constraints, IIRC. FWIW I like the current interface, it makes it very explicit when you're passing in something that will be compiled into a SQL parameter vs when you're passing some other type of expression. |
Is your feature request related to a problem? Please describe.
It should not be necessary to wrap values that are being used for comparisons.
Here is what the code currently looks like, where we are wrapping
id
inUint64()
:Describe the solution you'd like
Passing in regular values should be supported:
Passing in a slice directly should be supported:
The text was updated successfully, but these errors were encountered: