You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@AlekSi, I remember on a meetup you said that you avoid reflection to avoid "interface{}" (to work with specific types, instead -- to avoid runtime errors). But "args" is already []interface{} :)
Also you don't really required in reflection. You can use something like:
switcharg:=argI.(type) {
case []int:
[animplementationforslices]
case []int64:
[animplementationforslices]
case []float32:
[animplementationforslices]
case []float64:
[animplementationforslices]
case []string:
[animplementationforslices]
case []time.Time:
[animplementationforslices]
case []interface{}:
[animplementationforslices]
default:
[oldimplementation]
}
Moreover, the most serious problem is not reflection, but replacing the placeholder in the query to a set of placeholders.
reform has different methods to make IN statements now
The first one handles just one IN for a column, In the second I have to make placeholders for IN by myself.
What I want is the same logic as in the first case, but reform should automatically expand args element to $1, $2 if this element has a slice value.
The text was updated successfully, but these errors were encountered: