func NodeToRows(ctx *Context, n Node) ([]Row, error) {
	i, err := n.RowIter(ctx, nil)
	if err != nil {
		return nil, err
	}
	return RowIterToRows(ctx, i)
}
NodeToRows converts a node to a slice of rows.
package sql
import (
	"fmt"
	"io"
	"strings"
)
type Row []interface{}
func NewRow(values ...interface{}) Row {
	row := make([]interface{}, len(values))
	copy(row, values)
	return row
}
func (r Row) Copy() Row {
	return NewRow(r...)
}
func (r Row) Append(r2 Row) Row {
	row := make(Row, len(r)+len(r2))
	for i := range r {
		row[i] = r[i]
	}
	for i := range r2 {
		row[i+len(r)] = r2[i]
	}
	return row
}
func (r Row) Equals(row Row, schema Schema) (bool, error) {
	if len(row) != len(r) || len(row) != len(schema) {
		return false, nil
	}
	for i, colLeft := range r {
		colRight := row[i]
		cmp, err := schema[i].Type.Compare(colLeft, colRight)
		if err != nil {
			return false, err
		}
		if cmp != 0 {
			return false, nil
		}
	}
	return true, nil
}
func FormatRow(row Row) string {
	var sb strings.Builder
	sb.WriteRune('[')
	for i, v := range row {
		if i > 0 {
			sb.WriteRune(',')
		}
		sb.WriteString(fmt.Sprintf("%v", v))
	}
	sb.WriteRune(']')
	return sb.String()
}
type RowIter interface {
	Next() (Row, error)
	Closer
}
func RowIterToRows(ctx *Context, i RowIter) ([]Row, error) {
	var rows []Row
	for {
		row, err := i.Next()
		if err == io.EOF {
			break
		}
		if err != nil {
			_ = i.Close(ctx)
			return nil, err
		}
		rows = append(rows, row)
	}
	return rows, i.Close(ctx)
}