Merged in feature/testquery (pull request #39)
Test Query * depstextandclean * startedcleaningresult * resulttidyup * roundone * cleaning * unsyncedquery * startedtestsandsimplification * api * querytests * resultprocessortests * unittests * cleanup
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
resultprocessor "queryorchestration/internal/query/result/processor"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
func (s *Service) Create(ctx context.Context, entity *queryprocessor.Create) (uuid.UUID, error) {
|
||||
func (s *Service) Create(ctx context.Context, entity *resultprocessor.Create) (uuid.UUID, error) {
|
||||
err := s.normalizeCreate(ctx, entity)
|
||||
if err != nil {
|
||||
return uuid.Nil, err
|
||||
@@ -27,7 +27,7 @@ func (s *Service) Create(ctx context.Context, entity *queryprocessor.Create) (uu
|
||||
return id, err
|
||||
}
|
||||
|
||||
func (s *Service) normalizeCreate(ctx context.Context, entity *queryprocessor.Create) error {
|
||||
func (s *Service) normalizeCreate(ctx context.Context, entity *resultprocessor.Create) error {
|
||||
err := s.NormalizeQueryIDs(ctx, entity)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -51,7 +51,7 @@ func (s *Service) normalizeCreate(ctx context.Context, entity *queryprocessor.Cr
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) submitCreate(ctx context.Context, entity *queryprocessor.Create) (uuid.UUID, error) {
|
||||
func (s *Service) submitCreate(ctx context.Context, entity *resultprocessor.Create) (uuid.UUID, error) {
|
||||
query, err := parseCreateQuery(entity)
|
||||
if err != nil {
|
||||
return uuid.Nil, err
|
||||
@@ -103,11 +103,11 @@ func (s *Service) submitCreate(ctx context.Context, entity *queryprocessor.Creat
|
||||
|
||||
}
|
||||
|
||||
func (s *Service) getCreator(qType queryprocessor.Type) (queryprocessor.Creator, error) {
|
||||
func (s *Service) getCreator(qType resultprocessor.Type) (resultprocessor.Creator, error) {
|
||||
switch qType {
|
||||
case queryprocessor.TypeJsonExtractor:
|
||||
case resultprocessor.TypeJsonExtractor:
|
||||
return jsonextractor.NewCreator(s.db), nil
|
||||
case queryprocessor.TypeContextFull:
|
||||
case resultprocessor.TypeContextFull:
|
||||
return contextfull.NewCreator(s.db), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("attempting to process invalid query type")
|
||||
@@ -120,8 +120,8 @@ type createQuery struct {
|
||||
Config *[]byte
|
||||
}
|
||||
|
||||
func parseCreateQuery(q *queryprocessor.Create) (*createQuery, error) {
|
||||
t, err := queryprocessor.ToDBQueryType(q.Type)
|
||||
func parseCreateQuery(q *resultprocessor.Create) (*createQuery, error) {
|
||||
t, err := resultprocessor.ToDBQueryType(q.Type)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user