// ValByIdx returns a value and its associated type from the Row
// corresponding to the supplied column index. If the column index is not
// recognised then an error is returned.
ValByIdx returns a value and its associated type from the Row
corresponding to the supplied column index. If the column index is not
recognised then an error is returned.
// ValByIdx returns a value and its associated type from the Row // corresponding to the supplied column index . If the column index is not // recognised then an error is returned .
func (r *Row) ValByIdx(idx int) (interface{}, ColType, error) {
	if idx < 0 || idx >= len(r.mci.info) {
		return nil,
			ColTypeUnknown,
			dfErrorf("There is no column %d (valid range: 0-%d)",
				idx, len(r.mci.info)-1)
	}
	cType := r.mci.info[idx].colType
	switch cType {
	case ColTypeBool:
		return r.rd.boolVals[r.mci.valIdx[idx]], cType, nil
	case ColTypeInt:
		return r.rd.intVals[r.mci.valIdx[idx]], cType, nil
	case ColTypeFloat:
		return r.rd.floatVals[r.mci.valIdx[idx]], cType, nil
	case ColTypeString:
		return r.rd.stringVals[r.mci.valIdx[idx]], cType, nil
	}
	return nil, cType, dfErrorf("Unexpected column type: %q", cType)
}
func ( r * Row ) ValByIdx ( idx int ) ( interface { } , ColType , error ) { if idx < 0 || idx >= len ( r . mci . info ) { return nil , ColTypeUnknown , dfErrorf ( " " , idx , len ( r . mci . info ) - 1 ) } cType := r . mci . info [ idx ] . colType switch cType { case ColTypeBool : return r . rd . boolVals [ r . mci . valIdx [ idx ] ] , cType , nil case ColTypeInt : return r . rd . intVals [ r . mci . valIdx [ idx ] ] , cType , nil case ColTypeFloat : return r . rd . floatVals [ r . mci . valIdx [ idx ] ] , cType , nil case ColTypeString : return r . rd . stringVals [ r . mci . valIdx [ idx ] ] , cType , nil } return nil , cType , dfErrorf ( " " , cType ) }
ValByIdx returns a value and its associated type from the Row
corresponding to the supplied column index.
ValByIdx returns a value and its associated type from the Row corresponding to the supplied column index .