If this just needs this to be rendered for PostgreSQL, you can use the `func` generator:
https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.func from sqlalchemy.sql.expression import func query = session.query(Foo).filter(func.bit_or(Foo.cola, Foo.colb)... `func` is a special namespace and will render UNKNOWN functions as you invoke them. This simple solution to render the correct sql works for most people. If you have more specific needs, such as using this within python comparisons, you will need to read the docs on Custom types ( https://docs.sqlalchemy.org/en/13/core/custom_types.html); if you need this to work on multiple different databases you may have to write a custom compiler for each supported one ( https://docs.sqlalchemy.org/en/13/core/compiler.html <https://docs.sqlalchemy.org/en/13/core/compiler.html?highlight=type%20compilation> ) -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/9263259a-8c8c-4fff-b915-86f6106665c4o%40googlegroups.com.