func columns(r *PgRows) []string { nfields := int(C.PQnfields(r.result)) rv := make([]string, nfields) for i := 0; i < nfields; i++ { rv[i] = C.GoString(C.PQfname(r.result, C.int(i))) } return rv }
func (r *driverRows) Columns() []string { if r.cols == nil { r.cols = make([]string, r.ncols) for i := 0; i < r.ncols; i++ { r.cols[i] = C.GoString(C.PQfname(r.res, C.int(i))) } } return r.cols }
// Names returns the list of column (field) names, in order, in the result. func (r *Result) Names() []string { if r.cols == nil { r.cols = make([]string, r.ncols) for i := 0; i < r.ncols; i++ { r.cols[i] = C.GoString(C.PQfname(r.res, C.int(i))) } } return r.cols }