diff options
author | jazzthief <mynameisyegor@gmail.com> | 2023-02-02 13:48:13 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-02-06 12:59:34 -0500 |
commit | 781ac8f0aa1ef9289e424f451353f491b09bd01f (patch) | |
tree | 9476c69b661351a2c7708103d5ec2a1b964369e9 /lib/sqlalchemy/sql/compiler.py | |
parent | 0635235090c85e2c1a18676ca49652d2c2094925 (diff) | |
download | sqlalchemy-781ac8f0aa1ef9289e424f451353f491b09bd01f.tar.gz |
Dedicated bitwise operators
Added a full suite of new SQL bitwise operators, for performing
database-side bitwise expressions on appropriate data values such as
integers, bit-strings, and similar. Pull request courtesy Yegor Statkevich.
Fixes: #8780
Closes: #9204
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9204
Pull-request-sha: a4541772a6a784f9161ad78ef84d2ea7a62fa8de
Change-Id: I4c70e80f9548dcc1b4e3dccd71bd59d51d3ed46e
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d4ddc2e5d..bc463f9a1 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -279,6 +279,13 @@ OPERATORS = { operators.asc_op: " ASC", operators.nulls_first_op: " NULLS FIRST", operators.nulls_last_op: " NULLS LAST", + # bitwise + operators.bitwise_xor_op: " ^ ", + operators.bitwise_or_op: " | ", + operators.bitwise_and_op: " & ", + operators.bitwise_not_op: "~", + operators.bitwise_lshift_op: " << ", + operators.bitwise_rshift_op: " >> ", } FUNCTIONS: Dict[Type[Function[Any]], str] = { |