@@ -15,8 +15,9 @@ import (
|
|||||||
"github.com/scylladb/gocqlx/reflectx"
|
"github.com/scylladb/gocqlx/reflectx"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CompileNamedQuery compiles a named query into an unbound query using the
|
// CompileNamedQuery translates query with named parameters in a form
|
||||||
// '?' bindvar and a list of names.
|
// ':<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) {
|
func CompileNamedQuery(qs []byte) (stmt string, names []string, err error) {
|
||||||
// guess number of names
|
// guess number of names
|
||||||
n := bytes.Count(qs, []byte(":"))
|
n := bytes.Count(qs, []byte(":"))
|
||||||
|
|||||||
Reference in New Issue
Block a user