관리-도구
편집 파일: horizontal_shard.cpython-38.pyc
U -?�fnA � @ sv d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ ddlm Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dl!m"Z" d dl!m#Z# e�r�d dl$m%Z% d dl$m&Z& d dl$m'Z' d dl(m)Z) d d l(m*Z* d d!lm+Z+ d d"lm,Z, d d#l-m.Z. d d$l/m0Z0 d d%lm1Z1 d d&lm2Z2 d d'lm3Z3 d d(l4m5Z5 d d)l6m7Z7 d d*l8m9Z9 d d+l:m;Z; d,d-gZ<ed.ed/�Z=e>Z?G d0d1� d1e"�Z@G d2d3� d3e"�ZAG d4d-� d-ee= �ZBG d5d,� d,e �ZCG d6d7� d7e�ZDd8d9d:�d;d<�ZEd=S )>a� Horizontal sharding support. Defines a rudimental 'horizontal sharding' system which allows a Session to distribute queries and persistence operations across multiple databases. For a usage example, see the :ref:`examples_sharding` example included in the source distribution. .. deepalchemy:: The horizontal sharding extension is an advanced feature, involving a complex statement -> database interaction as well as use of semi-public APIs for non-trivial cases. Simpler approaches to refering to multiple database "shards", most commonly using a distinct :class:`_orm.Session` per "shard", should always be considered first before using this more complex and less-production-tested system. � )�annotations)�Any)�Callable)�Dict)�Iterable)�Optional)�Tuple)�Type)� TYPE_CHECKING)�TypeVar)�Union� )�event)�exc)�inspect)�util)�PassiveFlag)�OrmExecuteOptionsParameter)� ORMOption)�Mapper)�Query)�_BindArguments)�_PKIdentityArgument)�Session)�Protocol)�Self)� Connection)�Engine)�OptionEngine)�IteratorResult)�Result)�LoaderCallableStatus)�_O)�BulkUDCompileState)�QueryContext)�_EntityBindKey)�_SessionBind)�ORMExecuteState)� InstanceState)� Executable)�_TP)� ClauseElement�ShardedSession�ShardedQuery�_T)�boundc @ s e Zd Zddddd�dd�ZdS )�ShardChooser�Optional[Mapper[_T]]r �Optional[ClauseElement])�mapper�instance�clause�returnc C s d S �N� )�selfr3 r4 r5 r8 r8 �O/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/ext/horizontal_shard.py�__call__Q s zShardChooser.__call__N��__name__� __module__�__qualname__r; r8 r8 r8 r: r0 P s r0 c @ s&