Query returns query representation of a `WITH` clause.
()
| 2745 | |
| 2746 | // Query returns query representation of a `WITH` clause. |
| 2747 | func (w *WithBuilder) Query() (string, []any) { |
| 2748 | w.WriteString("WITH ") |
| 2749 | if w.recursive { |
| 2750 | w.WriteString("RECURSIVE ") |
| 2751 | } |
| 2752 | for i, cte := range w.ctes { |
| 2753 | if i > 0 { |
| 2754 | w.Comma() |
| 2755 | } |
| 2756 | w.Ident(cte.name) |
| 2757 | if len(cte.columns) > 0 { |
| 2758 | w.WriteByte('(') |
| 2759 | w.IdentComma(cte.columns...) |
| 2760 | w.WriteByte(')') |
| 2761 | } |
| 2762 | w.WriteString(" AS ") |
| 2763 | w.Wrap(func(b *Builder) { |
| 2764 | b.Join(cte.s) |
| 2765 | }) |
| 2766 | } |
| 2767 | return w.String(), w.args |
| 2768 | } |
| 2769 | |
| 2770 | // implement the table view interface. |
| 2771 | func (*WithBuilder) view() {} |
nothing calls this directly
no test coverage detected