-
Notifications
You must be signed in to change notification settings - Fork 377
Add parameter support for IN (...) #143
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
Conversation
@@ -1540,7 +1543,9 @@ func maybeExpandNamedQuery(m *DbMap, query string, args []interface{}) (string, | |||
return arg.MapIndex(reflect.ValueOf(key)) | |||
}) | |||
// #84 - ignore time.Time structs here - there may be a cleaner way to do this | |||
case arg.Kind() == reflect.Struct && !(arg.Type().PkgPath() == "time" && arg.Type().Name() == "Time"): | |||
case arg.Kind() == reflect.Struct && | |||
!(arg.Type().PkgPath() == "time" && arg.Type().Name() == "Time") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think doing something like
var (
timeType = reflect.TypeOf(time.Time{})
listType = reflect.TypeOf(List{})
)
func ..
if arg.Type() != timeType && arg.Type() != listType {
..
}
could be cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree, good point.
Just bumping this, any comments on it? |
Hi, I was just wondering if I could get some feedback on this pull request? Thanks in advance! |
"strings" | ||
) | ||
|
||
const ( | ||
NOT_POSTGRES = -2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite being constant, this should be lowerCamel, to avoid exporting it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is meant to indicate absence of an index. The builtin string index functions use -1 -- any reason you chose -2 ?
Add support for expansion of a slice of values if the slice was tagged wrapped with gorp.List{}. It should be noted that for sqlite this only works if '?' are the only used placeholders.