func (api *API) ScanOne(dst interface{}, rows Rows) error {
	err := api.processRows(dst, rows, false  )
	return errors.WithStack(err)
}
ScanOne iterates all rows to the end and makes sure that there was exactly one row
otherwise it returns an error. Use NotFound function to check if there were no rows.
After iterating ScanOne closes the rows,
and propagates any errors that could pop up.
It scans data from that single row into the destination.
package dbscan
import (
	"reflect"
	"regexp"
	"strings"
	"github.com/pkg/errors"
)
type Rows interface {
	Close() error
	Err() error
	Next() bool
	Columns() ([]string, error)
	Scan(dest ...interface{}) error
}
func ScanAll(dst interface{}, rows Rows) error {
	return errors.WithStack(DefaultAPI.ScanAll(dst, rows))
}
func ScanOne(dst interface{}, rows Rows) error {
	return errors.WithStack(DefaultAPI.ScanOne(dst, rows))
}
type NameMapperFunc func(string) string
var (
	matchFirstCapRe = regexp.MustCompile("(.)([A-Z][a-z]+)")
	matchAllCapRe   = regexp.MustCompile("([a-z0-9])([A-Z])")
)
func SnakeCaseMapper(str string) string {
	snake := matchFirstCapRe.ReplaceAllString(str, "${1}_${2}")
	snake = matchAllCapRe.ReplaceAllString(snake, "${1}_${2}")
	return strings.ToLower(snake)
}
type API struct {
	structTagKey    string
	columnSeparator string
	fieldMapperFn   NameMapperFunc
}
type APIOption func(api *API)
func NewAPI(opts ...APIOption) *API {
	api := &API{
		structTagKey:    "db",
		columnSeparator: ".",
		fieldMapperFn:   SnakeCaseMapper,
	}
	for _, o := range opts {
		o(api)
	}
	return api
}
func WithStructTagKey(tagKey string) APIOption {
	return func(api *API) {
		api.structTagKey = tagKey
	}
}
func WithColumnSeparator(separator string) APIOption {
	return func(api *API) {
		api.columnSeparator = separator
	}
}
func WithFieldNameMapper(mapperFn NameMapperFunc) APIOption {
	return func(api *API) {
		api.fieldMapperFn = mapperFn
	}
}
func (api *API) ScanAll(dst interface{}, rows Rows) error {
	err := api.processRows(dst, rows, true  )
	return errors.WithStack(err)
}