You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For built-in drivers, explain_query returns ExplainQueryOutput::Raw { raw: RawExplainOutput } — a payload plus a format tag — and the parsing lives in the @tabularis/explain TypeScript package (parseRawExplain).
For plugin drivers, the host wraps the JSON-RPC result as ExplainQueryOutput::Plan { plan } and passes it to the frontend untouched (src-tauri/src/plugins/driver.rs). A plugin must therefore ship its own parser and emit the visual-plan model directly: the SQL Server plugin currently parses SHOWPLAN_XML in Rust (src/driver/showplan.rs) and returns the parsed tree.
Goal
Make plugin explain output flow through @tabularis/explain the same way built-in drivers do:
Add the SQL Server SHOWPLAN XML parser to @tabularis/explain (a complete implementation already exists in PR feat(sqlserver): add built-in SQL Server driver tabularis#560: packages/explain/src/parsers/sqlserver.ts + tests, format tag sqlserver-showplan-xml).
Extend the plugin protocol so a plugin's explain_query can return a RawExplainOutput-shaped result ({ engine, format, payload, original_query }) that the host forwards as ExplainQueryOutput::Raw, letting parseRawExplain handle it in the frontend. Plugins that already return a parsed plan keep working (Plan pass-through stays the fallback).
Switch the SQL Server plugin to return the raw XML and drop its in-process parser.
Why
One parser, one place: plan-rendering fixes and new metrics land in @tabularis/explain without re-releasing plugins.
explain.tabularis.dev consumes @tabularis/explain, so it gains direct SQL Server compatibility — paste a SHOWPLAN_XML document and get the visual plan, with no plugin involved.
Keeps plugins thin: they hand over what the engine produced, tagged with its format, exactly like built-in drivers.
Registry/versioning: the manifest could declare an explain_format (or the result itself is self-describing via the format tag) so older hosts keep treating plugin results as pre-parsed plans.
Context
For built-in drivers,
explain_queryreturnsExplainQueryOutput::Raw { raw: RawExplainOutput }— a payload plus a format tag — and the parsing lives in the@tabularis/explainTypeScript package (parseRawExplain).For plugin drivers, the host wraps the JSON-RPC result as
ExplainQueryOutput::Plan { plan }and passes it to the frontend untouched (src-tauri/src/plugins/driver.rs). A plugin must therefore ship its own parser and emit the visual-plan model directly: the SQL Server plugin currently parsesSHOWPLAN_XMLin Rust (src/driver/showplan.rs) and returns the parsed tree.Goal
Make plugin explain output flow through
@tabularis/explainthe same way built-in drivers do:@tabularis/explain(a complete implementation already exists in PR feat(sqlserver): add built-in SQL Server driver tabularis#560:packages/explain/src/parsers/sqlserver.ts+ tests, format tagsqlserver-showplan-xml).explain_querycan return aRawExplainOutput-shaped result ({ engine, format, payload, original_query }) that the host forwards asExplainQueryOutput::Raw, lettingparseRawExplainhandle it in the frontend. Plugins that already return a parsed plan keep working (Planpass-through stays the fallback).Why
@tabularis/explainwithout re-releasing plugins.@tabularis/explain, so it gains direct SQL Server compatibility — paste aSHOWPLAN_XMLdocument and get the visual plan, with no plugin involved.Notes
ActualRows/ActualExecutionsand takes the maxActualElapsedmsfromRunTimeInformation, soSTATISTICS XML(Analyze) is covered too.explain_format(or the result itself is self-describing via theformattag) so older hosts keep treating plugin results as pre-parsed plans.