From 6359f3e7cc0a130d6658f7a9af1621f41a7d73f1 Mon Sep 17 00:00:00 2001 From: Devon Campbell Date: Thu, 11 Jan 2024 09:07:28 -0800 Subject: [PATCH] Note that if..else now supports DML (#6660) * Note that if..else now supports DML * Clarify the workaround is for earlier versions --- docs/edgeql/for.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/edgeql/for.rst b/docs/edgeql/for.rst index 4efca8cfce7..25a112a7def 100644 --- a/docs/edgeql/for.rst +++ b/docs/edgeql/for.rst @@ -74,6 +74,14 @@ A similar approach can be used for bulk updates. Conditional DML --------------- +.. versionadded:: 4.0 + + DML is now supported in ``if..else``. The method of achieving conditional + DML demonstrated below is a workaround for earlier versions of EdgeDB + before this support was introduced in EdgeDB 4.0. If you're on EdgeDB 4.0 + or higher, use :eql:op:`if..else` for a cleaner way to achieve conditional + DML. + DML (i.e., :ref:`insert `, :ref:`update `, :ref:`delete `) is not supported in :eql:op:`if..else`. If you need to do one of these conditionally, you can use a ``for`` loop as a