From bbb21ea945484aa6174ea7173fc7fa6a1021a24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Tue, 23 Oct 2018 15:44:42 +0200 Subject: [PATCH] CompileNamedQuery: fix doc string to include escaping :: Fixes #56 --- queryx.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/queryx.go b/queryx.go index 967cf60..b08b7d7 100644 --- a/queryx.go +++ b/queryx.go @@ -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 +// ':' 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(":"))