관리-도구
편집 파일: persistence.cpython-37.pyc
B ��4]t � @ s d Z ddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ dd lm Z dd lmZ ddlm Z ddlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ dd� Zdd� ZdTdd�Zdd� Zdd� Zdd� Zdd � Zd!d"� ZdUd#d$�ZdVd%d&�Zd'd(� Zd)d*� Z dWd,d-�Z!dXd.d/�Z"d0d1� Z#d2d3� Z$d4d5� Z%d6d7� Z&d8d9� Z'd:d;� Z(d<d=� Z)d>d?� Z*d@dA� Z+G dBdC� dCe,�Z-G dDdE� dEe-�Z.G dFdG� dGe-�Z/G dHdI� dIe-�Z0G dJdK� dKe-�Z1G dLdM� dMe.e0�Z2G dNdO� dOe.e1�Z3G dPdQ� dQe/e0�Z4G dRdS� dSe/e1�Z5dS )Yz�private module containing functions used to emit INSERT, UPDATE and DELETE statements on behalf of a :class:`.Mapper` and its descending mappers. The functions here are called only by the unit of work functions in unitofwork.py. � )�chain)�groupbyN� )� attributes)� evaluator)�exc)�loading)�sync)�_entity_descriptor)� state_str� )�sql)�util)� expression)� _from_objectsc s& �j }t|�}|jjrtd��|rT|rDdd� |D �}dd� |D �}q\dd� |D �}nt|�}|�|�� xj|j�� D ]\\} } �� | �s�qr� �fdd�t | � �fdd�|D �d ||d �D �}t|d || | ||d� qrW |�r"|�r"�j}dd� �j D �} x,|D ]$\}�|t�fd d�| D ��f|_q�W d S )NzJconnection_callable / per-instance sharding not supported in bulk_insert()c S s g | ]}||j f�qS � )�dict)�.0�stater r �M/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/persistence.py� <listcomp>7 s z _bulk_insert.<locals>.<listcomp>c S s g | ]\}}|�qS r r )r r �dict_r r r r 8 s c S s g | ] }|j �qS r )r )r r r r r r : s c 3 s2 | ]*\}}}}}}}}d ||�� |||fV qd S )Nr ) r r � state_dict�params�mp�conn�value_params�has_all_pks�has_all_defaults)� connection�mapperr r � <genexpr>D s z_bulk_insert.<locals>.<genexpr>c 3 s | ]}d |�� fV qd S )Nr )r �mapping)r r r r r! Y s T)�bulk�return_defaults�render_nulls)�bookkeepingc S s g | ] }|j �qS r )�key)r �pr r r r k s c s g | ]}� | �qS r r )r r'