]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow delete where clause to refer multiple tables.
authorinytar <pietpiet@fastmail.net>
Mon, 30 Oct 2017 16:01:49 +0000 (12:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 5 Dec 2017 19:26:28 +0000 (14:26 -0500)
commitd12b37f90ef538300f8ebb454eec75beccbe929f
tree4a172a7322d2e65172f25439a17ce4d773ff52da
parent76b5981b41618048c4c593bbd9062c34ddc1fa36
Allow delete where clause to refer multiple tables.

Implemented "DELETE..FROM" syntax for Postgresql, MySQL, MS SQL Server
(as well as within the unsupported Sybase dialect) in a manner similar
to how "UPDATE..FROM" works.  A DELETE statement that refers to more than
one table will switch into "multi-table" mode and render the appropriate
"USING" or multi-table "FROM" clause as understood by the database.
Pull request courtesy Pieter Mulder.

For SQL syntaxes see:

Postgresql: https://www.postgresql.org/docs/current/static/sql-delete.html
MySQL: https://dev.mysql.com/doc/refman/5.7/en/delete.html#multiple-table_syntax
MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql
Sybase: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315721.htm

Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I6dfd57b49e44a095d076dc493cd2360bb5d920d3
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/392
Fixes: #959
20 files changed:
doc/build/changelog/migration_08.rst
doc/build/changelog/migration_12.rst
doc/build/changelog/unreleased_12/959.rst [new file with mode: 0644]
doc/build/core/tutorial.rst
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/sybase/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/testing/requirements.py
test/dialect/mssql/test_compiler.py
test/dialect/mysql/test_compiler.py
test/dialect/postgresql/test_compiler.py
test/dialect/test_sybase.py
test/orm/test_update_delete.py
test/requirements.py
test/sql/test_compiler.py
test/sql/test_delete.py
test/sql/test_update.py