o
    [h                     @   s   d dl mZ dZG dd deZG dd deejZG dd deejZG d	d
 d
eejZ	G dd deejZ
G dd deejZG dd deejZdS )   )types)	INT4RANGE	INT8RANGENUMRANGEc                   @   s$   e Zd ZdZG d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                       sp   e Zd ZdZ fd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  ZS )z!RangeOperators.comparator_factoryz-Define comparison operations for range types.c                    s.   |du rt tj| |S | jjddd|S )z<Boolean expression. Returns true if two ranges are not equalNz<>TZis_comparison)superr   comparator_factory__ne__expropselfother	__class__ /home/ubuntu/experiments/live_experiments/Pythonexperiments/Otree/venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/ranges.pyr
       s
   z(RangeOperators.comparator_factory.__ne__c                 K      | j jd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   kwr   r   r   contains)   s   z*RangeOperators.comparator_factory.containsc                 C   r   )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            z<@Tr   r   r   r   r   r   contained_by0      z.RangeOperators.comparator_factory.contained_byc                 C   r   )zBoolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            z&&Tr   r   r   r   r   r   overlaps6   r   z*RangeOperators.comparator_factory.overlapsc                 C   r   )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            z<<Tr   r   r   r   r   r   strictly_left_of<   r   z2RangeOperators.comparator_factory.strictly_left_ofc                 C   r   )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            z>>Tr   r   r   r   r   r   strictly_right_ofD   r   z3RangeOperators.comparator_factory.strictly_right_ofc                 C   r   )zBoolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            z&<Tr   r   r   r   r   r   not_extend_right_ofL   r   z5RangeOperators.comparator_factory.not_extend_right_ofc                 C   r   )zBoolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            z&>Tr   r   r   r   r   r   not_extend_left_ofR   r   z4RangeOperators.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.
            z-|-Tr   r   r   r   r   r   adjacent_toX   r   z-RangeOperators.comparator_factory.adjacent_toc                 C   s   | 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   r   r   r   __add__^   s   z)RangeOperators.comparator_factory.__add__)__name__
__module____qualname____doc__r
   r   r   r   r   
__lshift__r   
__rshift__r   r   r   r!   __classcell__r   r   r   r   r	      s    	r	   N)r"   r#   r$   r%   sqltypesZConcatenableZ
Comparatorr	   r   r   r   r   r      s    r   c                   @      e Zd ZdZd ZdS )r   z(Represent the PostgreSQL INT4RANGE type.Nr"   r#   r$   r%   Z__visit_name__r   r   r   r   r   f       r   c                   @   r*   )r   z(Represent the PostgreSQL INT8RANGE type.Nr+   r   r   r   r   r   l   r,   r   c                   @   r*   )r   z'Represent the PostgreSQL NUMRANGE type.Nr+   r   r   r   r   r   r   r,   r   c                   @   r*   )	DATERANGEz(Represent the PostgreSQL DATERANGE type.Nr+   r   r   r   r   r-   x   r,   r-   c                   @   r*   )TSRANGEz&Represent the PostgreSQL TSRANGE type.Nr+   r   r   r   r   r.   ~   r,   r.   c                   @   r*   )	TSTZRANGEz(Represent the PostgreSQL TSTZRANGE type.Nr+   r   r   r   r   r/      r,   r/   N) r   r)   __all__objectr   Z
TypeEnginer   r   r   r-   r.   r/   r   r   r   r   <module>   s   Y