* add query builder to facilitate dynamic SQL construction

* leverage query builder to refactor user store

This is partially setup work for MM-13120, but merged to master to avoid
further conflicts.

* fix unrelated unit test breakage

* documentation tweaks

* Apply suggestions from code review

Co-Authored-By: lieut-data <jesse.hallam@gmail.com>

* prefer comma separated case options to fallthrough

* vendor github.com/Masterminds/squirrel and deps

* switch to using github.com/Masterminds/squirrel

* rm querybuilder
Этот коммит содержится в:
Jesse Hallam
2019-01-29 15:24:57 -05:00
коммит произвёл GitHub
родитель 099e6f74f3
Коммит 2c3a2e9235
44 изменённых файлов: 5216 добавлений и 1475 удалений

24
vendor/github.com/lann/builder/reflect.go сгенерированный поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,24 @@
package builder
import "reflect"
func convert(from interface{}, to interface{}) interface{} {
return reflect.
ValueOf(from).
Convert(reflect.TypeOf(to)).
Interface()
}
func forEach(s interface{}, f func(interface{})) {
val := reflect.ValueOf(s)
kind := val.Kind()
if kind != reflect.Slice && kind != reflect.Array {
panic(&reflect.ValueError{Method: "builder.forEach", Kind: kind})
}
l := val.Len()
for i := 0; i < l; i++ {
f(val.Index(i).Interface())
}
}