Hacked By AnonymousFox
�
�܋f�$ � � � d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ dd lm Z G d
� de
� � Zd� Zd
� Z
d� Zd� Zd� ZdS )a Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
information about a database connection specification.
The URL object is created automatically when
:func:`~sqlalchemy.engine.create_engine` is called with a string
argument; alternatively, the URL is a public-facing construct which can
be used directly and is also accepted directly by ``create_engine()``.
� N� )�Dialect� )�exc)�util)�plugins)�registryc � � e Zd ZdZ dd�Zdd�Zd� Zd� Zd� Zd � Z d
� Z
ed� � � Zej
d� � � Zd
� Zd� Zd� Zd� Zd� Zg fd�ZdS )�URLaX
Represent the components of a URL used to connect to a database.
This object is suitable to be passed directly to a
:func:`~sqlalchemy.create_engine` call. The fields of the URL are parsed
from a string by the :func:`.make_url` function. The string
format of the URL is an RFC-1738-style string.
All initialization parameters are available as public attributes.
:param drivername: the name of the database backend.
This name will correspond to a module in sqlalchemy/databases
or a third party plug-in.
:param username: The user name.
:param password: database password.
:param host: The name of the host.
:param port: The port number.
:param database: The database name.
:param query: A dictionary of options to be passed to the
dialect and/or the DBAPI upon connect.
Nc � � || _ || _ || _ || _ |�t |� � | _ nd | _ || _ |pi | _ d S �N)�
drivername�username�password_original�host�int�port�database�query)�selfr r �passwordr r r r s �L/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/engine/url.py�__init__zURL.__init__8 sS � � %��� ��
�!)����� ����D� � �D�I�I��D�I� ��
��[�b��
�
�
� Tc � � � � j dz }� j �A|t � j � � z
}� j �|d|rdnt � j � � z z
}|dz
}� j �!d� j v r|d� j z z
}n
|� j z
}� j �|dt
� j � � z z
}� j �
|d� j z z
}� j rOt � j � � }|�
� � |dd� � fd �|D � � � � z z
}|S )
Nz://�:z***�@z[%s]�/�?�&c 3 � �K � | ]Q}t j �j | � � D ]/}t j |� � �d t j |� � ��V � �0�RdS )�=N)r �to_listr �
quote_plus)�.0�k�elementr s �r � <genexpr>z$URL.__to_string__.<locals>.<genexpr>b s� �� � � � � ��#�|�D�J�q�M�:�:� � � � �?�1�-�-�-�-�t��w�/G�/G�/G�H� � � � � � � r )r r �_rfc_1738_quoter r r �strr r �list�sort�join)r �
hide_password�s�keyss ` r �
__to_string__zURL.__to_string__M sD �� ��O�e�#���=�$�
����/�/�/�A��}�(��S�*�N�E�E���
�0N�0N�� ��
��H�A��9� ��d�i����V�d�i�'�'����T�Y����9� �
��s�4�9�~�~�%�%�A��=�$�
��t�}�$�$�A��:� ���
�#�#�D��I�I�K�K�K�
��s�x�x� � � � �� � � � � � �
�A�
�r c �. � | � d�� � S )NF)r. �r1 �r s r �__str__zURL.__str__i s � ��!�!��!�6�6�6r c �* � | � � � S r
r3 r4 s r �__repr__zURL.__repr__l s � ��!�!�#�#�#r c �: � t t | � � � � S r
)�hashr* r4 s r �__hash__zURL.__hash__o s � ��C��I�I���r c � � t |t � � oo| j |j k o_| j |j k oO| j |j k o?| j |j k o/| j |j k o| j |j k o| j |j k S r
) �
isinstancer r r r r r r r �r �others r �__eq__z
URL.__eq__r s� � ��u�c�"�"�
(���5�#3�3�
(��
���/�
(� �
���/�
(� � �U�Z�'�
(�
�
���/�
(� �
�e�k�)�
(� � �U�Z�'�
r c � � | |k S r
� r= s r �__ne__z
URL.__ne__~ s � ��5�=� � r c �F � | j �d S t j | j � � S r
)r r � text_typer4 s r r zURL.password� s# � ��!�)��4��>�$�"8�9�9�9r c � � || _ d S r
)r )r r s r r zURL.password� s � �!)����r c �b � d| j vr| j S | j � d� � d S )N�+r )r �splitr4 s r �get_backend_namezURL.get_backend_name� s2 � ��d�o�%�%��?�"��?�(�(��-�-�a�0�0r c � � d| j vr| � � � j S | j � d� � d S )NrG r )r �get_dialect�driverrH r4 s r �get_driver_namezURL.get_driver_name� s? � ��d�o�%�%��#�#�%�%�,�,��?�(�(��-�-�a�0�0r c � � �� t j � j � dd� � � � }|�� dg � � z
}�� fd�|D � � S )N�pluginrA r c �L �� g | ] } t j |� � ��� � ��!S rA )r �load)r% �plugin_name�kwargsr s ��r �
<listcomp>z,URL._instantiate_plugins.<locals>.<listcomp>� s? �� �
�
�
��
&�G�L��%�%�d�F�3�3�
�
�
r )r r# r �get)r rS �plugin_namess `` r �_instantiate_pluginszURL._instantiate_plugins� sk ��� ��|�D�J�N�N�8�R�$@�$@�A�A����
�
�9�b�1�1�1��
�
�
�
�
�+�
�
�
�
r c � � d| j vr| j }n| j � dd� � }t j |� � }t |d� � r;t |j t � � r!t |j t � � r|j S |S )z�Return the "entry point" dialect class.
This is normally the dialect itself except in the case when the
returned class implements the get_dialect_cls() method.
rG �.�dialect)
r �replacer rQ �hasattrr<