Skip to content

Commit

Permalink
fix: add expressions matching the PostgreSQL query
Browse files Browse the repository at this point in the history
This adds the two query expressions to match the claircore PostgreSQL
implementation.

See: quay/claircore@3853221
See: quay/claircore@8dd6a35
Signed-off-by: Zoran Regvart <[email protected]>
  • Loading branch information
zregvart authored and crozzy committed Sep 16, 2024
1 parent 26a067c commit 6f7ba67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datastore/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/doug-martin/goqu/v8"
"github.com/doug-martin/goqu/v8/exp"
_ "github.com/doug-martin/goqu/v9/dialect/sqlite3"
"github.com/quay/claircore"
"github.com/quay/claircore/datastore"
Expand Down Expand Up @@ -66,6 +67,10 @@ func buildGetQuery(record *claircore.IndexRecord, opts *datastore.GetOpts) (stri
ex = goqu.Ex{"dist_arch": record.Distribution.Arch}
case driver.RepositoryName:
ex = goqu.Ex{"repo_name": record.Repository.Name}
case driver.RepositoryKey:
ex = goqu.Ex{"repo_key": record.Repository.Key}
case driver.HasFixedInVersion:
ex = goqu.Ex{"fixed_in_version": goqu.Op{exp.NeqOp.String(): ""}}
default:
return "", fmt.Errorf("was provided unknown matcher: %v", m)
}
Expand Down

0 comments on commit 6f7ba67

Please sign in to comment.