
    h                     ,    d dl mZ  G d d          ZdS )    )dbc                   N    e Zd Zedededefd            Zedefd            ZdS )queryidentificacionimagen_base64returnc                    K   d}	 t          j        || |           d {V  dS # t          $ r}t          d|           Y d }~dS d }~ww xY w)Nz
            INSERT INTO FACETEC.imagenes (identificacion, imagen_base64)
            VALUES ($1, $2)
            ON CONFLICT (identificacion)
            DO UPDATE SET imagen_base64 = EXCLUDED.imagen_base64, fecha_registro = CURRENT_TIMESTAMP;
        Tu   ❌ Error al insertar imagen:F)r   execute	Exceptionprint)r   r   sqles       [/Users/marcatoma/Documents/GitHub/facetec/blazor_facetec/backend/connection/querys/query.pyinsertar_imagenzquery.insertar_imagen   sz      	*S.-@@@@@@@@@4 	 	 	1155555555	s   $ 
A	AA	c                 @   K   d}t          j        ||            d {V S )Nz
            SELECT * FROM FACETEC.imagenes
            WHERE identificacion = $1
            ORDER BY fecha_registro DESC
            LIMIT 1;
        )r   	fetch_one)r   r   s     r   !obtener_imagen_por_identificacionz'query.obtener_imagen_por_identificacion   s3       \#~666666666    N)__name__
__module____qualname__staticmethodstrboolr   r    r   r   r   r      sn        c # $    \ 7 7 7 7 \7 7 7r   r   N)connection.connectionr   r   r   r   r   <module>r      sI    $ $ $ $ $ $7 7 7 7 7 7 7 7 7 7r   