Skip to content

Commit

Permalink
Fix double parenthesis in CTE
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenafamo committed Nov 15, 2023
1 parent 035233e commit 5639ed1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clause/cte.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ func (c CTE) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error) {
w.Write([]byte("NOT MATERIALIZED "))
}

args, err := bob.ExpressIf(w, d, start, c.Query, true, "(", ")")
w.Write([]byte("("))
args, err := c.Query.WriteQuery(w, start)
if err != nil {
return nil, err
}
w.Write([]byte(")"))

searchArgs, err := bob.ExpressIf(w, d, start+len(args), c.Search,
len(c.Search.Columns) > 0, "\n", "")
Expand Down

0 comments on commit 5639ed1

Please sign in to comment.