Skip to content

Commit

Permalink
chore: optimised outputs for filter tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwenk committed Oct 22, 2024
1 parent 27ab803 commit d3fb735
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/database/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,6 @@ func (p *PostgresSQLDB) BuildBrowseOptionsWhere(filters Filters) (string, []stri
}
}

fmt.Println("parameters: ", parameters)

return query, parameters
}

Expand All @@ -1041,7 +1039,8 @@ func (p *PostgresSQLDB) GetAccessionsByFilterOptions(filters Filters) ([]string,
query = query + " ORDER BY contributor, accession;"
}

fmt.Println("query: ", query)
fmt.Println("GetAccessionsByFilterOptions -> query: ", query)
fmt.Println(" -> parameters: ", parameters)

stmt, err := p.database.Prepare(query)
if err != nil {
Expand Down Expand Up @@ -1142,7 +1141,6 @@ func (p *PostgresSQLDB) GetMsTypeAndIonMode() (*MSTypeAndIonMode, error){

// GetUniqueValues see [MB3Database.GetUniqueValues]
func (p *PostgresSQLDB) GetUniqueValues(filters Filters) (MB3Values, error) {

var val MB3Values = MB3Values{}
var rows *sql.Rows
var err error
Expand Down Expand Up @@ -1187,6 +1185,10 @@ func (p *PostgresSQLDB) GetUniqueValues(filters Filters) (MB3Values, error) {
subQuery, parameters := p.BuildBrowseOptionsWhere(filters)
query = query + subQuery
query = query + " GROUP BY contributor, instrument_type, ms_type, ion_mode;"

fmt.Println("GetUniqueValues -> query: ", query)
fmt.Println(" -> parameters: ", parameters)

stmt, err := p.database.Prepare(query)
if err != nil {
return MB3Values{}, err
Expand Down

0 comments on commit d3fb735

Please sign in to comment.