qb: update, delete and performance improvements

This commit is contained in:
Michał Matczuk
2017-07-27 09:48:33 +02:00
parent 5db5de8822
commit 69dad13e4b
10 changed files with 486 additions and 15 deletions

View File

@@ -1,14 +1,18 @@
package qb
import (
"strings"
"bytes"
)
// placeholders returns a string with count ? placeholders joined with commas.
func placeholders(count int) string {
func placeholders(cql *bytes.Buffer, count int) {
if count < 1 {
return ""
return
}
return strings.Repeat(",?", count)[1:]
for i := 0; i < count-1; i++ {
cql.WriteByte('?')
cql.WriteByte(',')
}
cql.WriteByte('?')
}