mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
5885e6ce12
* Move host regex out of url_regex and inject it afterwards * Add new host regex with cache variable * Move url regex strings to separate variables * Add new postgres url regex with cache variable * Add tests for failed postgres dns with many hosts * Add new parts type: HostParts * Add new slot 'hosts' to PostgreDsn and update init with it * Add validators to PostgreDsn class. When multiple hosts are found, all hosts will be store in hosts list. To keep back compatibility single host will return all data as previously in main params. * Add more detail tests to check multi host postgres dsn with attributes * Add changes description in the file * Delete usless comments to regex strings because of varable names * Add missing docstring to postgres_url_regex function * Update postgre dsn with AnyUrl.slots * Update AnyUrl.validate_parts to support disabling port validation * Reuse _host_regex in postgres_url_regex * Fix typing * Delete not needed group in regex * Improve tests by adding parametrize to postgreDsn tests * Update postgres regex to not validate hosts in it * Delete duplicated code and use shared validate method * Move multi host methods into separate class and inherit it in the postgreDsn * fix tests * tweaks and re order code * add a note to docs Co-authored-by: Samuel Colvin <s@muelcolvin.com>