Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
11 - add single quote to marketIDs in sql query
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsaraf committed Jan 24, 2020
1 parent e4925d1 commit 8e77b78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/volumeFilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ type dailyValues struct {
}

func (f *volumeFilter) dailyValuesByDate(dateUTC string) (*dailyValues, error) {
marketIdsSqlValue := strings.Join(f.marketIDs, ",")
marketIDsQuoted := []string{}
for _, mid := range f.marketIDs {
marketIDsQuoted = append(marketIDsQuoted, fmt.Sprintf("'%s'", mid))
}
marketIdsSqlValue := strings.Join(marketIDsQuoted, ",")
row := f.db.QueryRow(database.SqlQueryDailyValues, marketIdsSqlValue, dateUTC, f.action)

var baseVol sql.NullFloat64
Expand Down

0 comments on commit 8e77b78

Please sign in to comment.