summaryrefslogtreecommitdiff
path: root/test/sql/test_update.py
diff options
context:
space:
mode:
authorinytar <pietpiet@fastmail.net>2017-10-30 12:01:49 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-12-05 14:26:28 -0500
commitd12b37f90ef538300f8ebb454eec75beccbe929f (patch)
tree4a172a7322d2e65172f25439a17ce4d773ff52da /test/sql/test_update.py
parent76b5981b41618048c4c593bbd9062c34ddc1fa36 (diff)
downloadsqlalchemy-d12b37f90ef538300f8ebb454eec75beccbe929f.tar.gz
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
Diffstat (limited to 'test/sql/test_update.py')
-rw-r--r--test/sql/test_update.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sql/test_update.py b/test/sql/test_update.py
index 71ac82ce0..9ebaddffd 100644
--- a/test/sql/test_update.py
+++ b/test/sql/test_update.py
@@ -391,7 +391,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
where(table1.c.name == sel.c.othername).\
values(name='foo')
- dialect = default.DefaultDialect()
+ dialect = default.StrCompileDialect()
dialect.positional = True
self.assert_compile(
upd,
@@ -419,7 +419,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest,
AssertsCompiledSQL):
- __dialect__ = 'default'
+ __dialect__ = 'default_enhanced'
run_create_tables = run_inserts = run_deletes = None