From 781ac8f0aa1ef9289e424f451353f491b09bd01f Mon Sep 17 00:00:00 2001 From: jazzthief Date: Thu, 2 Feb 2023 13:48:13 -0500 Subject: 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 --- test/dialect/postgresql/test_compiler.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/dialect/postgresql/test_compiler.py') diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 57b147c90..080cfb767 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -2424,6 +2424,14 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "WHERE usages.date <@ %(date_1)s::DATERANGE", ) + def test_bitwise_xor(self): + c1 = column("c1", Integer) + c2 = column("c2", Integer) + self.assert_compile( + select(c1.bitwise_xor(c2)), + "SELECT c1 # c2 AS anon_1", + ) + class InsertOnConflictTest(fixtures.TablesTest, AssertsCompiledSQL): __dialect__ = postgresql.dialect() -- cgit v1.2.1