add UseColums function to avoid extra allocation performed by Colums function

fix name

tidy

adding SetWhere

adding SetWhere

fix go mod

fix comment style

revert go mod

Avoid to append if no needed

fix git ignore

revert change in go.sum/go.mod

adding specific benchmark
This commit is contained in:
Gian Lorenzo Meocci
2019-10-27 16:37:36 +01:00
committed by Michal Jan Matczuk
parent a57d58f38f
commit 9239d9c4b4
5 changed files with 52 additions and 8 deletions

View File

@@ -212,14 +212,22 @@ func (b *UpdateBuilder) removeValue(column string, value value) *UpdateBuilder {
// Where adds an expression to the WHERE clause of the query. Expressions are
// ANDed together in the generated CQL.
func (b *UpdateBuilder) Where(w ...Cmp) *UpdateBuilder {
b.where = append(b.where, w...)
if len(b.where) == 0 {
b.where = w
} else {
b.where = append(b.where, w...)
}
return b
}
// If adds an expression to the IF clause of the query. Expressions are ANDed
// together in the generated CQL.
func (b *UpdateBuilder) If(w ...Cmp) *UpdateBuilder {
b._if = append(b._if, w...)
if len(b._if) == 0 {
b._if = w
} else {
b._if = append(b._if, w...)
}
return b
}