Re: [sqlalchemy] rendering "NOT EXISTS ()" in PostgreSQL ?

2019-03-21 Thread Mike Bayer
On Wed, Mar 20, 2019 at 9:48 PM Jonathan Vanasco wrote: > > thanks, mike. I may just make a 'not exists' op. > > there are a handful of places in the docs that show `NOT EXISTS` with no > parenthesis. Do you think this is because of a change in the codebase or a > difference in the backends? >

Re: [sqlalchemy] rendering "NOT EXISTS ()" in PostgreSQL ?

2019-03-20 Thread Jonathan Vanasco
thanks, mike. I may just make a 'not exists' op. there are a handful of places in the docs that show `NOT EXISTS` with no parenthesis. Do you think this is because of a change in the codebase or a difference in the backends? If it's because of legacy code, I can generate a PR to update the

Re: [sqlalchemy] rendering "NOT EXISTS ()" in PostgreSQL ?

2019-03-20 Thread Mike Bayer
The precedence for EXISTS is lower than that of neg in sql/operators.py so it will always render the parenthesis unless those precedences are changed. otherwise you can use op() or whatever, ~op("EXISTS")("foo") from sqlalchemy import select, column, Boolean from sqlalchemy.sql.expression import

[sqlalchemy] rendering "NOT EXISTS ()" in PostgreSQL ?

2019-03-20 Thread Jonathan Vanasco
Is it possible to easily render "NOT EXISTS( " with a current API command? Both `~exists(` and `not_(exists(` will render "NOT ( EXISTS( ". I need to remove the superfluous parenthesis (this has to do with unit tests and ensuring parity of SQL across a handful of apps and custom commands). I