qb: select

This commit is contained in:
Michał Matczuk
2017-07-27 12:28:01 +02:00
parent 69dad13e4b
commit 546e11d58f
4 changed files with 261 additions and 5 deletions

18
qb/utils.go Normal file
View File

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