sqlalchemy 执行sql

关键需要使用text

from sqlalchemy import create_engine, text

sql = 'SELECT * FROM my_table WHERE account_id = :account_id and amount =: amount' session.execute( text(sql), {
"account_id": 100000, "amount": 500} )
原文地址:https://www.cnblogs.com/buxizhizhoum/p/11324020.html