Merged in feature/listtypes (pull request #23)
Feature/listtypes * started * cleanuplist * someunittestfixes * removemostflakiness
This commit is contained in:
@@ -40,6 +40,20 @@ func ToDBQueryType(t Type) (repository.Querytype, error) {
|
||||
return dbType, nil
|
||||
}
|
||||
|
||||
func ToDBQueryTypeArray(t []Type) ([]repository.Querytype, error) {
|
||||
arr := make([]repository.Querytype, len(t))
|
||||
for index, value := range t {
|
||||
v, err := ToDBQueryType(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
arr[index] = v
|
||||
}
|
||||
|
||||
return arr, nil
|
||||
}
|
||||
|
||||
func ToDBNullQueryType(t Type) (repository.NullQuerytype, error) {
|
||||
dbType, err := ToDBQueryType(t)
|
||||
if err != nil {
|
||||
@@ -59,7 +73,7 @@ func ParseDBCollectorQuery(q *repository.GetCollectorQueriesRow) (*Query, error)
|
||||
|
||||
return &Query{
|
||||
ID: database.MustToUUID(q.Queryid),
|
||||
Version: q.Queryversion.Int32,
|
||||
Version: *q.Queryversion,
|
||||
Type: qType,
|
||||
RequiredQueryIDs: reqQueryIDs,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user