CompileNamedQuery: fix doc string to include escaping ::

Fixes #56
This commit is contained in:
Michał Matczuk
2018-10-23 15:44:42 +02:00
parent 620bef0b6c
commit bbb21ea945

View File

@@ -15,8 +15,9 @@ import (
"github.com/scylladb/gocqlx/reflectx"
)
// CompileNamedQuery compiles a named query into an unbound query using the
// '?' bindvar and a list of names.
// CompileNamedQuery translates query with named parameters in a form
// ':<identifier>' to query with '?' placeholders and a list of parameter names.
// If you need to use ':' in a query, i.e. with maps or UDTs use '::' instead.
func CompileNamedQuery(qs []byte) (stmt string, names []string, err error) {
// guess number of names
n := bytes.Count(qs, []byte(":"))