I am trying to use the sqlalchemy 'Delete' expression following this article:
How to delete rows from a table using an SQLAlchemy query without ORM?
My problem is that the actual where clause (the column names on which to filter) needs to be passed dynamically. But in the example, I see that the column names are not dynamic, only the filter values. Am I missing something?
Basically, the below query filters on the column 'retired'. I want to pass 'retired' dynamically.:
table_name = Table('address',metadata,autoload=True)
d = table_name.delete().where(table_name.c.retired == 1)
d.execute()
table_name.columns["retired"]instead oftable_name.c.retired?