From f70e2b4e37740bfe14a525b76154595add021382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 11 Dec 2020 08:24:05 +0100 Subject: [PATCH] Mention that recursive CTEs require SQL --- Documentation/CommonTableExpressions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/CommonTableExpressions.md b/Documentation/CommonTableExpressions.md index fe95101ea..309e0c032 100644 --- a/Documentation/CommonTableExpressions.md +++ b/Documentation/CommonTableExpressions.md @@ -78,6 +78,8 @@ let counterCTE = CommonTableExpression( """) ``` +> :point_up: **Note**: many recursive CTEs use the `UNION ALL` SQL operator. The query interface does not provide any Swift support for it, so you'll generally have to write SQL in your definitions of recursive CTEs. + As you can see in all above examples, `CommonTableExpression` is a generic type: `CommonTableExpression`, `CommonTableExpression`. The generic argument (`Void`, `Int`) turns useful when you [join common table expressions](#associations-to-common-table-expressions), or when you [fetch values directly from a common table expression](#fetch-values-from-common-table-expressions). Otherwise, you can just use `Void`.