# sqlalchemy 2.1.9 (MIT), harvested by tools/harvest_corpus.py
=== input
Perform a bulk save of the given list of objects.

        .. legacy::

            This method is a legacy feature as of the 2.0 series of
            SQLAlchemy.   For modern bulk INSERT and UPDATE, see
            the sections :ref:`orm_queryguide_bulk_insert` and
            :ref:`orm_queryguide_bulk_update`.

            For general INSERT and UPDATE of existing ORM mapped objects,
            prefer standard :term:`unit of work` data management patterns,
            introduced in the :ref:`unified_tutorial` at
            :ref:`tutorial_orm_data_manipulation`.  SQLAlchemy 2.0
            now uses :ref:`engine_insertmanyvalues` with modern dialects
            which solves previous issues of bulk INSERT slowness.

        :param objects: a sequence of mapped object instances.  The mapped
         objects are persisted as is, and are **not** associated with the
         :class:`.Session` afterwards.

         For each object, whether the object is sent as an INSERT or an
         UPDATE is dependent on the same rules used by the :class:`.Session`
         in traditional operation; if the object has the
         :attr:`.InstanceState.key`
         attribute set, then the object is assumed to be "detached" and
         will result in an UPDATE.  Otherwise, an INSERT is used.

         In the case of an UPDATE, statements are grouped based on which
         attributes have changed, and are thus to be the subject of each
         SET clause.  If ``update_changed_only`` is False, then all
         attributes present within each object are applied to the UPDATE
         statement, which may help in allowing the statements to be grouped
         together into a larger executemany(), and will also reduce the
         overhead of checking history on attributes.

        :param return_defaults: when True, rows that are missing values which
         generate defaults, namely integer primary key defaults and sequences,
         will be inserted **one at a time**, so that the primary key value
         is available.  In particular this will allow joined-inheritance
         and other multi-table mappings to insert correctly without the need
         to provide primary key values ahead of time; however,
         :paramref:`.Session.bulk_save_objects.return_defaults` **greatly
         reduces the performance gains** of the method overall.  It is strongly
         advised to please use the standard :meth:`_orm.Session.add_all`
         approach.

        :param update_changed_only: when True, UPDATE statements are rendered
         based on those attributes in each state that have logged changes.
         When False, all attributes present are rendered into the SET clause
         with the exception of primary key attributes.

        :param preserve_order: when True, the order of inserts and updates
         matches exactly the order in which the objects are given.   When
         False, common types of objects are grouped into inserts
         and updates, to allow for more batching opportunities.

        .. seealso::

            :doc:`queryguide/dml`

            :meth:`.Session.bulk_insert_mappings`

            :meth:`.Session.bulk_update_mappings`

        
=== parse rest
short_description: 'Perform a bulk save of the given list of objects.'
long_description: |
  .. legacy::
  
      This method is a legacy feature as of the 2.0 series of
      SQLAlchemy.   For modern bulk INSERT and UPDATE, see
      the sections :ref:`orm_queryguide_bulk_insert` and
      :ref:`orm_queryguide_bulk_update`.
  
      For general INSERT and UPDATE of existing ORM mapped objects,
      prefer standard :term:`unit of work` data management patterns,
      introduced in the :ref:`unified_tutorial` at
      :ref:`tutorial_orm_data_manipulation`.  SQLAlchemy 2.0
      now uses :ref:`engine_insertmanyvalues` with modern dialects
      which solves previous issues of bulk INSERT slowness.
  
  .. seealso::
  
      :doc:`queryguide/dml`
  
      :meth:`.Session.bulk_insert_mappings`
  
      :meth:`.Session.bulk_update_mappings`
blank_after_short_description: True
blank_after_long_description: True
style: rest
- DocstringParam
  description: |
    a sequence of mapped object instances.  The mapped
    objects are persisted as is, and are **not** associated with the
    :class:`.Session` afterwards.
    
    For each object, whether the object is sent as an INSERT or an
    UPDATE is dependent on the same rules used by the :class:`.Session`
    in traditional operation; if the object has the
    :attr:`.InstanceState.key`
    attribute set, then the object is assumed to be "detached" and
    will result in an UPDATE.  Otherwise, an INSERT is used.
    
    In the case of an UPDATE, statements are grouped based on which
    attributes have changed, and are thus to be the subject of each
    SET clause.  If ``update_changed_only`` is False, then all
    attributes present within each object are applied to the UPDATE
    statement, which may help in allowing the statements to be grouped
    together into a larger executemany(), and will also reduce the
    overhead of checking history on attributes.
  kind: param
  key: 'param'
  arg_name: 'objects'
  is_optional: False
- DocstringParam
  description: |
    when True, rows that are missing values which
    generate defaults, namely integer primary key defaults and sequences,
    will be inserted **one at a time**, so that the primary key value
    is available.  In particular this will allow joined-inheritance
    and other multi-table mappings to insert correctly without the need
    to provide primary key values ahead of time; however,
    :paramref:`.Session.bulk_save_objects.return_defaults` **greatly
    reduces the performance gains** of the method overall.  It is strongly
    advised to please use the standard :meth:`_orm.Session.add_all`
    approach.
  kind: param
  key: 'param'
  arg_name: 'return_defaults'
  is_optional: False
- DocstringParam
  description: |
    when True, UPDATE statements are rendered
    based on those attributes in each state that have logged changes.
    When False, all attributes present are rendered into the SET clause
    with the exception of primary key attributes.
  kind: param
  key: 'param'
  arg_name: 'update_changed_only'
  is_optional: False
- DocstringParam
  description: |
    when True, the order of inserts and updates
    matches exactly the order in which the objects are given.   When
    False, common types of objects are grouped into inserts
    and updates, to allow for more batching opportunities.
  kind: param
  key: 'param'
  arg_name: 'preserve_order'
  is_optional: False
=== detect
rest
=== compose rest
Perform a bulk save of the given list of objects.

.. legacy::

    This method is a legacy feature as of the 2.0 series of
    SQLAlchemy.   For modern bulk INSERT and UPDATE, see
    the sections :ref:`orm_queryguide_bulk_insert` and
    :ref:`orm_queryguide_bulk_update`.

    For general INSERT and UPDATE of existing ORM mapped objects,
    prefer standard :term:`unit of work` data management patterns,
    introduced in the :ref:`unified_tutorial` at
    :ref:`tutorial_orm_data_manipulation`.  SQLAlchemy 2.0
    now uses :ref:`engine_insertmanyvalues` with modern dialects
    which solves previous issues of bulk INSERT slowness.

.. seealso::

    :doc:`queryguide/dml`

    :meth:`.Session.bulk_insert_mappings`

    :meth:`.Session.bulk_update_mappings`

:param objects: a sequence of mapped object instances.  The mapped
    objects are persisted as is, and are **not** associated with the
    :class:`.Session` afterwards.

    For each object, whether the object is sent as an INSERT or an
    UPDATE is dependent on the same rules used by the :class:`.Session`
    in traditional operation; if the object has the
    :attr:`.InstanceState.key`
    attribute set, then the object is assumed to be "detached" and
    will result in an UPDATE.  Otherwise, an INSERT is used.

    In the case of an UPDATE, statements are grouped based on which
    attributes have changed, and are thus to be the subject of each
    SET clause.  If ``update_changed_only`` is False, then all
    attributes present within each object are applied to the UPDATE
    statement, which may help in allowing the statements to be grouped
    together into a larger executemany(), and will also reduce the
    overhead of checking history on attributes.
:param return_defaults: when True, rows that are missing values which
    generate defaults, namely integer primary key defaults and sequences,
    will be inserted **one at a time**, so that the primary key value
    is available.  In particular this will allow joined-inheritance
    and other multi-table mappings to insert correctly without the need
    to provide primary key values ahead of time; however,
    :paramref:`.Session.bulk_save_objects.return_defaults` **greatly
    reduces the performance gains** of the method overall.  It is strongly
    advised to please use the standard :meth:`_orm.Session.add_all`
    approach.
:param update_changed_only: when True, UPDATE statements are rendered
    based on those attributes in each state that have logged changes.
    When False, all attributes present are rendered into the SET clause
    with the exception of primary key attributes.
:param preserve_order: when True, the order of inserts and updates
    matches exactly the order in which the objects are given.   When
    False, common types of objects are grouped into inserts
    and updates, to allow for more batching opportunities.
