o
    ED©iß  ã                   @   s~   d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
mZmZ ddlmZ dZdZdZddejejejejfdd	„Zg d
¢ZdS )é   )Ú
Connection)
ÚWarningÚErrorÚ	DataErrorÚDatabaseErrorÚProgrammingErrorÚIntegrityErrorÚInterfaceErrorÚInternalErrorÚNotSupportedErrorÚOperationalErroré   )Údefinesz2.0ÚpyformatNc              	   K   s4   | du r|du rt dƒ‚td| |||||dœ|¤ŽS )a1  
    Create a new database connection.

    The connection can be specified via DSN:

        ``conn = connect("clickhouse://localhost/test?param1=value1&...")``

    or using database and credentials arguments:

        ``conn = connect(database="test", user="default", password="default",
        host="localhost", **kwargs)``

    The basic connection parameters are:

    - *host*: host with running ClickHouse server.
    - *port*: port ClickHouse server is bound to.
    - *database*: database connect to.
    - *user*: database user.
    - *password*: user's password.

    See defaults in :data:`~clickhouse_driver.connection.Connection`
    constructor.

    DSN or host is required.

    Any other keyword parameter will be passed to the underlying Connection
    class.

    :return: a new connection.
    Nzhost or dsn is required)ÚdsnÚuserÚpasswordÚhostÚportÚdatabase© )Ú
ValueErrorr   )r   r   r   r   r   r   Úkwargsr   r   úY/var/www/Datamplify/venv/lib/python3.10/site-packages/clickhouse_driver/dbapi/__init__.pyÚconnect   s   #ÿÿr   )r   r   r   r   r   r   r   r	   r
   r   r   )Ú
connectionr   Úerrorsr   r   r   r   r   r   r	   r
   r   r   Ú r   ÚapilevelÚthreadsafetyÚ
paramstyleÚDEFAULT_USERÚDEFAULT_PASSWORDÚDEFAULT_PORTÚDEFAULT_DATABASEr   Ú__all__r   r   r   r   Ú<module>   s    0
þ*