EntityStore: support filtering by labels (#59905)

* label filtering

* filtering in sql

* filtering in sql group by

* label is unique - no need for distinct

* capitalize

* fix capitalization
This commit is contained in:
Artur Wierzbicki
2022-12-06 23:21:12 +04:00
committed by GitHub
parent 3c249e1b99
commit 9e349bf9b0
5 changed files with 201 additions and 7 deletions
@@ -17,6 +17,11 @@ func (q *selectQuery) addWhere(f string, val interface{}) {
q.where = append(q.where, f+"=?")
}
func (q *selectQuery) addWhereInSubquery(f string, subquery string, subqueryArgs []interface{}) {
q.args = append(q.args, subqueryArgs...)
q.where = append(q.where, f+" IN ("+subquery+")")
}
func (q *selectQuery) addWhereIn(f string, vals []string) {
count := len(vals)
if count > 1 {