Path filter for scenes and galleries (#834)

This commit is contained in:
WithoutPants
2020-10-12 08:19:51 +11:00
committed by GitHub
parent 08276ac616
commit ade109d9e4
11 changed files with 201 additions and 50 deletions

View File

@@ -48,6 +48,37 @@ func (qb *queryBuilder) addArg(args ...interface{}) {
qb.args = append(qb.args, args...)
}
func (qb *queryBuilder) handleIntCriterionInput(c *IntCriterionInput, column string) {
if c != nil {
clause, count := getIntCriterionWhereClause(column, *c)
qb.addWhere(clause)
if count == 1 {
qb.addArg(c.Value)
}
}
}
func (qb *queryBuilder) handleStringCriterionInput(c *StringCriterionInput, column string) {
if c != nil {
if modifier := c.Modifier.String(); c.Modifier.IsValid() {
switch modifier {
case "EQUALS":
clause, thisArgs := getSearchBinding([]string{column}, c.Value, false)
qb.addWhere(clause)
qb.addArg(thisArgs...)
case "NOT_EQUALS":
clause, thisArgs := getSearchBinding([]string{column}, c.Value, true)
qb.addWhere(clause)
qb.addArg(thisArgs...)
case "IS_NULL":
qb.addWhere(column + " IS NULL")
case "NOT_NULL":
qb.addWhere(column + " IS NOT NULL")
}
}
}
}
var randomSortFloat = rand.Float64()
func selectAll(tableName string) string {