From 3e074974ab27bb6733702678c5d4774c3703e722 Mon Sep 17 00:00:00 2001 From: Devon Campbell Date: Thu, 7 Mar 2024 12:59:20 -0500 Subject: [PATCH] Add v5 `for` update --- docs/edgeql/for.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/edgeql/for.rst b/docs/edgeql/for.rst index 1babd8f1d80..dcbf542b978 100644 --- a/docs/edgeql/for.rst +++ b/docs/edgeql/for.rst @@ -22,9 +22,22 @@ are merged into a single output set. .. note:: - The ``union`` keyword is a required part of the ``for`` statement syntax; it - is intended to indicate explicitly that the results of each loop execution - are ultimately merged. + The ``union`` keyword is required prior to EdgeDB 5.0 and is intended to + indicate explicitly that the results of each loop execution are ultimately + merged. + +.. versionadded: 5.0 + + If the body of ``for`` is a statement — ``select``, ``insert``, ``update``, + ``delete``, ``group``, or ``with`` — ``union`` and the parentheses + surrounding the statement are no longer required: + + .. code-block:: edgeql-repl + + db> for number in {0, 1, 2, 3} + ... select { number, number + 0.5 } + {0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5} + Bulk inserts ------------