Format formats the node.
(buf *nodeBuffer)
| 321 | |
| 322 | // Format formats the node. |
| 323 | func (node *With) Format(buf *nodeBuffer) { |
| 324 | if node == nil || len(node.CTEs) == 0 { |
| 325 | return |
| 326 | } |
| 327 | if node.Recursive { |
| 328 | buf.Printf("WITH RECURSIVE ") |
| 329 | } else { |
| 330 | buf.Printf("WITH ") |
| 331 | } |
| 332 | for i, cte := range node.CTEs { |
| 333 | if i > 0 { |
| 334 | buf.Printf(", ") |
| 335 | } |
| 336 | buf.Printf("%v", cte) |
| 337 | } |
| 338 | buf.Printf(" ") |
| 339 | } |
| 340 | |
| 341 | // CommonTableExpr represents a single Common Table Expression in a WITH clause |
| 342 | type CommonTableExpr struct { |