Depot.Explain
depot/lib/depot_explain.march Phase 3.7 — Repo.explain pass-through.
Depot.Explain wraps an already-compiled SQL string with the PostgreSQL EXPLAIN / EXPLAIN ANALYZE prefix (honouring a handful of options) and provides a minimal parser that turns the text output back into a structured value so callers can assert on it in tests.
Two entry points: explain_sql(sql, opts) — returns the SQL to send to the database parse_plan_line(line) — parses a single plan line into a PlanNode
The parser is deliberately tiny: it recognises the "NodeType on relation" prefix that PostgreSQL emits for scan nodes. Anything else falls back to an opaque plan node with the whole line as the node type. Callers that need full-fidelity plans should use the JSON format and a dedicated decoder on top of this primitive.