Skip to content

Instantly share code, notes, and snippets.

@restureese
Created February 26, 2020 03:41
Show Gist options
  • Select an option

  • Save restureese/531424ecda47c93bba0a4dfd34fc4c0b to your computer and use it in GitHub Desktop.

Select an option

Save restureese/531424ecda47c93bba0a4dfd34fc4c0b to your computer and use it in GitHub Desktop.
SQLAlchemy update multiple rows
db.session.query(Model).\
filter(Model.id == id).\
update({Model.deleted_at:datetime.now()}, synchronize_session = False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment