U
    ÌZj›  ã                   @   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 )Ú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                       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                    s2   |dkrt tj| ƒ |¡S | jjddd�|ƒS 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__© úh/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/ranges.pyr
       s
    ÿz(RangeOperators.comparator_factory.__ne__c                 K   s   | j jd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   Úkwr   r   r   Úcontains)   s    z*RangeOperators.comparator_factory.containsc                 C   s   | j jddd�|ƒS )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            z<@Tr   r   r   r   r   r   Úcontained_by3   s    z.RangeOperators.comparator_factory.contained_byc                 C   s   | j jddd�|ƒS )z„Boolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            z&&Tr   r   r   r   r   r   Úoverlaps9   s    z*RangeOperators.comparator_factory.overlapsc                 C   s   | j jddd�|ƒS )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?   s    z2RangeOperators.comparator_factory.strictly_left_ofc                 C   s   | j jddd�|ƒS )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            z>>Tr   r   r   r   r   r   Ústrictly_right_ofG   s    z3RangeOperators.comparator_factory.strictly_right_ofc                 C   s   | j jddd�|ƒS )z‡Boolean 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_ofO   s    z5RangeOperators.comparator_factory.not_extend_right_ofc                 C   s   | j jddd�|ƒS )z†Boolean 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_ofU   s    z4RangeOperators.comparator_factory.not_extend_left_ofc                 C   s   | j jd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   r   r   r   Úadjacent_to[   s    z-RangeOperators.comparator_factory.adjacent_toc                 C   s   | j  d¡|ƒ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   r   r   Ú__add__a   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                   @   s   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   i   s   r   c                   @   s   e Zd ZdZd ZdS )r   z(Represent the PostgreSQL INT8RANGE type.Nr(   r   r   r   r   r   o   s   r   c                   @   s   e Zd ZdZd ZdS )r   z'Represent the PostgreSQL NUMRANGE type.Nr(   r   r   r   r   r   u   s   r   c                   @   s   e Zd ZdZd ZdS )Ú	DATERANGEz(Represent the PostgreSQL DATERANGE type.Nr(   r   r   r   r   r)   {   s   r)   c                   @   s   e Zd ZdZd ZdS )ÚTSRANGEz&Represent the PostgreSQL TSRANGE type.Nr(   r   r   r   r   r*   �   s   r*   c                   @   s   e Zd ZdZd ZdS )Ú	TSTZRANGEz(Represent the PostgreSQL TSTZRANGE type.Nr(   r   r   r   r   r+   ‡   s   r+   N)Ú r   r'   Ú__all__Úobjectr   Z
TypeEnginer   r   r   r)   r*   r+   r   r   r   r   Ú<module>   s   \