Skip to content

Commit 39de90f

Browse files
authored
Fix SHOW DATABASES EXPLAIN AST output to match ClickHouse (#31)
1 parent 1d571bb commit 39de90f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/explain/statements.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ func explainExplainQuery(sb *strings.Builder, n *ast.ExplainQuery, indent string
318318
func explainShowQuery(sb *strings.Builder, n *ast.ShowQuery, indent string) {
319319
// ClickHouse maps certain SHOW types to ShowTables in EXPLAIN AST
320320
showType := strings.Title(strings.ToLower(string(n.ShowType)))
321-
// SHOW SETTINGS is displayed as ShowTables in ClickHouse
322-
if showType == "Settings" {
321+
// SHOW SETTINGS and SHOW DATABASES are displayed as ShowTables in ClickHouse
322+
if showType == "Settings" || showType == "Databases" {
323323
showType = "Tables"
324324
}
325325
fmt.Fprintf(sb, "%sShow%s\n", indent, showType)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}

0 commit comments

Comments
 (0)