Add WITH RECURSIVE support.

This commit is contained in:
go-jet 2021-12-14 17:14:13 +01:00
parent 02123005c1
commit 47545ce571
5 changed files with 289 additions and 5 deletions

View file

@ -10,7 +10,12 @@ type CommonTableExpression struct {
// WITH function creates new WITH statement from list of common table expressions
func WITH(cte ...jet.CommonTableExpressionDefinition) func(statement jet.Statement) Statement {
return jet.WITH(Dialect, cte...)
return jet.WITH(Dialect, false, cte...)
}
// WITH_RECURSIVE function creates new WITH RECURSIVE statement from list of common table expressions
func WITH_RECURSIVE(cte ...jet.CommonTableExpressionDefinition) func(statement jet.Statement) Statement {
return jet.WITH(Dialect, true, cte...)
}
// CTE creates new named CommonTableExpression