U
    d/e                     @   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d	d
dddddddddgZdS )   )
Connection)
WarningError	DataErrorDatabaseErrorProgrammingErrorIntegrityErrorInterfaceErrorInternalErrorNotSupportedErrorOperationalError   )definesz2.0ZpyformatNc              	   K   s4   | dkr|dkrt dtf | |||||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   kwargs r   D/tmp/pip-unpacked-wheel-mds_o03w/clickhouse_driver/dbapi/__init__.pyconnect   s    # r   r   r   r   r   r   r   r	   r
   r   r   )
connectionr   errorsr   r   r   r   r   r   r	   r
   r   r    r   ZapilevelZthreadsafetyZ
paramstyleZDEFAULT_USERZDEFAULT_PASSWORDZDEFAULT_PORTZDEFAULT_DATABASEr   __all__r   r   r   r   <module>   s.   0  
+       