feature: duckdb EXPLAIN json plan tree #127

Open
opened 2026-07-24 21:45:32 -05:00 by noe.trevino · 0 comments
Owner

The duckdb adapter (#102) ships text-only EXPLAIN / EXPLAIN ANALYZE. DuckDB also supports EXPLAIN (FORMAT JSON), which could feed the structured plan-tree view like postgres and mysql do.

Describe the solution you'd like

  • explain.json / json_analyze templates on the duckdb spec
  • a new lua/dadbod-ui/explain/parsers/duckdb.lua mapping DuckDB's JSON plan node shape onto the tree renderer, with real-output fixtures

Known wrinkles (verified against duckdb v1.5.4)

  • The CLI prints a box-art Physical Plan banner before the JSON, so the parser has to strip leading non-JSON output (or the json_args need a mode that suppresses it)
  • Node shape differs from postgres (extra_info blobs instead of typed fields)
  • EXPLAIN ANALYZE executes the statement, so the analyzing JSON form needs the postgres-style BEGIN; ...; ROLLBACK; wrapper if it's ever pointed at DML
### Is your feature request related to a problem? Please describe. The duckdb adapter (#102) ships text-only `EXPLAIN` / `EXPLAIN ANALYZE`. DuckDB also supports `EXPLAIN (FORMAT JSON)`, which could feed the structured plan-tree view like postgres and mysql do. ### Describe the solution you'd like - `explain.json` / `json_analyze` templates on the duckdb spec - a new `lua/dadbod-ui/explain/parsers/duckdb.lua` mapping DuckDB's JSON plan node shape onto the tree renderer, with real-output fixtures ### Known wrinkles (verified against duckdb v1.5.4) - The CLI prints a box-art `Physical Plan` banner *before* the JSON, so the parser has to strip leading non-JSON output (or the json_args need a mode that suppresses it) - Node shape differs from postgres (`extra_info` blobs instead of typed fields) - `EXPLAIN ANALYZE` executes the statement, so the analyzing JSON form needs the postgres-style `BEGIN; ...; ROLLBACK;` wrapper if it's ever pointed at DML
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/dadbod-ui.nvim#127
No description provided.