Skip to content

Commit

Permalink
Fix error in assets/apps SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
agodnic committed Aug 29, 2024
1 parent 9f5b543 commit 120adcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions idb/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -1992,12 +1992,12 @@ func (db *IndexerDb) Assets(ctx context.Context, filter idb.AssetsQuery) (<-chan
whereArgs := make([]interface{}, 0, maxWhereParts)
partNumber := 1
if filter.AssetID != nil {
whereParts = append(whereParts, fmt.Sprintf("a.index = $%d", partNumber))
whereParts = append(whereParts, fmt.Sprintf("a.id = $%d", partNumber))
whereArgs = append(whereArgs, *filter.AssetID)
partNumber++
}
if filter.AssetIDGreaterThan != nil {
whereParts = append(whereParts, fmt.Sprintf("a.index > $%d", partNumber))
whereParts = append(whereParts, fmt.Sprintf("a.id > $%d", partNumber))
whereArgs = append(whereArgs, *filter.AssetIDGreaterThan)
partNumber++
}
Expand Down Expand Up @@ -2248,7 +2248,7 @@ func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQue
whereArgs := make([]interface{}, 0, maxWhereParts)
partNumber := 1
if filter.ApplicationID != nil {
whereParts = append(whereParts, fmt.Sprintf("index = $%d", partNumber))
whereParts = append(whereParts, fmt.Sprintf("id = $%d", partNumber))
whereArgs = append(whereArgs, *filter.ApplicationID)
partNumber++
}
Expand All @@ -2258,7 +2258,7 @@ func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQue
partNumber++
}
if filter.ApplicationIDGreaterThan != nil {
whereParts = append(whereParts, fmt.Sprintf("index > $%d", partNumber))
whereParts = append(whereParts, fmt.Sprintf("id > $%d", partNumber))
whereArgs = append(whereArgs, *filter.ApplicationIDGreaterThan)
partNumber++
}
Expand Down

0 comments on commit 120adcf

Please sign in to comment.