Change tuple-element parameter names to name[idx]

This commit is contained in:
Drahflow
2022-02-16 16:50:09 +01:00
committed by Michal Jan Matczuk
parent 58908485da
commit 8054b9d47b
6 changed files with 30 additions and 30 deletions

View File

@@ -32,16 +32,16 @@ type tupleParam struct {
}
func (t tupleParam) writeCql(cql *bytes.Buffer) (names []string) {
baseName := string(t.param) + "_"
baseName := string(t.param)
cql.WriteByte('(')
for i := 0; i < t.count-1; i++ {
cql.WriteByte('?')
cql.WriteByte(',')
names = append(names, baseName+strconv.Itoa(i))
names = append(names, baseName+"["+strconv.Itoa(i)+"]")
}
cql.WriteByte('?')
cql.WriteByte(')')
names = append(names, baseName+strconv.Itoa(t.count-1))
names = append(names, baseName+"["+strconv.Itoa(t.count-1)+"]")
return
}