func New(cfg *Config, reader io.Reader, writer io.Writer, planExporter PlanExporter) *PgScanner {
	return &PgScanner{
		cfg:          cfg,
		reader:       reader,
		writer:       writer,
		planExporter: planExporter,
	}
}
New creates a new Postgres scanner.
package pgscanner
import (
	"bufio"
	"context"
	"fmt"
	"io"
	"log"
	"strings"
)
const QueryPlanSubstringDetector = "QUERY PLAN"
const minimalQueryPlanLines = 2
const confirmationResponse = "Y"
type PlanExporter interface {
	Export(string) (string, error)
	Target() string
}
type PgScanner struct {
	cfg          *Config
	reader       io.Reader
	writer       io.Writer
	planExporter PlanExporter
	state        ScannerState
}
type Config struct {
	AutoConfirm bool
}