
    +h                     2   d dl mZ dZ G d de      Z G d deej                        Z G d deej                        Z G d	 d
eej                        Z	 G d deej                        Z
 G d deej                        Z G d deej                        Zy)   )types)	INT4RANGE	INT8RANGENUMRANGEc                   N    e Zd ZdZ G d dej
                  j                        Zy)RangeOperatorsan  
    This mixin provides functionality for the Range Operators
    listed in the Range Operators table of the `PostgreSQL documentation`__
    for Range Functions and Operators. It is used by all the range types
    provided in the ``postgres`` dialect and can likely be used for
    any range types you create yourself.

    __ https://www.postgresql.org/docs/current/static/functions-range.html

    No extra support is provided for the Range Functions listed in the Range
    Functions table of the PostgreSQL documentation. For these, the normal
    :func:`~sqlalchemy.sql.expression.func` object should be used.

    c                   `     e Zd ZdZ fdZd Zd Zd Zd ZeZ	d Z
e
Zd Zd	 Zd
 Zd Z xZS )!RangeOperators.comparator_factoryz-Define comparison operations for range types.c                     |t         t        j                  |   |      S  | j                  j                  dd      |      S )z<Boolean expression. Returns true if two ranges are not equalz<>Tis_comparison)superr   comparator_factory__ne__exprop)selfother	__class__s     X/var/www/html/venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/ranges.pyr   z(RangeOperators.comparator_factory.__ne__    sE    }^>>L  >tyy||D|=eDD    c                 H     | j                   j                  dd      |      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.
            z@>Tr   r   r   )r   r   kws      r   containsz*RangeOperators.comparator_factory.contains)   s"     :499<<D<9%@@r   c                 H     | j                   j                  dd      |      S )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            z<@Tr   r   r   r   s     r   contained_byz.RangeOperators.comparator_factory.contained_by3   "     :499<<D<9%@@r   c                 H     | j                   j                  dd      |      S )zBoolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            z&&Tr   r   r   s     r   overlapsz*RangeOperators.comparator_factory.overlaps9   r   r   c                 H     | j                   j                  dd      |      S )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            z<<Tr   r   r   s     r   strictly_left_ofz2RangeOperators.comparator_factory.strictly_left_of?   r   r   c                 H     | j                   j                  dd      |      S )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            z>>Tr   r   r   s     r   strictly_right_ofz3RangeOperators.comparator_factory.strictly_right_ofG   r   r   c                 H     | j                   j                  dd      |      S )zBoolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            z&<Tr   r   r   s     r   not_extend_right_ofz5RangeOperators.comparator_factory.not_extend_right_ofO   r   r   c                 H     | j                   j                  dd      |      S )zBoolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            z&>Tr   r   r   s     r   not_extend_left_ofz4RangeOperators.comparator_factory.not_extend_left_ofU   r   r   c                 H     | j                   j                  dd      |      S )z}Boolean expression. Returns true if the range in the column
            is adjacent to the range in the operand.
            z-|-Tr   r   r   s     r   adjacent_toz-RangeOperators.comparator_factory.adjacent_to[   s"     ;499<<T<:5AAr   c                 D     | j                   j                  d      |      S )zRange expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            +r   r   s     r   __add__z)RangeOperators.comparator_factory.__add__a   s    
 %499<<$U++r   )__name__
__module____qualname____doc__r   r   r   r!   r#   
__lshift__r%   
__rshift__r'   r)   r+   r.   __classcell__)r   s   @r   r   r
      sO    ;	E	A	A	A	A &
	A '
	A	A	B	,r   r   N)r/   r0   r1   r2   sqltypesConcatenable
Comparatorr    r   r   r   r      s!    I,X22== I,r   r   c                       e Zd ZdZd Zy)r   z(Represent the PostgreSQL INT4RANGE type.Nr/   r0   r1   r2   __visit_name__r9   r   r   r   r   i   
    2 Nr   r   c                       e Zd ZdZd Zy)r   z(Represent the PostgreSQL INT8RANGE type.Nr;   r9   r   r   r   r   o   r=   r   r   c                       e Zd ZdZd Zy)r   z'Represent the PostgreSQL NUMRANGE type.Nr;   r9   r   r   r   r   u   s
    1Nr   r   c                       e Zd ZdZd Zy)	DATERANGEz(Represent the PostgreSQL DATERANGE type.Nr;   r9   r   r   rA   rA   {   r=   r   rA   c                       e Zd ZdZd Zy)TSRANGEz&Represent the PostgreSQL TSRANGE type.Nr;   r9   r   r   rC   rC      s
    0Nr   rC   c                       e Zd ZdZd Zy)	TSTZRANGEz(Represent the PostgreSQL TSTZRANGE type.Nr;   r9   r   r   rE   rE      r=   r   rE   N) r   r6   __all__objectr   
TypeEnginer   r   r   rA   rC   rE   r9   r   r   <module>rJ      s    " 1Y,V Y,x! 3 3 !! 3 3 ! ~x22  ! 3 3 !nh11 ! 3 3 !r   