
    ؄_                     "   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dS )   )types)	INT4RANGE	INT8RANGENUMRANGEc                   B    e Zd ZdZ G d dej        j                  ZdS )RangeOperatorsaI  
    This mixin provides functionality for the Range Operators
    listed in Table 9-44 of the `postgres 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.

    __ http://www.postgresql.org/docs/devel/static/functions-range.html

    No extra support is provided for the Range Functions listed in
    Table 9-45 of the postgres 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                            dd          |          S )z<Boolean expression. Returns true if two ranges are not equalNz<>Tis_comparison)superr   comparator_factory__ne__exprop)selfother	__class__s     j/var/www/book.euthymeo.com/html/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/ranges.pyr   z(RangeOperators.comparator_factory.__ne__    sT    }^>EELL   >ty||D|==eDDD    c                 L     | j                             dd          |          S )zBoolean expression. Returns true if the right hand operand,
            which can be an element or a range, is contained within the
            column.
            z@>Tr   r   r   )r   r   kws      r   containsz*RangeOperators.comparator_factory.contains)   s&    
 :49<<D<99%@@@r   c                 L     | 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_by0   &     :49<<D<99%@@@r   c                 L     | 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.overlaps6   r   r   c                 L     | 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                 L     | 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_ofD   r   r   c                 L     | 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_ofL   r   r   c                 L     | 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_ofR   r   r   c                 L     | 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_toX   s&     ;49<<T<::5AAAr   c                 H     | j                             d          |          S )zRange expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contigous.
            +r   r   s     r   __add__z)RangeOperators.comparator_factory.__add__^   s"    
 %49<<$$U+++r   )__name__
__module____qualname____doc__r   r   r   r!   r#   
__lshift__r%   
__rshift__r'   r)   r+   r.   __classcell__)r   s   @r   r   r
      s        ;;	E 	E 	E 	E 	E	A 	A 	A	A 	A 	A	A 	A 	A	A 	A 	A &
	A 	A 	A '
	A 	A 	A	A 	A 	A	B 	B 	B	, 	, 	, 	, 	, 	, 	,r   r   N)r/   r0   r1   r2   sqltypesConcatenable
Comparatorr    r   r   r   r      sX         F, F, F, F, F,X2= F, F, F, F, F,r   r   c                       e Zd ZdZd ZdS )r   z(Represent the PostgreSQL INT4RANGE type.Nr/   r0   r1   r2   __visit_name__r9   r   r   r   r   f           22 NNNr   r   c                       e Zd ZdZd ZdS )r   z(Represent the PostgreSQL INT8RANGE type.Nr;   r9   r   r   r   r   l   r=   r   r   c                       e Zd ZdZd ZdS )r   z'Represent the PostgreSQL NUMRANGE type.Nr;   r9   r   r   r   r   r   s        11NNNr   r   c                       e Zd ZdZd ZdS )	DATERANGEz(Represent the PostgreSQL DATERANGE type.Nr;   r9   r   r   rA   rA   x   r=   r   rA   c                       e Zd ZdZd ZdS )TSRANGEz&Represent the PostgreSQL TSRANGE type.Nr;   r9   r   r   rC   rC   ~   s        00NNNr   rC   c                       e Zd ZdZd ZdS )	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      sw   " ! ! ! ! ! 1V, V, V, V, V,V V, V, V,r! ! ! ! ! 3 ! ! !! ! ! ! ! 3 ! ! !         ~x2      ! ! ! ! ! 3 ! ! !    nh1   ! ! ! ! ! 3 ! ! ! ! !r   