Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/ext/__pycache__/horizontal_shard.cpython-39.pyc
Ðазад
a _�h�# � @ sp d Z ddlmZ ddlmZ ddlmZ ddlmZ ddgZG dd� de�Z G d d � d e �ZG dd� de�ZdS ) 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. � )�inspect)�util)�Query)�Session�ShardedSession�ShardedQueryc sP e Zd Z� fdd�Zdd� Zdd� Zdd� Zd� fd d� Zd� fdd � Z� Z S )r c s4 t t| �j|i |�� | jj| _| jj| _d | _d S �N)�superr �__init__�session� id_chooser� query_chooser� _shard_id)�self�args�kwargs�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/sqlalchemy/ext/horizontal_shard.pyr s zShardedQuery.__init__c C s | � � }||_|S )z�Return a new query, limited to a single shard ID. All subsequent operations with the returned query will be against the single shard regardless of other state. )Z_cloner )r �shard_id�qr r r � set_shard! s zShardedQuery.set_shardc sd � �fdd�}� j d ur"|� j �S �jd ur6|�j�S g }����D ]}|�||�� qDt|�S d S )Nc s: | � j d<