Skip to content

Commit

Permalink
Fix (*FromQuery).SQL() placement (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
apstndb authored Jan 1, 2025
1 parent d3b5ff0 commit 9ed6971
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,6 @@ type FromQuery struct {
From *From
}

func (f *FromQuery) SQL() string {
return f.From.SQL()
}

// CompoundQuery is query expression node compounded by set operators.
// Note: A single CompoundQuery can express query expressions compounded by the same set operator.
// If there are mixed Op or Distinct in query expression, CompoundQuery will be nested.
Expand Down
4 changes: 4 additions & 0 deletions ast/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ func (a *AsValue) SQL() string { return "AS VALUE" }

func (a *AsTypeName) SQL() string { return "AS " + a.TypeName.SQL() }

func (f *FromQuery) SQL() string {
return f.From.SQL()
}

func (c *CompoundQuery) SQL() string {
return sqlJoin(c.Queries, " "+string(c.Op)+" "+strOpt(c.AllOrDistinct != "", string(c.AllOrDistinct)+" "))
}
Expand Down

0 comments on commit 9ed6971

Please sign in to comment.