It's possible to pass a tuple
to MySQLdb for use in an IN
clause, but is it possible to pass a tuple
for use as a column list? This doesn't work:
cursor.execute("SELECT %s FROM users", tuple(columns))
OperationalError: (1241, 'Operand should contain 1 column(s)')
It seems like execute
does not do syntax-aware replacement of lists.