func (r *rows) ScanVal(v ...interface{}) error {
	defer r.Close()
	for r.Next() {
		if err := r.rows.Scan(v...); err != nil {
			return err
		}
	}
	return r.rows.Err()
}
ScanVal will scan the current row and column into i.
package pgxscan
import (
	"errors"
	"reflect"
	"strings"
	"github.com/jackc/pgx/v4"
	"github.com/randallmlough/sqlmaper"
)
type rows struct {
	rows    pgx.Rows
	columns []string
	cfg     *Config
}
func (r *rows) Next() bool {
	return r.rows.Next()
}
func (r *rows) Err() error {
	return r.rows.Err()
}
var ErrColumnNotateSyntax = errors.New("column notate syntax is invalid: expecting \"notate:name\"")
var QueryColumnNotatePrefix = "notate:"
func GetColumnNames(rows *pgx.Rows) ([]string, error) {
	cols := make([]string, 0, len((*rows).FieldDescriptions()))
	notatePrefix := ""
	for _, field := range (*rows).FieldDescriptions() {
		colName := string(field.Name)
		if strings.HasPrefix(colName, QueryColumnNotatePrefix) {
			splitted := strings.Split(colName, QueryColumnNotatePrefix)
			if len(splitted) != 2 {
				return nil, ErrColumnNotateSyntax
			}
			trimmed := strings.TrimSpace(splitted[1])
			if len(trimmed) == 0 {
				notatePrefix = ""
			} else {
				notatePrefix = strings.TrimRight(trimmed, ".") + "."
			}
		} else {
			colName = notatePrefix + colName
		}
		cols = append(cols, colName)
	}
	return cols, nil
}
func (r *rows) Scan(i ...interface{}) (err error) {
	if i == nil {
		return nil
	} else if isVariadic(i...) {
		return r.ScanVal(i...)
	} else if ii, ok := i[0].([]interface{}); ok {
		return r.ScanVal(ii...)
	}
	val, valErr := validate(i[0])
	if valErr != nil {
		err = valErr
		return
	}
	var rowCount int64
	defer func() {
		r.Close()
		if r.cfg.ReturnErrNoRowsForRows && err == nil && rowCount == 0 {
			err = pgx.ErrNoRows
		}
	}()
	switch val.Kind() {
	case reflect.Slice:
		sliceOf := sqlmaper.GetSliceElementType(val)
		for r.Next() {
			sliceVal := reflect.New(sliceOf)
			cols, colErr := GetColumnNames(&r.rows)
			if colErr != nil {
				err = colErr
				return
			}
			if ssErr := ScanStruct(r.rows.Scan, sliceVal.Interface(), cols, r.cfg.MatchAllColumnsToStruct); ssErr != nil {
				err = ssErr
				return
			}
			sqlmaper.AppendSliceElement(val, sliceVal)
			rowCount++
		}
	case reflect.Struct:
		for r.Next() {
			if val.CanAddr() {
				cols, colErr := GetColumnNames(&r.rows)
				if colErr != nil {
					err = colErr
					return
				}
				if ssErr := ScanStruct(r.rows.Scan, val.Addr().Interface(), cols, r.cfg.MatchAllColumnsToStruct); ssErr != nil {
					err = ssErr
					return
				}
			}
			rowCount++
		}
	}
	return r.Err()
}