Is there an update equivalent of this insert statement?
inserts = [{"name": "jon", "age": 20"}, {"name": "ashley", "age": 22"}]
session.execute(
People.__table__.insert().values(
inserts
)
)
I have this right now but it's still slower than I'd like because it's using executemany, hoping to have it be one big query
updated_people = [{"b_id": 1, "b_name": "jon", "b_age": 21"}, {"b_id": 2, "b_name": "ashley", "b_age": 25"}]
stmt = People.__table__.update().\
where(People.id == bindparam('b_id')).\
values(name=bindparam('b_name'), age=bindparam('b_age'))
session.execute(stmt, updated_people)
Thanks!