diff options
author | Federico Caselli <cfederico87@gmail.com> | 2020-09-02 23:46:06 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-08 17:13:48 -0400 |
commit | e8600608669d90c4a6385b312d271aed63eb5854 (patch) | |
tree | ef984a01c536b2c81d2283b3ca5d9f4395f41dd0 /lib/sqlalchemy/sql/dml.py | |
parent | 0d56a62f721ee6c91d8a8b6a407b959c9215b3b6 (diff) | |
download | sqlalchemy-e8600608669d90c4a6385b312d271aed63eb5854.tar.gz |
Update select usage to use the new 1.4 format
This change includes mainly that the bracketed use within
select() is moved to positional, and keyword arguments are
removed from calls to the select() function. it does not
yet fully address other issues such as keyword arguments passed
to the table.select().
Additionally, allows False / None to both be considered
as "disable" for all of select.correlate(), select.correlate_except(),
query.correlate(), which establishes consistency with
passing of ``False`` for the legact select(correlate=False)
argument.
Change-Id: Ie6c6e6abfbd3d75d4c8de504c0cf0159e6999108
Diffstat (limited to 'lib/sqlalchemy/sql/dml.py')
-rw-r--r-- | lib/sqlalchemy/sql/dml.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index b7151ac7b..cd4bc17af 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -914,7 +914,7 @@ class Insert(ValuesBase): e.g.:: - sel = select([table1.c.a, table1.c.b]).where(table1.c.c > 5) + sel = select(table1.c.a, table1.c.b).where(table1.c.c > 5) ins = table2.insert().from_select(['a', 'b'], sel) :param names: a sequence of string column names or @@ -1116,7 +1116,7 @@ class Update(DMLWhereBase, ValuesBase): subquery:: users.update().values(name='ed').where( - users.c.name==select([addresses.c.email_address]).\ + users.c.name==select(addresses.c.email_address).\ where(addresses.c.user_id==users.c.id).\ scalar_subquery() ) @@ -1183,7 +1183,7 @@ class Update(DMLWhereBase, ValuesBase): the subquery to the outer table being updated:: users.update().values( - name=select([addresses.c.email_address]).\ + name=select(addresses.c.email_address).\ where(addresses.c.user_id==users.c.id).\ scalar_subquery() ) @@ -1334,7 +1334,7 @@ class Delete(DMLWhereBase, UpdateBase): subquery:: users.delete().where( - users.c.name==select([addresses.c.email_address]).\ + users.c.name==select(addresses.c.email_address).\ where(addresses.c.user_id==users.c.id).\ scalar_subquery() ) |