
    i                     `    d dl mZmZmZmZ ddlmZ ddlmZ ddl	m
Z
  G d de          Zd	S )
    )AnyCallableOptionalUnion   )DbObjectType)BaseMetaClass)DbTypec                      e Zd Zd Zedd            Zedefd            Zedefd            Z	edefd            Z
edefd            Zedefd	            ZddedefdZedee         fd            Zedefd            Zedefd            Zedee         fd            ZdededdfdZedefd            Zedeeef         fd            Zedefd            ZdS )Varc                     | j                                         }| j         j        st          |          dk    r|d         }| j        }d|j         dt          |           dS )Nr   r   z<oracledb.Var of type z with value >)_implget_all_valuesis_arraylen_typenamerepr)selfvaluetyps      \/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/oracledb/var.py__repr__zVar.__repr__'   sa    
))++z" 	s5zzQ!HEjLLLd5kkLLLL    Nc                     |                      |           }||_        |||_        nA|j        j        $t          j        |j        j                  |_        n|j        j        |_        |S N)__new__r   r   metadataobjtyper   
_from_impldbtype)clsimplr   vars       r   r!   zVar._from_impl.   s]    kk#	?CII]".$/0EFFCII,CI
r   returnc                 J    | j         j        r| j         j        S | j         j        S )ag  
        This read-only attribute returns the actual number of elements in the
        variable. This corresponds to the number of elements in a PL/SQL
        index-by table for variables that are created using the method
        :meth:`Cursor.arrayvar()`. For all other variables, this value will be
        identical to the attribute num_elements.
        )r   r   num_elements_in_arraynum_elementsr   s    r   actual_elementszVar.actual_elements:   s'     : 	4:33z&&r   c                     | j         S )zC
        Deprecated. Use property actual_elements instead.
        )r+   r*   s    r   actualElementszVar.actualElementsG   s    
 ##r   c                 $    | j         j        j        S )zv
        This read-only attribute returns the size of the buffer allocated for
        each element in bytes.
        )r   r   buffer_sizer*   s    r   r/   zVar.buffer_sizeN   s     z"..r   c                     | j         S )z@
        Deprecated. Use property buffer_size intead().
        )r/   r*   s    r   
bufferSizezVar.bufferSizeV   s    
 r   c                     | j         j        S )z
        This read-only attribute returns whether null values are converted
        using the supplied ``outconverter``.
        )r   convert_nullsr*   s    r   r3   zVar.convert_nulls]   s     z''r   r   posc                 6    | j                             |          S )a  
        Returns the value at the given position in the variable. For variables
        created using the method :meth:`Cursor.arrayvar()`, the value returned
        will be a list of each of the values in the PL/SQL index-by table. For
        variables bound to DML returning statements, the value returned will
        also be a list corresponding to the returned data for the given
        execution of the statement (as identified by the ``pos`` parameter).
        )r   	get_value)r   r4   s     r   getvaluezVar.getvaluee   s     z##C(((r   c                     | j         j        S )aV  
        This read-only attribute specifies the method used to convert data from
        Python to the Oracle database. The method signature is converter(value)
        and the expected return value is the value to bind to the database. If
        this attribute is *None*, the value is bound directly without any
        conversion.
        )r   inconverterr*   s    r   r9   zVar.inconverterp   s     z%%r   c                     | j         j        S )z
        This read-only attribute returns the number of elements allocated in an
        array, or the number of scalar items that can be fetched into the
        variable or bound to the variable.
        )r   r)   r*   s    r   r)   zVar.num_elements{   s     z&&r   c                     | j         S )z@
        Deprecated. Use property num_elements instead.
        )r)   r*   s    r   numElementszVar.numElements   s    
   r   c                     | j         j        S )aU  
        This read-only attribute specifies the method used to convert data from
        the Oracle database to Python. The method signature is converter(value)
        and the expected return value is the value to return to Python. If this
        attribute is *None*, the value is returned directly without any
        conversion.
        )r   outconverterr*   s    r   r>   zVar.outconverter   s     z&&r   r   c                 <    | j                             ||           dS )zG
        Sets the value at the given position in the variable.
        N)r   	set_value)r   r4   r   s      r   setvaluezVar.setvalue   s"     	
S%(((((r   c                 $    | j         j        j        S )z
        This read-only attribute returns the size of the variable. For strings
        this value is the size in characters. For all others, this is the same
        value as the attribute buffer_size.
        )r   r   max_sizer*   s    r   sizezVar.size   s     z"++r   c                     | j         S )a~  
        This read-only attribute returns the type of the variable. This will be
        an :ref:`Oracle Object Type <dbobjecttype>` if the variable binds
        Oracle objects; otherwise, it will be one of the
        :ref:`database type constants <dbtypes>`.

        Database type constants are now used when the variable is not used for
        binding Oracle objects.
        )r   r*   s    r   typezVar.type   s     zr   c                 4    | j                                         S )a$  
        This read-only attribute returns a copy of the value of all actual
        positions in the variable as a list. This is the equivalent of calling
        getvalue() for each valid position and the length will correspond to
        the value of the actual_elements attribute.
        )r   r   r*   s    r   valuesz
Var.values   s     z((***r   r   )r   )__name__
__module____qualname__r   classmethodr!   propertyintr+   r-   r/   r1   boolr3   r   r7   r   r   r9   r)   r<   r>   rA   rD   r   r
   r   rF   listrH    r   r   r   r   &   s~       M M M 	 	 	 [	 
' 
' 
' 
' X
' $ $ $ $ X$ /S / / / X/  C       X  (t ( ( ( X(	) 	)C 	) 	) 	) 	) 	) &Xh/ & & & X& 'c ' ' ' X' !S ! ! ! X! 'hx0 ' ' ' X')C ) ) ) ) ) ) ,c , , , X, 
eFL01 
 
 
 X
 + + + + X+ + +r   r   )	metaclassN)typingr   r   r   r   dbobjectr   baser	   	base_implr
   r   rQ   r   r   <module>rW      s   @ 2 1 1 1 1 1 1 1 1 1 1 1 " " " " " "            T+ T+ T+ T+ T+M T+ T+ T+ T+ T+ T+r   