func (q *Queryx) BindStructMap(arg0 interface{}, arg1 map[string]interface{}) *Queryx {
	arglist, err := bindStructArgs(q.Names, arg0, arg1, q.Mapper)
	if err != nil {
		q.err = fmt.Errorf("bind error: %s", err)
	} else {
		q.err = nil
		q.Bind(arglist...)
	}
	return q
}
BindStructMap binds query named parameters to values from arg0 and arg1
using a mapper. If value cannot be found in arg0 it's looked up in arg1
before reporting an error.
package gocqlx
import (
	"bytes"
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"github.com/gocql/gocql"
	"github.com/scylladb/go-reflectx"
)
func CompileNamedQueryString(qs string) (stmt string, names []string, err error) {
	return CompileNamedQuery([]byte(qs))
}
func CompileNamedQuery(qs []byte) (stmt string, names []string, err error) {
	n := bytes.Count(qs, []byte(":"))
	if n == 0 {
		return "", nil, errors.New("expected a named query")
	}
	names = make([]string, 0, n)
	rebound := make([]byte, 0, len(qs))
	inName := false
	last := len(qs) - 1
	name := make([]byte, 0, 10)
	for i, b := range qs {
		switch {
		case b == ':':
			if inName && i > 0 && qs[i-1] == ':' {
				rebound = append(rebound, ':')
				inName = false
				continue
			} else if inName {
				err = errors.New("unexpected `:` while reading named param at " + strconv.Itoa(i))
				return stmt, names, err
			}
			inName = true
			name = []byte{}
		case inName && (allowedBindRune(b) || b == '_' || b == '.') && i != last:
			name = append(name, b)
		case inName:
			inName = false
			if i == last && allowedBindRune(b) {
				name = append(name, b)
			}
			names = append(names, string(name))
			rebound = append(rebound, '?')
			if i != last {
				rebound = append(rebound, b)
			} else if !allowedBindRune(b) {
				rebound = append(rebound, b)
			}
		default:
			rebound = append(rebound, b)
		}
	}
	return string(rebound), names, err
}
func allowedBindRune(b byte) bool {
	return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9')
}
type Queryx struct {
	*gocql.Query
	Names  []string
	Mapper *reflectx.Mapper
	err    error
}
func Query(q *gocql.Query, names []string) *Queryx {
	return &Queryx{
		Query:  q,
		Names:  names,
		Mapper: DefaultMapper,
	}
}
func (q *Queryx) BindStruct(arg interface{}) *Queryx {
	arglist, err := bindStructArgs(q.Names, arg, nil, q.Mapper)
	if err != nil {
		q.err = fmt.Errorf("bind error: %s", err)
	} else {
		q.err = nil
		q.Bind(arglist...)
	}
	return q
}