MCPcopy Create free account
hub / github.com/outerbase/studio / isExplainQueryPlan

Function isExplainQueryPlan

src/components/gui/query-explanation.tsx:30–46  ·  view source on GitHub ↗
(sql: string, dialect: SupportedDialect)

Source from the content-addressed store, hash-verified

28});
29
30export function isExplainQueryPlan(sql: string, dialect: SupportedDialect) {
31 if (!["sqlite", "mysql"].includes(dialect)) return false;
32
33 if (sql.toLowerCase().startsWith("explain query plan")) {
34 return true;
35 }
36
37 if (sql.toLowerCase().startsWith("explain format=json")) {
38 return true;
39 }
40
41 if (sql.toLowerCase().startsWith("explain (format json)")) {
42 return true;
43 }
44
45 return false;
46}
47
48function buildQueryExplanationTree(nodes: ExplanationRow[]) {
49 const map: Record<number, ExplanationRowWithChildren> = {};

Callers 1

QueryWindowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected