Skip to content

Commit

Permalink
fix(integrations): params order
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Feb 11, 2024
1 parent 75d59d0 commit 6957f45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions db/Store.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ type Store interface {

CreateIntegrationExtractor(integrationExtractor IntegrationExtractor) (newIntegrationExtractor IntegrationExtractor, err error)
GetIntegrationExtractors(integrationID int, params RetrieveQueryParams) ([]IntegrationExtractor, error)
GetIntegrationExtractor(extractorID int, integrationID int) (extractor IntegrationExtractor, err error)
GetIntegrationExtractor(integrationID int, extractorID int) (extractor IntegrationExtractor, err error)
UpdateIntegrationExtractor(integrationExtractor IntegrationExtractor) error
GetIntegrationExtractorRefs(integrationID int, extractorID int) (IntegrationExtractorReferrers, error)
DeleteIntegrationExtractor(integrationID int, extractorID int) error
Expand All @@ -158,7 +158,7 @@ type Store interface {

CreateIntegrationExtractValue(value IntegrationExtractValue) (newValue IntegrationExtractValue, err error)
GetIntegrationExtractValues(extractorID int, params RetrieveQueryParams) ([]IntegrationExtractValue, error)
GetIntegrationExtractValue(valueID int, extractorID int) (value IntegrationExtractValue, err error)
GetIntegrationExtractValue(extractorID int, valueID int) (value IntegrationExtractValue, err error)
UpdateIntegrationExtractValue(integrationExtractValue IntegrationExtractValue) error
GetIntegrationExtractValueRefs(extractorID int, valueID int) (IntegrationExtractorChildReferrers, error)
DeleteIntegrationExtractValue(extractorID int, valueID int) error
Expand All @@ -168,7 +168,7 @@ type Store interface {
CreateIntegrationMatcher(matcher IntegrationMatcher) (newMatcher IntegrationMatcher, err error)
GetIntegrationMatchers(extractorID int, params RetrieveQueryParams) ([]IntegrationMatcher, error)
GetAllIntegrationMatchers() ([]IntegrationMatcher, error)
GetIntegrationMatcher(matcherID int, extractorID int) (matcher IntegrationMatcher, err error)
GetIntegrationMatcher(extractorID int, matcherID int) (matcher IntegrationMatcher, err error)
UpdateIntegrationMatcher(integrationMatcher IntegrationMatcher) error
GetIntegrationMatcherRefs(extractorID int, matcherID int) (IntegrationExtractorChildReferrers, error)
DeleteIntegrationMatcher(extractorID int, matcherID int) error
Expand Down
12 changes: 7 additions & 5 deletions db/sql/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (d *SqlDb) CreateIntegrationExtractor(integrationExtractor db.IntegrationEx
return
}

func (d *SqlDb) GetIntegrationExtractor(extractorID int, integrationID int) (extractor db.IntegrationExtractor, err error) {
func (d *SqlDb) GetIntegrationExtractor(integrationID int, extractorID int) (extractor db.IntegrationExtractor, err error) {
query, args, err := squirrel.Select("e.*").
From("project__integration_extractor as e").
Where(squirrel.And{
Expand Down Expand Up @@ -245,7 +245,9 @@ func (d *SqlDb) CreateIntegrationExtractValue(value db.IntegrationExtractValue)
}

insertID, err := d.insert("id",
"insert into project__integration_extract_value (value_source, body_data_type, key, variable, name, extractor_id) values (?, ?, ?, ?, ?, ?)",
"insert into project__integration_extract_value "+
"(value_source, body_data_type, `key`, `variable`, `name`, extractor_id) values "+
"(?, ?, ?, ?, ?, ?)",
value.ValueSource,
value.BodyDataType,
value.Key,
Expand All @@ -265,7 +267,7 @@ func (d *SqlDb) CreateIntegrationExtractValue(value db.IntegrationExtractValue)

func (d *SqlDb) GetIntegrationExtractValues(extractorID int, params db.RetrieveQueryParams) ([]db.IntegrationExtractValue, error) {
var values []db.IntegrationExtractValue
err := d.getObjectsByReferrer(extractorID, db.IntegrationExtractorProps, db.IntegrationExtractValueProps, params, &values)
err := d.getObjectsByReferrer(extractorID, db.IntegrationExtractValueProps, db.IntegrationExtractValueProps, params, &values)
return values, err
}

Expand All @@ -276,7 +278,7 @@ func (d *SqlDb) GetAllIntegrationExtractValues() (values []db.IntegrationExtract
return
}

func (d *SqlDb) GetIntegrationExtractValue(valueID int, extractorID int) (value db.IntegrationExtractValue, err error) {
func (d *SqlDb) GetIntegrationExtractValue(extractorID int, valueID int) (value db.IntegrationExtractValue, err error) {
query, args, err := squirrel.Select("v.*").
From("project__integration_extract_value as v").
Where(squirrel.Eq{"id": valueID}).
Expand Down Expand Up @@ -374,7 +376,7 @@ func (d *SqlDb) GetAllIntegrationMatchers() (matchers []db.IntegrationMatcher, e
return
}

func (d *SqlDb) GetIntegrationMatcher(matcherID int, extractorID int) (matcher db.IntegrationMatcher, err error) {
func (d *SqlDb) GetIntegrationMatcher(extractorID int, matcherID int) (matcher db.IntegrationMatcher, err error) {
query, args, err := squirrel.Select("m.*").
From("project__integration_matcher as m").
Where(squirrel.Eq{"id": matcherID}).
Expand Down

0 comments on commit 6957f45

Please sign in to comment.