diff options
author | Federico Caselli <cfederico87@gmail.com> | 2023-01-10 21:39:44 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2023-01-11 20:24:29 +0100 |
commit | dce11383f83c28f2acc0ed9ee346a56d63e9fcf8 (patch) | |
tree | 3a0196dd35fe8e87a8fadaa2611cc308d6d65914 /lib/sqlalchemy/sql/_elements_constructors.py | |
parent | a950402dae2a5b2448f5f4235946b2f767c7485c (diff) | |
download | sqlalchemy-dce11383f83c28f2acc0ed9ee346a56d63e9fcf8.tar.gz |
Improve sql formatting
change {opensql} to {printsql} in prints, add missing markers
Change-Id: I07b72e6620bb64e329d6b641afa27631e91c4f16
Diffstat (limited to 'lib/sqlalchemy/sql/_elements_constructors.py')
-rw-r--r-- | lib/sqlalchemy/sql/_elements_constructors.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqlalchemy/sql/_elements_constructors.py b/lib/sqlalchemy/sql/_elements_constructors.py index 1d8818a1f..6e5a7bc5e 100644 --- a/lib/sqlalchemy/sql/_elements_constructors.py +++ b/lib/sqlalchemy/sql/_elements_constructors.py @@ -1066,23 +1066,23 @@ def false() -> False_: >>> from sqlalchemy import false >>> print(select(t.c.x).where(false())) - SELECT x FROM t WHERE false + {printsql}SELECT x FROM t WHERE false A backend which does not support true/false constants will render as an expression against 1 or 0:: >>> print(select(t.c.x).where(false())) - SELECT x FROM t WHERE 0 = 1 + {printsql}SELECT x FROM t WHERE 0 = 1 The :func:`.true` and :func:`.false` constants also feature "short circuit" operation within an :func:`.and_` or :func:`.or_` conjunction:: >>> print(select(t.c.x).where(or_(t.c.x > 5, true()))) - SELECT x FROM t WHERE true + {printsql}SELECT x FROM t WHERE true >>> print(select(t.c.x).where(and_(t.c.x > 5, false()))) - SELECT x FROM t WHERE false + {printsql}SELECT x FROM t WHERE false .. versionchanged:: 0.9 :func:`.true` and :func:`.false` feature better integrated behavior within conjunctions and on dialects @@ -1483,23 +1483,23 @@ def true() -> True_: >>> from sqlalchemy import true >>> print(select(t.c.x).where(true())) - SELECT x FROM t WHERE true + {printsql}SELECT x FROM t WHERE true A backend which does not support true/false constants will render as an expression against 1 or 0:: >>> print(select(t.c.x).where(true())) - SELECT x FROM t WHERE 1 = 1 + {printsql}SELECT x FROM t WHERE 1 = 1 The :func:`.true` and :func:`.false` constants also feature "short circuit" operation within an :func:`.and_` or :func:`.or_` conjunction:: >>> print(select(t.c.x).where(or_(t.c.x > 5, true()))) - SELECT x FROM t WHERE true + {printsql}SELECT x FROM t WHERE true >>> print(select(t.c.x).where(and_(t.c.x > 5, false()))) - SELECT x FROM t WHERE false + {printsql}SELECT x FROM t WHERE false .. versionchanged:: 0.9 :func:`.true` and :func:`.false` feature better integrated behavior within conjunctions and on dialects |