From 1f7969ae50d4be92f330d2cf6a2df9aba8b307bf Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 11 Nov 2020 11:13:27 -0500 Subject: Warn / raise for returning() / return_defaults() combinations A warning is emmitted if a returning() method such as :meth:`_sql.Insert.returning` is called multiple times, as this does not yet support additive operation. Version 1.4 will support additive operation for this. Additionally, any combination of the :meth:`_sql.Insert.returning` and :meth:`_sql.Insert.return_defaults` methods now raises an error as these methods are mutually exclusive; previously the operation would fail silently. Fixes: #5691 Change-Id: Id95e0f9da48bba0b59439cb26564f0daa684c8e3 --- doc/build/changelog/unreleased_13/5691.rst | 12 ++++++++++++ doc/build/tutorial/data.rst | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 doc/build/changelog/unreleased_13/5691.rst (limited to 'doc/build') diff --git a/doc/build/changelog/unreleased_13/5691.rst b/doc/build/changelog/unreleased_13/5691.rst new file mode 100644 index 000000000..6180e771d --- /dev/null +++ b/doc/build/changelog/unreleased_13/5691.rst @@ -0,0 +1,12 @@ +.. change:: + :tags: bug, sql + :tickets: 5691 + + A warning is emmitted if a returning() method such as + :meth:`_sql.Insert.returning` is called multiple times, as this does not + yet support additive operation. Version 1.4 will support additive + operation for this. Additionally, any combination of the + :meth:`_sql.Insert.returning` and :meth:`_sql.Insert.return_defaults` + methods now raises an error as these methods are mutually exclusive; + previously the operation would fail silently. + diff --git a/doc/build/tutorial/data.rst b/doc/build/tutorial/data.rst index 27a21b097..849b706cc 100644 --- a/doc/build/tutorial/data.rst +++ b/doc/build/tutorial/data.rst @@ -1502,7 +1502,7 @@ be iterated:: ... delete(user_table).where(user_table.c.name == 'patrick'). ... returning(user_table.c.id, user_table.c.name) ... ) - >>> print(delete_stmt.returning(user_table.c.id, user_table.c.name)) + >>> print(delete_stmt) {opensql}DELETE FROM user_account WHERE user_account.name = :name_1 RETURNING user_account.id, user_account.name -- cgit v1.2.1