Fix issue with using UUID primary keys in complex return types

When using a UUID as a primary key with PostgreSQL the grouping was
defaulting to the row which caused incorrect results to be returned.
This commit is contained in:
Christian King 2019-10-17 13:27:18 -04:00 committed by Christian King
parent 4fb1f52c85
commit 9a3f12ea5f
2 changed files with 151 additions and 1 deletions

View file

@ -170,7 +170,9 @@ func isSimpleModelType(objType reflect.Type) bool {
case reflect.Slice:
return objType.Elem().Kind() == reflect.Uint8 //[]byte
case reflect.Struct:
return objType == timeType || objType == uuidType // time.Time || uuid.UUID
return objType == timeType
case reflect.Array:
return objType == uuidType // uuid.UUID returns reflect.Array kind
}
return false