File: //usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/__pycache__/persistence.cpython-310.pyc
o
���g� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlm Z dd lm
Z dd
lmZ ddlm
Z
ddlmZ d
d lm
Z d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ dDdd�Zdd� Zdd� Zdd� Zdd� Z d d!� Z!dddd"d#�d$d%�Z"ddd"d&�d'd(�Z#d)d*� Z$d+d,� Z%d-dd-d.�d/d0�Z&d-ddd1�d2d3�Z'd4d5� Z(d6d7� Z)d8d9� Z*d:d;� Z+d<d=� Z,d>d?� Z-d@dA� Z.dBdC� Z/dS )Ez�private module containing functions used to emit INSERT, UPDATE
and DELETE statements on behalf of a :class:`_orm.Mapper` and its descending
mappers.
The functions here are called only by the unit of work functions
in unitofwork.py.
� )�annotations)�chain)�groupby)�zip_longestN� )�
attributes)�exc)�loading)�sync)� state_str� )�future)�sql)�util)�cursor)� operators)�BooleanClauseList)�LABEL_STYLE_TABLENAME_PLUS_COLFc C s |s| j st| |�D ]}t| |g|dd� q
dS g }g }t| ||�D ]!\}}}} }
}}|
s/|r:|�|||| |f� q"|�|||| f� q"| j�� D ]%\}
}|
|jvrSqIt|
|�}t ||
|�}t
| |||
|� t| |||
|� qIt| |t
dd� |D �dd� |D ��� dS )a; Issue ``INSERT`` and/or ``UPDATE`` statements for a list
of objects.
This is called within the context of a UOWTransaction during a
flush operation, given a list of states to be flushed. The
base mapper in an inheritance hierarchy handles the inserts/
updates for all descendant mappers.
T)�singleNc s s&