func Rebind(bindType int, query string) string {
	switch bindType {
	case QUESTION, UNKNOWN:
		return query
	}
	rqb := make([]byte, 0, len(query)+10)
	var i, j int
	for i = strings.Index(query, "?"); i != -1; i = strings.Index(query, "?") {
		rqb = append(rqb, query[:i]...)
		switch bindType {
		case DOLLAR:
			rqb = append(rqb, '$')
		case NAMED:
			rqb = append(rqb, ':', 'a', 'r', 'g')
		}
		j++
		rqb = strconv.AppendInt(rqb, int64(j), 10)
		query = query[i+1:]
	}
	return string(append(rqb, query...))
}
FIXME: this should be able to be tolerant of escaped ?'s in queries without
losing much speed, and should be to avoid confusion.
Rebind a query from the default bindtype (QUESTION) to the target bindtype.
package sqlx
import (
	"bytes"
	"errors"
	"reflect"
	"strconv"
	"strings"
	"github.com/jmoiron/sqlx/reflectx"
)
const (
	UNKNOWN = iota
	QUESTION
	DOLLAR
	NAMED
)
func BindType(driverName string) int {
	switch driverName {
	case "postgres", "pgx":
		return DOLLAR
	case "mysql":
		return QUESTION
	case "sqlite3":
		return QUESTION
	case "oci8", "ora", "goracle":
		return NAMED
	}
	return UNKNOWN
}