pg icon indicating copy to clipboard operation
pg copied to clipboard

Add support Recursive With

Open tpoxa opened this issue 5 years ago • 1 comments

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
}

tpoxa avatar Oct 31 '19 19:10 tpoxa

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

krmckone avatar Dec 23 '20 16:12 krmckone