]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add option to sort into inserts/updates to bulk_save_objects
authorAlessandro Cucci <alessandro.cucci@gmail.com>
Sat, 25 Aug 2018 13:14:22 +0000 (09:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Aug 2018 20:10:55 +0000 (16:10 -0400)
commitcbd661e0cdfdba98663ae542c6af2863fc30ae09
tree4e899485ca82168baf8ac20a604c358e2aab0db4
parentc6427fe14090d2d06a4d7c4c398be1f6e6a771f1
Add option to sort into inserts/updates to bulk_save_objects

Added new flag :paramref:`.Session.bulk_save_objects.preserve_order` to the
:meth:`.Session.bulk_save_objects` method, which defaults to True. When set
to False, the given mappings will be grouped into inserts and updates per
each object type, to allow for greater opportunities to batch common
operations together.  Pull request courtesy Alessandro Cucci.

Change-Id: I0d041f7696cf733655a74beeceee3fa80640efd7
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/6
doc/build/changelog/unreleased_13/preserve_order.rst [new file with mode: 0644]
lib/sqlalchemy/orm/session.py
test/orm/test_bulk.py