パフォーマンス上の理由から、次の SQL を使用しています。
sql_tmpl = """delete from Data where id_data in (:iddata) """
params = {
'iddata':[1, 2,3 4],
}
# 'session' is a session object from SQLAlchemy
self.session.execute(text(sql_tmpl), params)
ただし、例外があります。
NotSupportedError: (NotSupportedError) ('Python type list not supported. param=1', 'HY097')
リストを「in」句のパラメータにバインドできる回避策はありますか?