
    [hҀ                    R   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	&          Z,e'd'         Z-e%r	d(d)iZ.d*d)iZ/ni Z.i Z/ ej0        dYd+d)ie. G d, d-ee,                               Z1 G d. d/ee1e,                            Z2 G d0 d1e j#        e,                   Z3 G d2 d3e3e1e,                            Z4 G d4 d5e4e,                   Z5 G d6 d7e3ee1e,                                     Z6 G d8 d9e6e,                   Z7 G d: d;e4e8                   Z9 G d< d=e4e8                   Z: G d> d?e4e                   Z; G d@ dAe4e                   Z< G dB dCe4e                   Z= G dD dEe4e                   Z> G dF dGe6e8                   Z? G dH dIe6e8                   Z@ G dJ dKe6e                   ZA G dL dMe6e                   ZB G dN dOe6e                   ZC G dP dQe6e                   ZDdRZEdSZFdZdX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                  d   e Zd ZU dZdZded<   	 dZded<   	 er- ej	        d          Z
ded	<    ej	        d
          Zded<   n( ej	        d<ddieZ
ded	<    ej	        d<dd
ieZded<   es	 	 d=dd
dd>dZd?dZed?d            Zed?d            Zed?d            Zed?d            Zed?d            Zed?d            Zed@d            ZdAdZdBdZ	 dCdDd&ZdEd(ZdFd*ZdGd,ZeZdFd-ZdFd.Z e Z!dFd/Z"e"Z#dFd0Z$dFd1Z%dHd2Z&dFd3Z'dId4Z(dId5Z)dId6Z*dId7Z+dId8Z,dId9Z-dJd:Z.dJd;Z/dS )K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emptyr1   )r3   r5   c               D    | j                             ||||d           d S )N)r/   r0   r3   r5   )__dict__update)selfr/   r0   r3   r5   s        t/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/ranges.py__init__zRange.__init__a   s>     M  ""$"	         returnc                    | j          S Nr5   r9   s    r:   __bool__zRange.__bool__s   s    :~r<   c                    | j         S z$A synonym for the 'empty' attribute.r@   rA   s    r:   isemptyzRange.isemptyv        zr<   c                    | j         S rD   r@   rA   s    r:   is_emptyzRange.is_empty|   rF   r<   c                $    | j         d         dk    S )z,Return True if the lower bound is inclusive.r   [r3   rA   s    r:   	lower_inczRange.lower_inc        {1~$$r<   c                $    | j          o| j        du S )zKReturn True if this range is non-empty and lower bound is
        infinite.N)r5   r/   rA   s    r:   	lower_infzRange.lower_inf       
 :~4$*"44r<   c                $    | j         d         dk    S )z,Return True if the upper bound is inclusive.r   ]rK   rA   s    r:   	upper_inczRange.upper_inc   rM   r<   c                $    | j          o| j        du S )zOReturn True if this range is non-empty and the upper bound is
        infinite.N)r5   r0   rA   s    r:   	upper_infzRange.upper_inf   rP   r<   AbstractSingleRange[_T]c                    t                      S r?   )AbstractSingleRangerA   s    r:   __sa_type_engine__zRange.__sa_type_engine__   s    "$$$r<   valuer&   c                z   | j         rdS | j        0| j        du p&| j        d         dk    r|| j        k     n
|| j        k    S | j        '| j        d         dk    r|| j        k    n
|| j        k    S | j        d         dk    r|| j        k    n
|| j        k    o&| j        d         dk    r|| j        k     n
|| j        k    S )z3Return True if this range contains the given value.FNr   )r   ()r5   r/   r0   r3   r9   rZ   s     r:   _contains_valuezRange._contains_value   s     : 	5::% ;q>S(( 
""dj( : ;q>S(( 
""dj( {1~$$ DJ$*$
 {1~$$ DJ$*$	
r<   r   c                f   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          S dS )uA   Determine the “step” for this range, if it is a discrete one.r   N)days)
isinstancer/   intr0   r   r   r   rA   s    r:   _get_discrete_stepzRange._get_discrete_step   s     dj#&& 	*TZ*E*E 	1
H-- 		J2
 2
 		
 4
D)) 	Z
D-I-I 	!$$$$4r<   value1bound1strvalue2bound2only_valuesrc   c                   |dv }|dv }||cxu rn n||k    rdS |rdndS ||rdndS ||rdndS ||k    r||k    rdS |dv }|dv }	|                                  }
|
*|r
|s||
z  }d}n	|r||
z  }d}|r
|	s||
z  }d}	n	|	r||
z  }d}	||k     rdS ||k    rdS |rdS |r|	rdS |s|	s||k    rdS |rdndS |s|rdndS |	s|rdn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.
        >   r]   rJ   Nr   r   >   rJ   rR   TF)rd   )r9   re   rf   rh   ri   rj   value1_is_lower_boundvalue2_is_lower_bound
value1_inc
value2_incsteps              r:   _compare_edgeszRange._compare_edges   s   " !'* 4 &* 4 V########$(===q29rr9^.522A5^-51125 V& 0 01z)
z)
&&(( % '! &dNF!%J 'dNF!&J$ '! &dNF!%J 'dNF!&JF??2f__1 	1  j q 

 
(,AAA1 5=112= 19qqr9 29rr9qr<   otherc                   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 )zCompare this range to the `other` taking into account
        bounds inclusivity, returning ``True`` if they are equal.
        TFr   r   )rb   r-   NotImplementedr5   r/   r3   r0   rr   
r9   rs   slowerslower_bolowerolower_bsuppersupper_boupperoupper_bs
             r:   __eq__zRange.__eq__+  s    
 %'' 	"!!: 	%+ 	4Z5;&&5;q><?;q><? &(CCqH M##FHfhGG1L	
r<   	Range[_T]c                B   | 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    rdS dS )z7Determine whether this range is a contained by `other`.TFr   r   )r5   r/   r3   rr   r0   rv   s
             r:   contained_byzRange.contained_byF  s     : 	4 ; 	5;q><?vxBBQFF5;q><?vxBBQFF5tr<   Union[_T, Range[_T]]c                    t          |t                    r|                    |           S |                     |          S )z.Determine whether this range contains `value`.)rb   r-   r   r_   r^   s     r:   containszRange.containsc  s>     eU## 	/%%d+++''...r<   c                   | 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r5   r/   r3   r0   rr   
r9   rs   rw   rx   r{   r|   ry   rz   r}   r~   s
             r:   overlapszRange.overlapsm  s     : 	 	5;q>;q><?<? &(CCqHH##FHfhGG1LL4 &(CCqHH##FHfhGG1LL4ur<   c                    | 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   )r5   r0   r3   r/   rr   )r9   rs   r{   r|   ry   rz   s         r:   strictly_left_ofzRange.strictly_left_of  a     : 	 	5;q><? ""68VXFFJJr<   c                    | 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   )r9   rs   rw   rx   r}   r~   s         r:   strictly_right_ofzRange.strictly_right_of  r   r<   c                    | 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   )r5   r/   r3   rr   )r9   rs   rw   rx   ry   rz   s         r:   not_extend_left_ofzRange.not_extend_left_of  a     : 	 	5;q><? ""68VXFF!KKr<   c                    | 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   )r5   r0   r3   rr   )r9   rs   r{   r|   r}   r~   s         r:   not_extend_right_ofzRange.not_extend_right_of  r   r<   c                p   |                      ||||d          }|dk    rH|                                 }|dS |dk    r|dk    r	|||z
  k    S ||k    S |dk    r||k    S |||z
  k    S |dk    rH|dk    r|dk    s|dk    r|d	k    r|                                 }|dS |dk    r|dk    p|dk    o|d	k    S dS )
zTDetermine whether an upper bound is immediately successive to a
        lower bound.Trl   NFrR   rJ   r   r\   r]   )rr   rd   )r9   re   rf   rh   ri   resrq   s          r:   _upper_edge_adjacent_to_lowerz#Range._upper_edge_adjacent_to_lower  s    !!&&&&$GG"99**,,D|u}}S==!Vd]22!V++S==!V++!Vd]22AXX #cMMS==cMM..00#4# "cM"S= "cM	 5r<   c                "   | j         s|j         rdS | j        }| j        d         }| j        }| j        d         }|j        }|j        d         }|j        }|j        d         }	|                     ||||          p|                     ||	||          S )z8Determine whether this range is adjacent to the `other`.Fr   r   )r5   r/   r3   r0   r   r   s
             r:   adjacent_tozRange.adjacent_to  s     : 	 	5;q>;q><?<?11Hfh
 
 
//Hfh
 
	
r<   c           	        | j         r|S |j         r| S |                     |          s$|                     |          st          d          | j        }| j        d         }| j        }| j        d         }|j        }|j        d         }|j        }|j        d         }	|                     ||||          dk     r|}
|}n|}
|}|                     ||||	          dk    r|}|}n|}|	}t          |
|t          t          ||z                       S )zCompute 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   rK   )r5   r   r   
ValueErrorr/   r3   r0   rr   r-   r	   r2   r9   rs   rw   rx   r{   r|   ry   rz   r}   r~   rlowerrlower_brupperrupper_bs                 r:   unionzRange.union  sC    : 	L; 	K}}U## 	D,<,<U,C,C 	-  
 ;q>;q><?<?vxBBQFFFHHFHvxBBQFFFHHFHF4X5H#I#I
 
 
 	
r<   c                ,    |                      |          S r?   )r   r9   rs   s     r:   __add__zRange.__add__@  s    zz%   r<   c           	     (   | 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          S |
dk    rx|dk    rr|dk    rl|dk    rdnd	}|dk    r4|d	k    r.|                     ||||          dk    rt          ddd          S t          ||t          t          ||z             
          S |
dk    rx|dk    rr|dk    rl|	d	k    rdnd}|dk    r4|d	k    r.|                     ||||          dk    rt          ddd          S t          ||t          t          ||z             
          S J d|  d|             )zCompute 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@   rJ   r\   rR   rK   r]   FzUnhandled case computing z - )	r5   r/   r3   r0   rr   r   r-   r	   r2   )r9   rs   rw   rx   r{   r|   ry   rz   r}   r~   sl_vs_olsu_vs_ousl_vs_ousu_vs_olr   r   s                   r:   
differencezRange.differenceC  s    : 	 	K;q>;q><?<?&&vxJJ&&vxJJa<<HqLLG   &&vxJJ&&vxJJ a<<8a<<K q==X]]t40000 q==X]]x1}}&#ooss3HCOO''&(KK  T4t4444X-@AA    q==X]]x1}}&#ooss3HCOO''&(KK  T4t4444X-@AA    	CB$BB5BBBBBr<   c                ,    |                      |          S r?   )r   r   s     r:   __sub__zRange.__sub__  s    u%%%r<   c           	        | j         s|j         s|                     |          st          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          ||z                       S )zdCompute the intersection of this range with the `other`.

        .. versionadded:: 2.0.10

        NTr@   r   r   rK   )	r5   r   r-   r/   r3   r0   rr   r	   r2   r   s                 r:   intersectionzRange.intersection  s     : 	1 	1DMM%,@,@ 	1t40000;q>;q><?<?vxBBQFFFHHFHvxBBQFFFHHFHX%899
 
 
 	
r<   c                ,    |                      |          S r?   )r   r   s     r:   __mul__zRange.__mul__  s      '''r<   c                *    |                                  S r?   )
_stringifyrA   s    r:   __str__zRange.__str__  s       r<   c                    | j         rdS | j        | j        }}|dn|}|dn|}t          d| j                  \  }}| | d| | S )Nr5    zTuple[str, str],)r5   r/   r0   r	   r3   )r9   lrb0b1s        r:   r   zRange._stringify  sl    : 	7z4:1)BB)BB'55B!a!!!!R!!!r<    )NN)r/   r.   r0   r.   r3   r2   r5   r4   )r=   r4   )r=   rV   )rZ   r&   r=   r4   )r=   r   )F)re   r.   rf   rg   rh   r.   ri   rg   rj   r4   r=   rc   )rs   r   r=   r4   )rs   r   r=   r4   )rZ   r   r=   r4   )
re   r.   rf   rg   rh   r.   ri   rg   r=   r4   )rs   r   r=   r   )r=   rg   )0__name__
__module____qualname____doc__r/   __annotations__r0   r   dataclassesfieldr3   r5   	dc_kwonlyr!   r;   rB   propertyrE   rH   rL   rO   rS   rU   rY   r_   rd   rr   r   r   r   __contains__r   r   
__lshift__r   
__rshift__r   r   r   r   r   r   r   r   r   r   r   r   r   r<   r:   r-   r-   ;   s         * EE D/k/======='k'66666666/k/JJJ	JJJJJJ'k'CCCCCCCCC  #'"&	
 #'	 	 	 	 	 	$       X
    X
 % % % X%
 5 5 5 X5 % % % X%
 5 5 5 X5 % % % X%
 
 
 
<   4 "W W W W Wr
 
 
 
6   :/ / / / L   @K K K K "JK K K K #JL L L LL L L L- - - -^
 
 
 
,,
 ,
 ,
 ,
\! ! ! !JC JC JC JCX& & & &$
 $
 $
 $
L( ( ( (! ! ! !
" 
" 
" 
" 
" 
"r<   r-   c                  *    e Zd ZdZe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                    t                      S r?   )AbstractMultiRangerA   s    r:   rY   zMultiRange.__sa_type_engine__  s    !###r<   N)r=   r   )r   r   r   r   r   rY   r   r<   r:   r   r     s>         ( $ $ $ X$ $ $r<   r   c                       e Zd ZdZdZdZedd	            Zedd            Zd fdZ G d dej	        e
e                            Z xZS )AbstractRangez0Base class for single and multi Range SQL types.Tcls	Type[_TE]kwr   r=   r$   c                    d S r?   r   r9   r   r   s      r:   adaptzAbstractRange.adapt  s    7:sr<   Type[TypeEngineMixin]TypeEngine[Any]c                    d S r?   r   r   s      r:   r   zAbstractRange.adapt  s	     #r<   -Type[Union[TypeEngine[Any], TypeEngineMixin]]c                    t          |t          t          f          r5|| 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   )r9   r   r   
visit_namer   s       r:   r   zAbstractRange.adapt  s     s46LMNN	&4>)) ,J4(((dn%!:.     77==%%%r<   c                  r    e Zd ZdZddZddZdd	Zdd
ZeZddZ	e	Z
ddZddZddZddZddZddZdS ) AbstractRange.comparator_factoryz-Define comparison operations for range types.rs   r   r   r=   ColumnElement[bool]c                B    | 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   )r9   rs   r   s      r:   r   z)AbstractRange.comparator_factory.contains  s     9$$Xu555r<   c                B    | j                             t          |          S )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            )r   r   r   r   s     r:   r   z-AbstractRange.comparator_factory.contained_by#  s     9$$\5999r<   c                B    | j                             t          |          S )zBoolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            )r   r   r   r   s     r:   r   z)AbstractRange.comparator_factory.overlaps)  s     9$$We444r<   c                B    | j                             t          |          S )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            )r   r   r   r   s     r:   r   z1AbstractRange.comparator_factory.strictly_left_of/  s     9$$%5u===r<   c                B    | j                             t          |          S )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            )r   r   r   r   s     r:   r   z2AbstractRange.comparator_factory.strictly_right_of7  s     9$$%6>>>r<   c                B    | j                             t          |          S )zBoolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            )r   r   r   r   s     r:   r   z4AbstractRange.comparator_factory.not_extend_right_of?  s     9$$%8%@@@r<   c                B    | j                             t          |          S )zBoolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            )r   r   r   r   s     r:   r   z3AbstractRange.comparator_factory.not_extend_left_ofE  s     9$$%7???r<   c                B    | 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   s     r:   r   z,AbstractRange.comparator_factory.adjacent_toK  s     9$$[%888r<   c                L    | j                             t          j        |          S zRange expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )r   r   r   addr   s     r:   r   z&AbstractRange.comparator_factory.unionQ      
 9$$Y]E:::r<   c                L    | j                             t          j        |          S r   )r   r   r   subr   s     r:   r   z+AbstractRange.comparator_factory.differenceX  r   r<   ColumnElement[Range[_T]]c                L    | j                             t          j        |          S )zRange expression. Returns the intersection of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )r   r   r   mulr   s     r:   r   z-AbstractRange.comparator_factory.intersection_  r   r<   N)rs   r   r   r   r=   r   )rs   r   r=   r   )rs   r   r=   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r<   r:   comparator_factoryr     s       ;;	6 	6 	6 	6	: 	: 	: 	:	5 	5 	5 	5	> 	> 	> 	> &
	? 	? 	? 	? '
	A 	A 	A 	A	@ 	@ 	@ 	@	9 	9 	9 	9	; 	; 	; 	;	; 	; 	; 	;	; 	; 	; 	; 	; 	;r<   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__)r   s   @r:   r   r     s        ::L::: X:   X &  &  &  &  &  &DN; N; N; N; N;Z25:> N; N; N; N; N; N; N;r<   r   c                      e Zd ZdZdZd	dZdS )
rX   zBase 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>`_

    TrZ   
Range[Any]r=   r   c                   |j         |j         n|j        }t          |t                    r+t	          |          rt                      S t                      S t          |t          t          f          rt                      S t          |t                    r#|j        st                      nt                      S t          |t                    rt                      S t           j        S r?   )r/   r0   rb   rc   	_is_int32	INT4RANGE	INT8RANGEr   floatNUMRANGEr   tzinfoTSRANGE	TSTZRANGEr   	DATERANGEsqltypesNULLTYPE)r9   rZ   specs      r:   _resolve_for_literalz(AbstractSingleRange._resolve_for_literalt  s    #k5u{{5;dC   	%  # {{" {{"w.// 	%::h'' 	%$(K@7999Y[[@d## 	%;; $$r<   N)rZ   r   r=   r   r   r   r   r   r   r  r   r<   r:   rX   rX   g  s9          L% % % % % %r<   rX   c                      e Zd ZdZdS )r   zQMarker for AbstractSingleRange that will apply a subclass-specific
    adaptationNr   r   r   r   r   r<   r:   r   r                r<   r   c                      e Zd ZdZdZd	dZdS )
r   zBase for PostgreSQL MULTIRANGE types.

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

    TrZ   Sequence[Range[Any]]r=   r   c                   |st           j        S |d         }|j        |j        n|j        }t	          |t
                    r5t          d |D                       rt                      S t                      S t	          |t          t          f          rt                      S t	          |t                    r#|j        st                      nt                      S t	          |t                     rt#                      S t           j        S )Nr   c              3  4   K   | ]}t          |          V  d S r?   )r   ).0r   s     r:   	<genexpr>z:AbstractMultiRange._resolve_for_literal.<locals>.<genexpr>  s(      //A9Q<<//////r<   )r	  r
  r/   r0   rb   rc   allINT4MULTIRANGEINT8MULTIRANGEr   r  NUMMULTIRANGEr   r  TSMULTIRANGETSTZMULTIRANGEr   DATEMULTIRANGE)r9   rZ   firstr  s       r:   r  z'AbstractMultiRange._resolve_for_literal  s     	%$$a#k5u{{5;dC   	% /////// (%'''%'''w.// 	% ??"h'' 	%)-J<>>>.:J:JJd## 	%!### $$r<   N)rZ   r  r=   r   r  r   r<   r:   r   r     s9          L% % % % % %r<   r   c                      e Zd ZdZdS )r   zPMarker for AbstractMultiRange that will apply a subclass-specific
    adaptationNr  r   r<   r:   r   r     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   r   r<   r:   r  r            22 NNNr<   r  c                      e Zd ZdZd ZdS )r  z(Represent the PostgreSQL INT8RANGE type.Nr!  r   r<   r:   r  r    r"  r<   r  c                      e Zd ZdZd ZdS )r  z'Represent the PostgreSQL NUMRANGE type.Nr!  r   r<   r:   r  r    s        11NNNr<   r  c                      e Zd ZdZd ZdS )r  z(Represent the PostgreSQL DATERANGE type.Nr!  r   r<   r:   r  r    r"  r<   r  c                      e Zd ZdZd ZdS )r  &Represent the PostgreSQL TSRANGE type.Nr!  r   r<   r:   r  r    s        00NNNr<   r  c                      e Zd ZdZd ZdS )r  (Represent the PostgreSQL TSTZRANGE type.Nr!  r   r<   r:   r  r    r"  r<   r  c                      e Zd ZdZd ZdS )r  z-Represent the PostgreSQL INT4MULTIRANGE type.Nr!  r   r<   r:   r  r            77%NNNr<   r  c                      e Zd ZdZd ZdS )r  z-Represent the PostgreSQL INT8MULTIRANGE type.Nr!  r   r<   r:   r  r    r+  r<   r  c                      e Zd ZdZd ZdS )r  z,Represent the PostgreSQL NUMMULTIRANGE type.Nr!  r   r<   r:   r  r    s        66$NNNr<   r  c                      e Zd ZdZd ZdS )r  z-Represent the PostgreSQL DATEMULTIRANGE type.Nr!  r   r<   r:   r  r    r+  r<   r  c                      e Zd ZdZd ZdS )r  r'  Nr!  r   r<   r:   r  r    s        00#NNNr<   r  c                      e Zd ZdZd ZdS )r  r)  Nr!  r   r<   r:   r  r    s        22%NNNr<   r  ii   r   
Range[int]r=   r4   c                    | j         d u st          | j         cxk    o
t          k    nc o'| j        d u pt          | j        cxk    o
t          k    nc S r?   )r/   _min_int_32_max_int_32r0   )r   s    r:   r   r     sd    GtOD{agDDDDDDDD 	4@;!'@@@@[@@@@r<   r   )r   r1  r=   r4   )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&   r2   dc_slotsr   	dataclassr-   r   r   rX   r   r   r   rc   r  r  r  r  r  r  r  r  r  r  r  r  r4  r3  r   r   r<   r:   <module>r?     s   # " " " " "                                                                                                           " " " " " " # # # # # #       ) ) ) ) ) ) * * * * * *       ' ' ' ' ' ' ( ( ( ( ( ( ! ! ! ! ! !       & & & & & &       " " " " " " 0------######//////WT,- HD!IIHI //d/h//L
" L
" L
" L
" L
"GBK L
" L
" 0/L
"^$ $ $ $ $eBi $ $ $4; ; ; ; ;H'+ ; ; ;D %  %  %  %  %-b	2  %  %  %F    1"5   
!% !% !% !% !%xb	':; !% !% !%H    /3   
! ! ! ! !#C( ! ! !! ! ! ! !#C( ! ! !         "7+      ! ! ! ! !#D) ! ! !    !(+   ! ! ! ! !#H- ! ! !& & & & &', & & && & & & &', & & &% % % % %&w/ % % %& & & & &'- & & &$ $ $ $ $%h/ $ $ $& & & & &'1 & & &      r<   