tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

Implement dsn support for connect() method #170

Open artembo opened 4 years ago

artembo commented 4 years ago

Pep 249 suggests a constructor method of Connection objects .connect()

It takes the following parameters as arguments:

Parameter Meaning
dsn Data source name as string
user User name as string (optional)
password Password as string (optional)
host Hostname (optional)
database Database name (optional)
kwargs It is not from the standard but we use it for the method signature scalability.

Implement dsn parser utility to pass the settings to the Connection init by only one line.

The pattern can be used ([[[username[:password]@]host:]port)