dbconn
This commit is contained in:
@@ -27,7 +27,7 @@ func ParseDBType(qType repository.Querytype) (Type, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func ToDBQueryType(t Type) (repository.NullQuerytype, error) {
|
||||
func ToDBQueryType(t Type) (repository.Querytype, error) {
|
||||
var dbType repository.Querytype
|
||||
|
||||
switch t {
|
||||
@@ -36,7 +36,16 @@ func ToDBQueryType(t Type) (repository.NullQuerytype, error) {
|
||||
case TypeContextFull:
|
||||
dbType = repository.QuerytypeContextFull
|
||||
default:
|
||||
return repository.NullQuerytype{}, fmt.Errorf("invalid database query type")
|
||||
return repository.QuerytypeContextFull, fmt.Errorf("invalid database query type")
|
||||
}
|
||||
|
||||
return dbType, nil
|
||||
}
|
||||
|
||||
func ToDBNullQueryType(t Type) (repository.NullQuerytype, error) {
|
||||
dbType, err := ToDBQueryType(t)
|
||||
if err != nil {
|
||||
return repository.NullQuerytype{}, err
|
||||
}
|
||||
|
||||
return repository.NullQuerytype{Querytype: dbType, Valid: true}, nil
|
||||
|
||||
Reference in New Issue
Block a user