
    ؄_c                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  G d d	ej	                  Z
 G d
 de          Z G d de          ZeZdS )a  
.. dialect:: postgresql+pypostgresql
    :name: py-postgresql
    :dbapi: pypostgresql
    :connectstring: postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]
    :url: http://python.projects.pgfoundry.org/

.. note::

    The pypostgresql dialect is **not tested as part of SQLAlchemy's continuous
    integration** and may have unresolved issues.  The recommended PostgreSQL
    driver is psycopg2.


   )	PGDialect)PGExecutionContext   )
processors)types)utilc                       e Zd Zd Zd ZdS )	PGNumericc                     t           j        S N)r   to_str)selfdialects     p/var/www/book.euthymeo.com/html/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/pypostgresql.pybind_processorzPGNumeric.bind_processor   s          c                 ,    | j         rd S t          j        S r   )	asdecimalr   to_float)r   r   coltypes      r   result_processorzPGNumeric.result_processor"   s    > 	'4&&r   N)__name__
__module____qualname__r   r    r   r   r
   r
      s2        ! ! !' ' ' ' 'r   r
   c                       e Zd ZdS )PGExecutionContext_pypostgresqlN)r   r   r   r   r   r   r   r   )   s        Dr   r   c                       e Zd ZdZdZdZdZdZdZdZ	e
Z ej        ej        ej        eej        ej        i          Zed             Zg dZej        d             Zd	 Zd
 ZdS )PGDialect_pypostgresqlpypostgresqlTNpyformatFc                     ddl m} |S )N    )dbapi20)postgresql.driverr$   )clsr$   s     r   dbapizPGDialect_pypostgresql.dbapiD   s    ------r   )	ErrorInterfaceErrorDatabaseError	DataErrorOperationalErrorIntegrityErrorInternalErrorProgrammingErrorNotSupportedErrorc                 V      j         i S t           fd j        D                       S )Nc              3   P   K   | ] }t          j        |          j        |fV  !d S r   )getattrr'   r   ).0namer   s     r   	<genexpr>zIPGDialect_pypostgresql.dbapi_exception_translation_map.<locals>.<genexpr>[   sK       
 
 TZ&&/6
 
 
 
 
 
r   )r'   dict_DBAPI_ERROR_NAMES)r   s   `r   dbapi_exception_translation_mapz6PGDialect_pypostgresql.dbapi_exception_translation_mapV   sK    :I 
 
 
 
/
 
 
 
 
 	
r   c                     |                     d          }d|v rt          |d                   |d<   nd|d<   |                    |j                   g |fS )Nuser)usernameporti8  )translate_connect_argsintupdatequery)r   urloptss      r   create_connect_argsz*PGDialect_pypostgresql.create_connect_args`   s_    ))6)::T>>tF|,,DLLDLCIDzr   c                 $    dt          |          v S )Nzconnection is closed)str)r   e
connectioncursors       r   is_disconnectz$PGDialect_pypostgresql.is_disconnecti   s    %Q//r   )r   r   r   driversupports_unicode_statementssupports_unicode_bindsdescription_encodingdefault_paramstylesupports_sane_rowcountsupports_sane_multi_rowcountr   execution_ctx_clsr   update_copyr   colspecssqltypesNumericr
   Floatclassmethodr'   r8   memoized_propertyr9   rD   rJ   r   r   r   r   r   -   s        F"&!# "#( 7tiNHN	
 H   [

 
 
 

 
 
  0 0 0 0 0r   r   N)__doc__baser   r    r   r   rU   r   rV   r
   r   r   r   r   r   r   <module>r]      s            $ $ $ $ $ $       ! ! ! ! ! !      ' ' ' ' '  ' ' '	 	 	 	 	&8 	 	 	=0 =0 =0 =0 =0Y =0 =0 =0@ !r   