I'd like to represent the following query in SQLAlchemy:
select * from table where bit_count(column & bitmask) > 5
Basically I'm looking to select any row with a certain count of flags set. However, SQLAlchemy doesn't seem to have defined the BIT_COUNT() function. Anyone know any tricks to make this query in SQLAlchemy?