pg
pg copied to clipboard
Add support Recursive With
As I see now there is no possibility to make recursive with.
func (q *Query) appendWith(b []byte) []byte {
b = append(b, "WITH "...)
for i, with := range q.with {
if i > 0 {
b = append(b, ", "...)
}
b = types.AppendField(b, with.name, 1)
b = append(b, " AS ("...)
b = with.query.AppendFormat(b, q)
b = append(b, ')')
}
b = append(b, ' ')
return b
}
I'm looking for this functionality today as well. Otherwise I am writing my recursive CTE in a string and using formatter.FormatQuery
for the params