a
    •˜ëj²€  ã                   @  sŒ  d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  ddl!mZ ddl"m#Z# dd l$m%Z% dd!l&m'Z' e�ršdd"l(m)Z) dd#l"m*Z* dd$l"m+Z+ ed%e	d&�Z,e'd' Z-e%�rÆd(d)iZ.d*d)iZ/ni Z.i Z/ej0f d+d)ie.¤ŽG d,d-„ d-ee, ƒƒZ1G d.d/„ d/ee1e,  ƒZ2G d0d1„ d1e j#e, ƒZ3G d2d3„ d3e3e1e,  ƒZ4G d4d5„ d5e4e, ƒZ5G d6d7„ d7e3ee1e,   ƒZ6G d8d9„ d9e6e, ƒZ7G d:d;„ d;e4e8 ƒZ9G d<d=„ d=e4e8 ƒZ:G d>d?„ d?e4e ƒZ;G d@dA„ dAe4e ƒZ<G dBdC„ dCe4e ƒZ=G dDdE„ dEe4e ƒZ>G dFdG„ dGe6e8 ƒZ?G dHdI„ dIe6e8 ƒZ@G dJdK„ dKe6e ƒZAG dLdM„ dMe6e ƒZBG dNdO„ dOe6e ƒZCG dPdQ„ dQe6e ƒZDdRZEdSZFdTdUdVœdWdX„ZGdS )Yé    )ÚannotationsN)Údate)Údatetime)Ú	timedelta)ÚDecimal)ÚAny)Úcast)ÚGeneric)ÚList)ÚOptional)Úoverload)ÚSequence)ÚTuple)ÚType)ÚTYPE_CHECKING)ÚTypeVar)ÚUnioné   )ÚADJACENT_TO)ÚCONTAINED_BY)ÚCONTAINS)ÚNOT_EXTEND_LEFT_OF)ÚNOT_EXTEND_RIGHT_OF)ÚOVERLAP)ÚSTRICTLY_LEFT_OF)ÚSTRICTLY_RIGHT_OFé   )Útypes)Ú	operators)Ú
TypeEngine)Úpy310)ÚLiteral)ÚColumnElement)Ú_TE)ÚTypeEngineMixinÚ_T)Úbound)z()ú[)z(]z[]ÚslotsTZkw_onlyÚfrozenc                   @  s¤  e Zd ZU dZdZded< dZded< erTej	dd�Z
ded	< ej	d
d�Zded< n8ej	f ddie¤ŽZ
ded	< ej	f dd
ie¤ŽZded< es®dXdd
dœdddddœdd„Zddœdd„Zeddœdd„ƒZeddœdd„ƒZeddœdd„ƒZeddœdd„ƒZeddœdd„ƒZeddœdd „ƒZed!dœd"d#„ƒZd$dd%œd&d'„Zd(dœd)d*„ZdYdd+dd+dd,d-œd.d/„Zd(dd0œd1d2„Zd3dd0œd4d5„Zd6dd%œd7d8„ZeZd3dd0œd9d:„Zd3dd0œd;d<„Z e Z!d3dd0œd=d>„Z"e"Z#d3dd0œd?d@„Z$d3dd0œdAdB„Z%dd+dd+ddCœdDdE„Z&d3dd0œdFdG„Z'd3d3d0œdHdI„Z(d3d3d0œdJdK„Z)d3d3d0œdLdM„Z*d3d3d0œdNdO„Z+d3d3d0œdPdQ„Z,d3d3d0œdRdS„Z-d+dœdTdU„Z.d+dœdVdW„Z/dS )ZÚRangea_  Represent a PostgreSQL range.

    E.g.::

        r = Range(10, 50, bounds="()")

    The calling style is similar to that of psycopg and psycopg2, in part
    to allow easier migration from previous SQLAlchemy versions that used
    these objects directly.

    :param lower: Lower bound value, or None
    :param upper: Upper bound value, or None
    :param bounds: keyword-only, optional string value that is one of
     ``"()"``, ``"[)"``, ``"(]"``, ``"[]"``.  Defaults to ``"[)"``.
    :param empty: keyword-only, optional bool indicating this is an "empty"
     range

    .. versionadded:: 2.0

    NzOptional[_T]ÚlowerÚupperr'   )ÚdefaultÚ_BoundsTypeÚboundsFÚboolÚemptyr-   )r/   r1   ©r+   r,   r/   r1   c                C  s   | j  ||||dœ¡ d S )Nr2   )Ú__dict__Úupdate)Úselfr+   r,   r/   r1   © r6   úd/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/sqlalchemy/dialects/postgresql/ranges.pyÚ__init__a   s    	üÿzRange.__init__©Úreturnc                 C  s   | j  S ©N©r1   ©r5   r6   r6   r7   Ú__bool__s   s    zRange.__bool__c                 C  s   | j S ©z$A synonym for the 'empty' attribute.r<   r=   r6   r6   r7   Úisemptyv   s    zRange.isemptyc                 C  s   | j S r?   r<   r=   r6   r6   r7   Úis_empty|   s    zRange.is_emptyc                 C  s   | j d dkS )z,Return True if the lower bound is inclusive.r   ú[©r/   r=   r6   r6   r7   Ú	lower_inc‚   s    zRange.lower_incc                 C  s   | j  o| jdu S )zKReturn True if this range is non-empty and lower bound is
        infinite.N)r1   r+   r=   r6   r6   r7   Ú	lower_infˆ   s    zRange.lower_infc                 C  s   | j d dkS )z,Return True if the upper bound is inclusive.r   ú]rC   r=   r6   r6   r7   Ú	upper_inc�   s    zRange.upper_incc                 C  s   | j  o| jdu S )zOReturn True if this range is non-empty and the upper bound is
        infinite.N)r1   r,   r=   r6   r6   r7   Ú	upper_inf•   s    zRange.upper_infzAbstractSingleRange[_T]c                 C  s   t ƒ S r;   )ÚAbstractSingleRanger=   r6   r6   r7   Ú__sa_type_engine__œ   s    zRange.__sa_type_engine__r%   ©Úvaluer:   c                 C  s°   | j r
dS | jdu r@| jdu p>| jd dkr6|| jk S || jkS | jdu rl| jd dkrb|| jkS || jkS | jd dkr„|| jkn|| jko®| jd dkr¦|| jk S || jkS )z3Return True if this range contains the given value.FNr   ú)r   ú()r1   r+   r,   r/   ©r5   rL   r6   r6   r7   Ú_contains_value    s*    

ÿý
ÿýÿýÿùzRange._contains_valuer   c                 C  sb   t | jtƒst | jtƒrdS t | jtƒs4t | jtƒr8dS t | jtƒsPt | jtƒrZtdd�S dS dS )uA   Determine the â€œstepâ€� for this range, if it is a discrete one.r   N)Údays)Ú
isinstancer+   Úintr,   r   r   r   r=   r6   r6   r7   Ú_get_discrete_step¾   s    ÿ
zRange._get_discrete_stepÚstrrS   )Úvalue1Úbound1Úvalue2Úbound2Úonly_valuesr:   c                 C  sx  |dv }|dv }||  u r$du rBn n||kr4dS |r<dS dS n(|du rV|rRdS dS |du rj|rfdS dS ||kr~||kr~dS |dv }|dv }	|   ¡ }
|
durê|r´|sÄ||
7 }d}n|rÄ||
7 }d}|rÚ|	sê||
7 }d}	n|	rê||
7 }d}	||k rödS ||k�rdS |�rdS |�r|	�rdS |�sH|	�sH||k�r8dS |�rBdS dS n,|�s\|�rXdS dS |	�sp|�rldS dS dS dS )	a  Compare two range bounds.

        Return -1, 0 or 1 respectively when `value1` is less than,
        equal to or greater than `value2`.

        When `only_value` is ``True``, do not consider the *inclusivity*
        of the edges, just their values.
        >   rB   rN   Nr   éÿÿÿÿr   >   rB   rF   TF)rT   )r5   rV   rW   rX   rY   rZ   Zvalue1_is_lower_boundZvalue2_is_lower_boundZ
value1_incZ
value2_incÚstepr6   r6   r7   Ú_compare_edgesÒ   s^    

zRange._compare_edges©Úotherr:   c           
      C  s–   t |tƒstS | jr|jrdS | j|jkr.dS | j}| jd }|j}|jd }| j}| jd }|j}|jd }	|  ||||¡dko”|  ||||	¡dkS )z€Compare this range to the `other` taking into account
        bounds inclusivity, returning ``True`` if they are equal.
        TFr   r   )rR   r*   ÚNotImplementedr1   r+   r/   r,   r]   ©
r5   r_   ÚslowerÚslower_bÚolowerÚolower_bÚsupperÚsupper_bÚoupperÚoupper_br6   r6   r7   Ú__eq__+  s"    




þzRange.__eq__z	Range[_T]c           
      C  sˆ   | j r
dS |j rdS | j}| jd }|j}|jd }|  ||||¡dk rLdS | j}| jd }|j}|jd }	|  ||||	¡dkr„dS dS )z7Determine whether this range is a contained by `other`.TFr   r   )r1   r+   r/   r]   r,   ra   r6   r6   r7   Úcontained_byF  s"    



zRange.contained_byzUnion[_T, Range[_T]]c                 C  s"   t |tƒr| | ¡S |  |¡S dS )z.Determine whether this range contains `value`.N)rR   r*   rk   rP   rO   r6   r6   r7   Úcontainsc  s    

zRange.containsc           
      C  s¬   | j s|j rdS | j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡dkr||  ||||	¡dkr|dS |  ||||¡dkr¨|  ||||¡dkr¨dS dS )z3Determine whether this range overlaps with `other`.Fr   r   T©r1   r+   r/   r,   r]   ©
r5   r_   rb   rc   rf   rg   rd   re   rh   ri   r6   r6   r7   Úoverlapsm  s*    



ÿþÿþzRange.overlapsc                 C  sD   | j s|j rdS | j}| jd }|j}|jd }|  ||||¡dk S )zBDetermine whether this range is completely to the left of `other`.Fr   r   )r1   r,   r/   r+   r]   )r5   r_   rf   rg   rd   re   r6   r6   r7   Ústrictly_left_of�  s    

zRange.strictly_left_ofc                 C  sD   | j s|j rdS | j}| jd }|j}|jd }|  ||||¡dkS )zCDetermine whether this range is completely to the right of `other`.Fr   r   rm   )r5   r_   rb   rc   rh   ri   r6   r6   r7   Ústrictly_right_ofž  s    

zRange.strictly_right_ofc                 C  sD   | j s|j rdS | j}| jd }|j}|jd }|  ||||¡dkS )z>Determine whether this does not extend to the left of `other`.Fr   )r1   r+   r/   r]   )r5   r_   rb   rc   rd   re   r6   r6   r7   Únot_extend_left_of¯  s    

zRange.not_extend_left_ofc                 C  sD   | j s|j rdS | j}| jd }|j}|jd }|  ||||¡dkS )z?Determine whether this does not extend to the right of `other`.Fr   r   )r1   r,   r/   r]   )r5   r_   rf   rg   rh   ri   r6   r6   r7   Únot_extend_right_of¾  s    

zRange.not_extend_right_of)rV   rW   rX   rY   r:   c                 C  sÖ   |   ||||d¡}|dkrr|  ¡ }|du r.dS |dkrT|dkrJ||| kS ||kS qÒ|dkrd||kS ||| kS n`|dkrÎ|dkrŠ|dksš|dkr®|d	kr®|  ¡ }|dur®dS |dkr¾|dkpÌ|dkoÌ|d	kS dS dS )
zTDetermine whether an upper bound is immediately successive to a
        lower bound.Tr[   NFrF   rB   r   rM   rN   )r]   rT   )r5   rV   rW   rX   rY   Úresr\   r6   r6   r7   Ú_upper_edge_adjacent_to_lowerÍ  s>    
ÿþýüÿüz#Range._upper_edge_adjacent_to_lowerc           
      C  sp   | j s|j rdS | j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡pn|  ||	||¡S )z8Determine whether this range is adjacent to the `other`.Fr   r   )r1   r+   r/   r,   ru   rn   r6   r6   r7   Úadjacent_toü  s"    



ÿÿþzRange.adjacent_toc                 C  sÔ   | j r
|S |j r| S |  |¡s0|  |¡s0tdƒ‚| j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡dk rŽ|}
|}n|}
|}|  ||||	¡dkr´|}|}n|}|	}t|
|t	t
|| ƒd�S )z¾Compute the union of this range with the `other`.

        This raises a ``ValueError`` exception if the two ranges are
        "disjunct", that is neither adjacent nor overlapping.
        zAAdding non-overlapping and non-adjacent ranges is not implementedr   r   rC   )r1   ro   rv   Ú
ValueErrorr+   r/   r,   r]   r*   r   r.   ©r5   r_   rb   rc   rf   rg   rd   re   rh   ri   ZrlowerÚrlower_bZrupperÚrupper_br6   r6   r7   Úunion  s:    ÿ



ÿzRange.unionc                 C  s
   |   |¡S r;   )r{   ©r5   r_   r6   r6   r7   Ú__add__@  s    zRange.__add__c                 C  sø  | j s|j r| S | j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡}
|  ||||	¡}|
dk rˆ|dkrˆtdƒ‚|  ||||	¡}|  ||||¡}|dks¸|dk r¼| S |
dkrÚ|dkrÚtdddd�S |
dk�rZ|dk�rZ|dk�rZ|dk�rdnd	}|dk�rB|d	k�rB|  ||||¡dk�rBtdddd�S t||tt|| ƒd
�S |
dk�rÚ|dk�rÚ|dk�rÚ|	d	k�r†dnd}|dk�rÂ|d	k�rÂ|  ||||¡dk�rÂtdddd�S t||tt|| ƒd
�S d�sôJ d| › d|› �ƒ‚dS )zÇCompute the difference between this range and the `other`.

        This raises a ``ValueError`` exception if the two ranges are
        "disjunct", that is neither adjacent nor overlapping.
        r   r   z5Subtracting a strictly inner range is not implementedNTr<   rB   rM   rF   rC   rN   FzUnhandled case computing z - )	r1   r+   r/   r,   r]   rw   r*   r   r.   )r5   r_   rb   rc   rf   rg   rd   re   rh   ri   Zsl_vs_olZsu_vs_ouZsl_vs_ouZsu_vs_olrz   ry   r6   r6   r7   Ú
differenceC  sn    



ÿÿþÿýýÿþÿýýzRange.differencec                 C  s
   |   |¡S r;   )r~   r|   r6   r6   r7   Ú__sub__�  s    zRange.__sub__c                 C  sÈ   | j s|j s|  |¡s$tdddd�S | j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡dk r‚|}
|}n|}
|}|  ||||	¡dkr¨|}|	}n|}|}t|
|tt|| ƒd�S )zdCompute the intersection of this range with the `other`.

        .. versionadded:: 2.0.10

        NTr<   r   r   rC   )	r1   ro   r*   r+   r/   r,   r]   r   r.   rx   r6   r6   r7   Úintersection’  s2    



ýzRange.intersectionc                 C  s
   |   |¡S r;   )r€   r|   r6   r6   r7   Ú__mul__¸  s    zRange.__mul__c                 C  s   |   ¡ S r;   )Ú
_stringifyr=   r6   r6   r7   Ú__str__»  s    zRange.__str__c                 C  s^   | j r
dS | j| j }}|d u r$dn|}|d u r4dn|}td| jƒ\}}|› |› d|› |› �S )Nr1   Ú zTuple[str, str]ú,)r1   r+   r,   r   r/   )r5   ÚlÚrZb0Úb1r6   r6   r7   r‚   ¾  s    zRange._stringify)NN)F)0Ú__name__Ú
__module__Ú__qualname__Ú__doc__r+   Ú__annotations__r,   r   ÚdataclassesÚfieldr/   r1   Ú	dc_kwonlyr    r8   r>   Úpropertyr@   rA   rD   rE   rG   rH   rJ   rP   rT   r]   rj   rk   rl   Ú__contains__ro   rp   Ú
__lshift__rq   Ú
__rshift__rr   rs   ru   rv   r{   r}   r~   r   r€   r�   rƒ   r‚   r6   r6   r6   r7   r*   ;   sn   
  ýú úY /.L&r*   c                   @  s"   e Zd ZdZeddœdd„ƒZdS )Ú
MultiRangea?  Represents a multirange sequence.

    This list subclass is an utility to allow automatic type inference of
    the proper multi-range SQL type depending on the single range values.
    This is useful when operating on literal multi-ranges::

        import sqlalchemy as sa
        from sqlalchemy.dialects.postgresql import MultiRange, Range

        value = literal(MultiRange([Range(2, 4)]))

        select(tbl).where(tbl.c.value.op("@")(MultiRange([Range(-3, 7)])))

    .. versionadded:: 2.0.26

    .. seealso::

        - :ref:`postgresql_multirange_list_use`.
    zAbstractMultiRange[_T]r9   c                 C  s   t ƒ S r;   )ÚAbstractMultiRanger=   r6   r6   r7   rJ   à  s    zMultiRange.__sa_type_engine__N)r‰   rŠ   r‹   rŒ   r‘   rJ   r6   r6   r6   r7   r•   Ë  s   r•   c                      sx   e Zd ZdZdZdZeddddœdd„ƒZed	dd
dœdd„ƒZddd
dœ‡ fdd„ZG dd„ dej	e
e  ƒZ‡  ZS )ÚAbstractRangez0Base class for single and multi Range SQL types.Tz	Type[_TE]r   r#   )ÚclsÚkwr:   c                 K  s   d S r;   r6   ©r5   r˜   r™   r6   r6   r7   Úadaptì  s    zAbstractRange.adaptzType[TypeEngineMixin]zTypeEngine[Any]c                 K  s   d S r;   r6   rš   r6   r6   r7   r›   ï  s    z-Type[Union[TypeEngine[Any], TypeEngineMixin]]c                   sL   t |ttfƒr<|| jur<| j}t|› d�|| jfd|iƒƒ S tƒ  |¡S dS )a	  Dynamically adapt a range type to an abstract impl.

        For example ``INT4RANGE().adapt(_Psycopg2NumericRange)`` should
        produce a type that will have ``_Psycopg2NumericRange`` behaviors
        and also render as ``INT4RANGE`` in SQL and DDL.

        Z	RangeImplÚ__visit_name__N)Ú
issubclassÚAbstractSingleRangeImplÚAbstractMultiRangeImplÚ	__class__rœ   ÚtypeÚsuperr›   )r5   r˜   r™   Z
visit_name©r    r6   r7   r›   ô  s    ÿþýc                   @  sÊ   e Zd ZdZddddœdd„Zdddœdd	„Zdddœd
d„Zdddœdd„ZeZdddœdd„Z	e	Z
dddœdd„Zdddœdd„Zdddœdd„Zdddœdd„Zdddœdd„Zdddœdd„ZdS )z AbstractRange.comparator_factoryz-Define comparison operations for range types.r   zColumnElement[bool])r_   r™   r:   c                 K  s   | j  t|¡S )a
  Boolean expression. Returns true if the right hand operand,
            which can be an element or a range, is contained within the
            column.

            kwargs may be ignored by this operator but are required for API
            conformance.
            )ÚexprÚoperater   )r5   r_   r™   r6   r6   r7   rl     s    z)AbstractRange.comparator_factory.containsr^   c                 C  s   | j  t|¡S )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            )r¤   r¥   r   r|   r6   r6   r7   rk   #  s    z-AbstractRange.comparator_factory.contained_byc                 C  s   | j  t|¡S )z„Boolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            )r¤   r¥   r   r|   r6   r6   r7   ro   )  s    z)AbstractRange.comparator_factory.overlapsc                 C  s   | j  t|¡S )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            )r¤   r¥   r   r|   r6   r6   r7   rp   /  s    z1AbstractRange.comparator_factory.strictly_left_ofc                 C  s   | j  t|¡S )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            )r¤   r¥   r   r|   r6   r6   r7   rq   7  s    z2AbstractRange.comparator_factory.strictly_right_ofc                 C  s   | j  t|¡S )z‡Boolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            )r¤   r¥   r   r|   r6   r6   r7   rs   ?  s    z4AbstractRange.comparator_factory.not_extend_right_ofc                 C  s   | j  t|¡S )z†Boolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            )r¤   r¥   r   r|   r6   r6   r7   rr   E  s    z3AbstractRange.comparator_factory.not_extend_left_ofc                 C  s   | j  t|¡S )z}Boolean expression. Returns true if the range in the column
            is adjacent to the range in the operand.
            )r¤   r¥   r   r|   r6   r6   r7   rv   K  s    z,AbstractRange.comparator_factory.adjacent_toc                 C  s   | j  tj|¡S ©z�Range expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )r¤   r¥   r   Úaddr|   r6   r6   r7   r{   Q  s    z&AbstractRange.comparator_factory.unionc                 C  s   | j  tj|¡S r¦   )r¤   r¥   r   Úsubr|   r6   r6   r7   r~   X  s    z+AbstractRange.comparator_factory.differencezColumnElement[Range[_T]]c                 C  s   | j  tj|¡S )z¤Range expression. Returns the intersection of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )r¤   r¥   r   Úmulr|   r6   r6   r7   r€   _  s    z-AbstractRange.comparator_factory.intersectionN)r‰   rŠ   r‹   rŒ   rl   rk   ro   rp   r“   rq   r”   rs   rr   rv   r{   r~   r€   r6   r6   r6   r7   Úcomparator_factory  s   
rª   )r‰   rŠ   r‹   rŒ   Zrender_bind_castÚ__abstract__r   r›   r   Z
Comparatorr*   r   rª   Ú__classcell__r6   r6   r£   r7   r—   å  s   "r—   c                   @  s$   e Zd ZdZdZdddœdd„ZdS )	rI   zòBase for PostgreSQL RANGE types.

    These are types that return a single :class:`_postgresql.Range` object.

    .. seealso::

        `PostgreSQL range functions <https://www.postgresql.org/docs/current/static/functions-range.html>`_

    Tz
Range[Any]r   rK   c                 C  s€   |j d ur|j n|j}t|tƒr6t|ƒr.tƒ S tƒ S nFt|ttfƒrJt	ƒ S t|t
ƒrf|js`tƒ S tƒ S t|tƒrvtƒ S tjS d S r;   )r+   r,   rR   rS   Ú	_is_int32Ú	INT4RANGEÚ	INT8RANGEr   ÚfloatÚNUMRANGEr   ÚtzinfoÚTSRANGEÚ	TSTZRANGEr   Ú	DATERANGEÚsqltypesÚNULLTYPE)r5   rL   Úspecr6   r6   r7   Ú_resolve_for_literalt  s    


z(AbstractSingleRange._resolve_for_literalN©r‰   rŠ   r‹   rŒ   r«   r¹   r6   r6   r6   r7   rI   g  s   
rI   c                   @  s   e Zd ZdZdS )rž   zQMarker for AbstractSingleRange that will apply a subclass-specific
    adaptationN©r‰   rŠ   r‹   rŒ   r6   r6   r6   r7   rž   Š  s   rž   c                   @  s$   e Zd ZdZdZdddœdd„ZdS )	r–   z‚Base for PostgreSQL MULTIRANGE types.

    these are types that return a sequence of :class:`_postgresql.Range`
    objects.

    TzSequence[Range[Any]]r   rK   c                 C  sœ   |s
t jS |d }|jd ur"|jn|j}t|tƒrRtdd„ |D ƒƒrJtƒ S tƒ S nFt|t	t
fƒrftƒ S t|tƒr‚|js|tƒ S tƒ S t|tƒr’tƒ S t jS d S )Nr   c                 s  s   | ]}t |ƒV  qd S r;   )r­   )Ú.0r‡   r6   r6   r7   Ú	<genexpr>¤  ó    z:AbstractMultiRange._resolve_for_literal.<locals>.<genexpr>)r¶   r·   r+   r,   rR   rS   ÚallÚINT4MULTIRANGEÚINT8MULTIRANGEr   r°   ÚNUMMULTIRANGEr   r²   ÚTSMULTIRANGEÚTSTZMULTIRANGEr   ÚDATEMULTIRANGE)r5   rL   Úfirstr¸   r6   r6   r7   r¹   ™  s    


z'AbstractMultiRange._resolve_for_literalNrº   r6   r6   r6   r7   r–   �  s   r–   c                   @  s   e Zd ZdZdS )rŸ   zPMarker for AbstractMultiRange that will apply a subclass-specific
    adaptationNr»   r6   r6   r6   r7   rŸ   ³  s   rŸ   c                   @  s   e Zd ZdZd ZdS )r®   z(Represent the PostgreSQL INT4RANGE type.N©r‰   rŠ   r‹   rŒ   rœ   r6   r6   r6   r7   r®   ¸  s   r®   c                   @  s   e Zd ZdZd ZdS )r¯   z(Represent the PostgreSQL INT8RANGE type.NrÇ   r6   r6   r6   r7   r¯   ¾  s   r¯   c                   @  s   e Zd ZdZd ZdS )r±   z'Represent the PostgreSQL NUMRANGE type.NrÇ   r6   r6   r6   r7   r±   Ä  s   r±   c                   @  s   e Zd ZdZd ZdS )rµ   z(Represent the PostgreSQL DATERANGE type.NrÇ   r6   r6   r6   r7   rµ   Ê  s   rµ   c                   @  s   e Zd ZdZd ZdS )r³   ú&Represent the PostgreSQL TSRANGE type.NrÇ   r6   r6   r6   r7   r³   Ð  s   r³   c                   @  s   e Zd ZdZd ZdS )r´   ú(Represent the PostgreSQL TSTZRANGE type.NrÇ   r6   r6   r6   r7   r´   Ö  s   r´   c                   @  s   e Zd ZdZd ZdS )rÀ   z-Represent the PostgreSQL INT4MULTIRANGE type.NrÇ   r6   r6   r6   r7   rÀ   Ü  s   rÀ   c                   @  s   e Zd ZdZd ZdS )rÁ   z-Represent the PostgreSQL INT8MULTIRANGE type.NrÇ   r6   r6   r6   r7   rÁ   â  s   rÁ   c                   @  s   e Zd ZdZd ZdS )rÂ   z,Represent the PostgreSQL NUMMULTIRANGE type.NrÇ   r6   r6   r6   r7   rÂ   è  s   rÂ   c                   @  s   e Zd ZdZd ZdS )rÅ   z-Represent the PostgreSQL DATEMULTIRANGE type.NrÇ   r6   r6   r6   r7   rÅ   î  s   rÅ   c                   @  s   e Zd ZdZd ZdS )rÃ   rÈ   NrÇ   r6   r6   r6   r7   rÃ   ô  s   rÃ   c                   @  s   e Zd ZdZd ZdS )rÄ   rÉ   NrÇ   r6   r6   r6   r7   rÄ   ú  s   rÄ   iÿÿÿi   €z
Range[int]r0   )r‡   r:   c                 C  sH   | j d u s$t| j   kotkn  oF| jd u pFt| j  koBtkS   S r;   )r+   Ú_min_int_32Ú_max_int_32r,   )r‡   r6   r6   r7   r­     s    $"ÿr­   )HÚ
__future__r   rŽ   r   r   r   Údecimalr   Útypingr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r„   r   r¶   ZsqlZsql.type_apir   Úutilr    Zutil.typingr!   Zsql.elementsr"   r#   r$   r%   r.   Zdc_slotsr�   Z	dataclassr*   r•   r—   rI   rž   r–   rŸ   rS   r®   r¯   r±   rµ   r³   r´   rÀ   rÁ   rÂ   rÅ   rÃ   rÄ   rË   rÊ   r­   r6   r6   r6   r7   Ú<module>   sŒ   
      #$