]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add coercions to literal()
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 15:42:08 +0000 (10:42 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 15:42:08 +0000 (10:42 -0500)
commit52728f7052e643e9890da75ef2c756d4bead41f0
tree8bfe8a805028563213209322056618f7d34aedbc
parenta7eeac60cae28bb553327d317a88adb22c799ef3
Add coercions to literal()

To prevent literal() from receiving a ClauseElement which
then leads to confusing results, add a new LiteralValueRole
coercion that does an _is_literal() check and implement
for literal().

Fixes: #5639
Change-Id: Ibd686544af2d7c013765278f984baf237de88caf
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/roles.py
test/sql/test_roles.py