from sqlalchemy import text
conn=engine.connect();
s=text("insert into aws_rcsy(topic)values(:topic)");
q_insert=conn.execute(s,topic=topic);
conn.close();
How to get the id of the data just inserted?
ps:q_insert returns <sqlalchemy.engine.base.ResultProxy object at 0x...>
Can row data be obtained from q_insert?
仅有的幸福2017-06-12 09:27:12
The code copied has not been verified
rslt_id = conn.execute("INSERT INTO user (name, country_id) VALUES ('Homer', 123)
RETURNING id")
Reference stack-overflow