Posgtesql - delete with using

20 views
Skip to first unread message

Tomas Pavlovsky

unread,
Oct 26, 2021, 5:08:08 AM10/26/21
to sqlalchemy
Hi,
Is there a better way how to do it? Or i  just miss something in the docs?
var = a
delete_stmt = delete(A).where(A.b_id==B.id, B.name==var)
stmt = text(str(delete_stmt.compile(dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True})))
db.execute(stmt)

Thanks
Reply all
Reply to author
Forward
0 new messages