qb: update builder advanced assignments

This commit is contained in:
Michał Matczuk
2017-09-22 09:33:46 +02:00
parent fdb26806a9
commit 557674a886
5 changed files with 134 additions and 51 deletions

View File

@@ -53,15 +53,15 @@ func (c Cmp) writeCql(cql *bytes.Buffer) (names []string) {
cql.WriteString(" CONTAINS ")
}
if c.fn == nil {
if c.fn != nil {
names = append(names, c.fn.writeCql(cql)...)
} else {
cql.WriteByte('?')
if c.name == "" {
names = append(names, c.column)
} else {
names = append(names, c.name)
}
} else {
names = append(names, c.fn.writeCql(cql)...)
}
return
@@ -188,7 +188,7 @@ func GtOrEqNamed(column, name string) Cmp {
}
}
// GtFunc produces column>=someFunc(?...).
// GtOrEqFunc produces column>=someFunc(?...).
func GtOrEqFunc(column string, fn *Func) Cmp {
return Cmp{
op: geq,