o
    ŠågÒ€  ã                   @  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j0dZd+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 ƒZDdRZEdSZFd[dXdY„ZGdS )\é    )Ú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[]ÚslotsTÚkw_onlyÚfrozenc                   @  sþ  e Zd ZU dZdZded< 	 dZded< 	 er,ej	dd�Z
ded	< ej	d
d�Zded< nej	dZddie¤ŽZ
ded	< ej	dZdd
ie¤ŽZded< esV		d[dd
dœd\dd„Zd]dd„Zed]dd„ƒZed]dd„ƒZed]dd„ƒZed]dd„ƒZed]dd„ƒZed]dd„ƒZed^d!d"„ƒZd_d%d&„Zd`d(d)„Z	
dadbd1d2„Zdcd4d5„Zddd7d8„Zded:d;„ZeZddd<d=„Zddd>d?„Z e Z!ddd@dA„Z"e"Z#dddBdC„Z$dddDdE„Z%dfdFdG„Z&dddHdI„Z'dgdJdK„Z(dgdLdM„Z)dgdNdO„Z*dgdPdQ„Z+dgdRdS„Z,dgdTdU„Z-dhdVdW„Z.dhdXdY„Z/dS )iÚ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

    NúOptional[_T]ÚlowerÚupperr'   )ÚdefaultÚ_BoundsTypeÚboundsFÚboolÚemptyr/   )r1   r3   c                C  s   | j  ||||dœ¡ d S )N)r-   r.   r1   r3   )Ú__dict__Úupdate)Úselfr-   r.   r1   r3   © r7   úa/var/www/html/flaskapp/venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/ranges.pyÚ__init__a   s   	üÿzRange.__init__Úreturnc                 C  s   | j  S ©N©r3   ©r6   r7   r7   r8   Ú__bool__s   ó   zRange.__bool__c                 C  ó   | j S ©z$A synonym for the 'empty' attribute.r<   r=   r7   r7   r8   Úisemptyv   ó   zRange.isemptyc                 C  r@   rA   r<   r=   r7   r7   r8   Úis_empty|   rC   zRange.is_emptyc                 C  ó   | j d dkS )z,Return True if the lower bound is inclusive.r   ú[©r1   r=   r7   r7   r8   Ú	lower_inc‚   ó   zRange.lower_incc                 C  ó   | j  o| jdu S )zKReturn True if this range is non-empty and lower bound is
        infinite.N)r3   r-   r=   r7   r7   r8   Ú	lower_infˆ   ó   zRange.lower_infc                 C  rE   )z,Return True if the upper bound is inclusive.r   ú]rG   r=   r7   r7   r8   Ú	upper_inc�   rI   zRange.upper_incc                 C  rJ   )zOReturn True if this range is non-empty and the upper bound is
        infinite.N)r3   r.   r=   r7   r7   r8   Ú	upper_inf•   rL   zRange.upper_infúAbstractSingleRange[_T]c                 C  ó   t ƒ S r;   )ÚAbstractSingleRanger=   r7   r7   r8   Ú__sa_type_engine__œ   ó   zRange.__sa_type_engine__Úvaluer%   c                 C  s°   | j rdS | jdu r | jdu p| jd dkr|| jk S || jkS | jdu r6| jd dkr1|| jkS || jkS | jd dkrB|| jkn|| jkoW| jd dkrS|| jk S || jkS )z3Return True if this range contains the given value.FNr   ú)r   ú()r3   r-   r.   r1   ©r6   rU   r7   r7   r8   Ú_contains_value    s0   

ÿÿý
ÿÿý
ÿýÿûùzRange._contains_valuer   c                 C  s^   t | jtƒst | jtƒrdS t | jtƒst | jtƒrdS t | jtƒs(t | jtƒr-td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=   r7   r7   r8   Ú_get_discrete_step¾   s   ÿ
zRange._get_discrete_stepÚvalue1Úbound1ÚstrÚvalue2Úbound2Úonly_valuesr\   c                 C  sX  |dv }|dv }||  u rdu r n n||krdS |rdS dS |du r*|r(dS dS |du r4|r2dS dS ||kr>||kr>dS |dv }|dv }	|   ¡ }
|
durt|rY|sX||
7 }d}n|ra||
7 }d}|rl|	sk||
7 }d}	n|	rt||
7 }d}	||k rzdS ||kr€dS |r„dS |rŠ|	rŠdS |sš|	sš||kr”dS |r˜dS dS |s¢|r dS dS |	sª|r¨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.
        >   rW   rF   Nr   éÿÿÿÿr   >   rF   rM   TF)r]   )r6   r^   r_   ra   rb   rc   Úvalue1_is_lower_boundÚvalue2_is_lower_boundÚ
value1_incÚ
value2_incÚstepr7   r7   r8   Ú_compare_edgesÒ   sb   €€zRange._compare_edgesÚotherc           
      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oJ|  ||||	¡dkS )z€Compare this range to the `other` taking into account
        bounds inclusivity, returning ``True`` if they are equal.
        TFr   r   )r[   r+   ÚNotImplementedr3   r-   r1   r.   rj   ©
r6   rk   ÚslowerÚslower_bÚolowerÚolower_bÚsupperÚsupper_bÚoupperÚoupper_br7   r7   r8   Ú__eq__+  s"   




þzRange.__eq__ú	Range[_T]c           
      C  sˆ   | j rdS |j r
dS | j}| jd }|j}|jd }|  ||||¡dk r&dS | j}| jd }|j}|jd }	|  ||||	¡dkrBdS dS )z7Determine whether this range is a contained by `other`.TFr   r   )r3   r-   r1   rj   r.   rm   r7   r7   r8   Úcontained_byF  s"   



zRange.contained_byúUnion[_T, Range[_T]]c                 C  s   t |tƒr
| | ¡S |  |¡S )z.Determine whether this range contains `value`.)r[   r+   rx   rY   rX   r7   r7   r8   Ú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rT|  ||||¡dkrTdS dS )z3Determine whether this range overlaps with `other`.Fr   r   T©r3   r-   r1   r.   rj   ©
r6   rk   rn   ro   rr   rs   rp   rq   rt   ru   r7   r7   r8   Ú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   )r3   r.   r1   r-   rj   )r6   rk   rr   rs   rp   rq   r7   r7   r8   Ústrictly_left_of�  ó   

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   r{   )r6   rk   rn   ro   rt   ru   r7   r7   r8   Ústrictly_right_ofž  r   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   )r3   r-   r1   rj   )r6   rk   rn   ro   rp   rq   r7   r7   r8   Únot_extend_left_of¯  r   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   )r3   r.   r1   rj   )r6   rk   rr   rs   rt   ru   r7   r7   r8   Únot_extend_right_of¾  r   zRange.not_extend_right_ofc                 C  sÎ   |   ||||d¡}|dkr7|  ¡ }|du rdS |dkr)|dkr%||| kS ||kS |dkr1||kS ||| kS |dkre|dkrC|dksK|dkrU|d	krU|  ¡ }|durUdS |dkr]|dkpd|dkod|d	kS dS )
zTDetermine whether an upper bound is immediately successive to a
        lower bound.Trd   NFrM   rF   r   rV   rW   )rj   r]   )r6   r^   r_   ra   rb   Úresri   r7   r7   r8   Ú_upper_edge_adjacent_to_lowerÍ  s6   ÿü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 }	|  ||||¡p7|  ||	||¡S )z8Determine whether this range is adjacent to the `other`.Fr   r   )r3   r-   r1   r.   r„   r|   r7   r7   r8   Úadjacent_toü  s"   



ÿÿþzRange.adjacent_toc                 C  sÔ   | j r|S |j r
| S |  |¡s|  |¡stdƒ‚| j}| jd }| j}| jd }|j}|jd }|j}|jd }	|  ||||¡dk rG|}
|}n|}
|}|  ||||	¡dkrZ|}|}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   rG   )r3   r}   r…   Ú
ValueErrorr-   r1   r.   rj   r+   r   r0   ©r6   rk   rn   ro   rr   rs   rp   rq   rt   ru   ÚrlowerÚrlower_bÚrupperÚrupper_br7   r7   r8   Úunion  s:   ÿ



ÿzRange.unionc                 C  ó
   |   |¡S r;   )rŒ   ©r6   rk   r7   r7   r8   Ú__add__@  ó   
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 rD|dkrDtdƒ‚|  ||||	¡}|  ||||¡}|dks\|dk r^| S |
dkrm|dkrmtddd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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 J d| › d|› �ƒ‚)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<   rF   rV   rM   rG   rW   FzUnhandled case computing z - )	r3   r-   r1   r.   rj   r†   r+   r   r0   )r6   rk   rn   ro   rr   rs   rp   rq   rt   ru   Úsl_vs_olÚsu_vs_ouÚsl_vs_ouÚsu_vs_olr‹   r‰   r7   r7   r8   Ú
differenceC  sb   



ÿÿýÿýzRange.differencec                 C  r�   r;   )r•   rŽ   r7   r7   r8   Ú__sub__�  r�   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 rA|}
|}n|}
|}|  ||||	¡dkrT|}|	}n|}|}t|
|tt|| ƒd�S )zdCompute the intersection of this range with the `other`.

        .. versionadded:: 2.0.10

        NTr<   r   r   rG   )	r3   r}   r+   r-   r1   r.   rj   r   r0   r‡   r7   r7   r8   Úintersection’  s2   



ýzRange.intersectionc                 C  r�   r;   )r—   rŽ   r7   r7   r8   Ú__mul__¸  r�   zRange.__mul__c                 C  s   |   ¡ S r;   )Ú
_stringifyr=   r7   r7   r8   Ú__str__»  r?   zRange.__str__c                 C  s^   | j rdS | j| j}}|d u rdn|}|d u rdn|}td| jƒ\}}|› |› d|› |› �S )Nr3   Ú zTuple[str, str]ú,)r3   r-   r.   r   r1   )r6   ÚlÚrÚb0Úb1r7   r7   r8   r™   ¾  s   zRange._stringifyr7   )NN)r-   r,   r.   r,   r1   r0   r3   r2   )r:   r2   )r:   rP   )rU   r%   r:   r2   )r:   r   )F)r^   r,   r_   r`   ra   r,   rb   r`   rc   r2   r:   r\   )rk   r   r:   r2   )rk   rw   r:   r2   )rU   ry   r:   r2   )
r^   r,   r_   r`   ra   r,   rb   r`   r:   r2   )rk   rw   r:   rw   )r:   r`   )0Ú__name__Ú
__module__Ú__qualname__Ú__doc__r-   Ú__annotations__r.   r   ÚdataclassesÚfieldr1   r3   Ú	dc_kwonlyr    r9   r>   ÚpropertyrB   rD   rH   rK   rN   rO   rS   rY   r]   rj   rv   rx   rz   Ú__contains__r}   r~   Ú
__lshift__r€   Ú
__rshift__r�   r‚   r„   r…   rŒ   r�   r•   r–   r—   r˜   rš   r™   r7   r7   r7   r8   r+   ;   st   
 ýú


ú
Y



 




/

.

L

&
r+   c                   @  s   e Zd ZdZe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`.
    r:   úAbstractMultiRange[_T]c                 C  rQ   r;   )ÚAbstractMultiRanger=   r7   r7   r8   rS   à  rT   zMultiRange.__sa_type_engine__N)r:   r®   )r¡   r¢   r£   r¤   r©   rS   r7   r7   r7   r8   r­   Ë  s    r­   c                      s`   e Zd ZdZdZdZedd	d
„ƒZeddd
„ƒZ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.TÚclsú	Type[_TE]Úkwr   r:   r#   c                 K  ó   d S r;   r7   ©r6   r±   r³   r7   r7   r8   Úadaptì  s   zAbstractRange.adaptúType[TypeEngineMixin]úTypeEngine[Any]c                 K  r´   r;   r7   rµ   r7   r7   r8   r¶   ï  s   ú-Type[Union[TypeEngine[Any], TypeEngineMixin]]c                   sH   t |ttfƒr|| jur| j}t|› d�|| jfd|iƒƒ S tƒ  |¡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.

        Ú	RangeImplÚ__visit_name__)Ú
issubclassÚAbstractSingleRangeImplÚAbstractMultiRangeImplÚ	__class__r»   ÚtypeÚsuperr¶   )r6   r±   r³   Ú
visit_name©r¿   r7   r8   r¶   ô  s   ÿ
ýc                   @  s†   e Zd ZdZddd„Zd d	d
„Zd dd„Zd dd„ZeZd dd„Z	e	Z
d dd„Zd dd„Zd dd„Zd dd„Zd dd„Zd!dd„ZdS )"z AbstractRange.comparator_factoryz-Define comparison operations for range types.rk   r   r³   r:   úColumnElement[bool]c                 K  ó   | 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   )r6   rk   r³   r7   r7   r8   rz     s   z)AbstractRange.comparator_factory.containsc                 C  rÅ   )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            )rÆ   rÇ   r   rŽ   r7   r7   r8   rx   #  rI   z-AbstractRange.comparator_factory.contained_byc                 C  rÅ   )z„Boolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            )rÆ   rÇ   r   rŽ   r7   r7   r8   r}   )  rI   z)AbstractRange.comparator_factory.overlapsc                 C  rÅ   )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            )rÆ   rÇ   r   rŽ   r7   r7   r8   r~   /  rI   z1AbstractRange.comparator_factory.strictly_left_ofc                 C  rÅ   )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            )rÆ   rÇ   r   rŽ   r7   r7   r8   r€   7  rI   z2AbstractRange.comparator_factory.strictly_right_ofc                 C  rÅ   )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Ž   r7   r7   r8   r‚   ?  rI   z4AbstractRange.comparator_factory.not_extend_right_ofc                 C  rÅ   )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Ž   r7   r7   r8   r�   E  rI   z3AbstractRange.comparator_factory.not_extend_left_ofc                 C  rÅ   )z}Boolean expression. Returns true if the range in the column
            is adjacent to the range in the operand.
            )rÆ   rÇ   r   rŽ   r7   r7   r8   r…   K  rI   z,AbstractRange.comparator_factory.adjacent_toc                 C  ó   | 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Ž   r7   r7   r8   rŒ   Q  ó   z&AbstractRange.comparator_factory.unionc                 C  rÈ   rÉ   )rÆ   rÇ   r   ÚsubrŽ   r7   r7   r8   r•   X  rË   z+AbstractRange.comparator_factory.differenceúColumnElement[Range[_T]]c                 C  rÈ   )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Ž   r7   r7   r8   r—   _  rË   z-AbstractRange.comparator_factory.intersectionN)rk   r   r³   r   r:   rÄ   )rk   r   r:   rÄ   )rk   r   r:   rÍ   )r¡   r¢   r£   r¤   rz   rx   r}   r~   r«   r€   r¬   r‚   r�   r…   rŒ   r•   r—   r7   r7   r7   r8   Úcomparator_factory  s    










rÏ   )r±   r²   r³   r   r:   r#   )r±   r·   r³   r   r:   r¸   )r±   r¹   r³   r   r:   r¸   )r¡   r¢   r£   r¤   Úrender_bind_castÚ__abstract__r   r¶   r   Ú
Comparatorr+   r   rÏ   Ú__classcell__r7   r7   rÃ   r8   r°   å  s    ""r°   c                   @  ó   e Zd ZdZdZd
dd„Zd	S )rR   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>`_

    TrU   ú
Range[Any]r:   r   c                 C  sz   |j d ur|j n|j}t|tƒrt|ƒrtƒ S tƒ S t|ttfƒr$t	ƒ S t|t
ƒr2|js/tƒ S tƒ S t|tƒr:tƒ S tjS r;   )r-   r.   r[   r\   Ú	_is_int32Ú	INT4RANGEÚ	INT8RANGEr   ÚfloatÚNUMRANGEr   ÚtzinfoÚTSRANGEÚ	TSTZRANGEr   Ú	DATERANGEÚsqltypesÚNULLTYPE)r6   rU   Úspecr7   r7   r8   Ú_resolve_for_literalt  s   


z(AbstractSingleRange._resolve_for_literalN)rU   rÕ   r:   r   ©r¡   r¢   r£   r¤   rÑ   râ   r7   r7   r7   r8   rR   g  s    
rR   c                   @  ó   e Zd ZdZdS )r½   zQMarker for AbstractSingleRange that will apply a subclass-specific
    adaptationN©r¡   r¢   r£   r¤   r7   r7   r7   r8   r½   Š  ó    r½   c                   @  rÔ   )r¯   z‚Base for PostgreSQL MULTIRANGE types.

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

    TrU   úSequence[Range[Any]]r:   r   c                 C  s–   |st jS |d }|jd ur|jn|j}t|tƒr(tdd„ |D ƒƒr%tƒ S tƒ S t|t	t
fƒr2tƒ S t|tƒr@|js=tƒ S tƒ S t|tƒrHtƒ S t jS )Nr   c                 s  s   � | ]}t |ƒV  qd S r;   )rÖ   )Ú.0rž   r7   r7   r8   Ú	<genexpr>¤  s   € z:AbstractMultiRange._resolve_for_literal.<locals>.<genexpr>)rß   rà   r-   r.   r[   r\   ÚallÚINT4MULTIRANGEÚINT8MULTIRANGEr   rÙ   ÚNUMMULTIRANGEr   rÛ   ÚTSMULTIRANGEÚTSTZMULTIRANGEr   ÚDATEMULTIRANGE)r6   rU   Úfirstrá   r7   r7   r8   râ   ™  s   


z'AbstractMultiRange._resolve_for_literalN)rU   rç   r:   r   rã   r7   r7   r7   r8   r¯   �  s    r¯   c                   @  rä   )r¾   zPMarker for AbstractMultiRange that will apply a subclass-specific
    adaptationNrå   r7   r7   r7   r8   r¾   ³  ræ   r¾   c                   @  ó   e Zd ZdZd ZdS )r×   z(Represent the PostgreSQL INT4RANGE type.N©r¡   r¢   r£   r¤   r»   r7   r7   r7   r8   r×   ¸  ó    r×   c                   @  rò   )rØ   z(Represent the PostgreSQL INT8RANGE type.Nró   r7   r7   r7   r8   rØ   ¾  rô   rØ   c                   @  rò   )rÚ   z'Represent the PostgreSQL NUMRANGE type.Nró   r7   r7   r7   r8   rÚ   Ä  rô   rÚ   c                   @  rò   )rÞ   z(Represent the PostgreSQL DATERANGE type.Nró   r7   r7   r7   r8   rÞ   Ê  rô   rÞ   c                   @  rò   )rÜ   ú&Represent the PostgreSQL TSRANGE type.Nró   r7   r7   r7   r8   rÜ   Ð  rô   rÜ   c                   @  rò   )rÝ   ú(Represent the PostgreSQL TSTZRANGE type.Nró   r7   r7   r7   r8   rÝ   Ö  rô   rÝ   c                   @  rò   )rë   z-Represent the PostgreSQL INT4MULTIRANGE type.Nró   r7   r7   r7   r8   rë   Ü  rô   rë   c                   @  rò   )rì   z-Represent the PostgreSQL INT8MULTIRANGE type.Nró   r7   r7   r7   r8   rì   â  rô   rì   c                   @  rò   )rí   z,Represent the PostgreSQL NUMMULTIRANGE type.Nró   r7   r7   r7   r8   rí   è  rô   rí   c                   @  rò   )rð   z-Represent the PostgreSQL DATEMULTIRANGE type.Nró   r7   r7   r7   r8   rð   î  rô   rð   c                   @  rò   )rî   rõ   Nró   r7   r7   r7   r8   rî   ô  rô   rî   c                   @  rò   )rï   rö   Nró   r7   r7   r7   r8   rï   ú  rô   rï   iÿÿÿi   €rž   ú
Range[int]r:   r2   c                 C  sH   | j d u st| j   kotkn  o#| jd u p#t| j  ko!tkS   S r;   )r-   Ú_min_int_32Ú_max_int_32r.   )rž   r7   r7   r8   rÖ     s
   $ÿÿrÖ   r7   )rž   r÷   r:   r2   )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ß   ÚsqlÚsql.type_apir   Úutilr    Úutil.typingr!   Úsql.elementsr"   r#   r$   r%   r0   Údc_slotsr¨   Ú	dataclassr+   r­   r°   rR   r½   r¯   r¾   r\   r×   rØ   rÚ   rÞ   rÜ   rÝ   rë   rì   rí   rð   rî   rï   rù   rø   rÖ   r7   r7   r7   r8   Ú<module>   sŽ   
      #$