Files
aitsc/.venv/Lib/site-packages/sqlalchemy/engine/__pycache__/url.cpython-312.pyc

490 lines
34 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
<00><19>h<EFBFBD>|<00><01>V<00>dZddlmZddlmZddlZddlmZddlm Z ddlm
2025-02-23 09:07:52 +08:00
Z
ddlm Z ddlm Z dd lm Z dd
lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!Gd<1C>de<0E>Z"d d<1E>Z#d!d<1F>Z$y)"aProvides 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()``.
<EFBFBD>)<01> annotationsN)<01>Any)<01>cast)<01>Dict)<01>Iterable)<01>List)<01>Mapping)<01>
NamedTuple)<01>Optional)<01>overload)<01>Sequence)<01>Tuple)<01>Type)<01>Union)<01> parse_qsl)<01>quote)<01>
quote_plus)<01>unquote<74>)<01>Dialect<63>)<01>exc)<01>util)<01>plugins)<01>registryc<01>f<00>eZdZUdZded< ded< ded< ded< ded < ded
< d ed < ed d d d d ejf d*d<0E><05>Zed+d<0F><04>Z ed,d<10><04>Z
e d-d<11><04>Z e d.d<12><04>Z d/ d0d<13>Z d1d<14>Z d2 d3d<15>Z d2 d4d<16>Z d2 d5d<17>Zd6d<18>Zed7d<19><04>Zej*dd<1B>d8d9d<1C><05>Zd8d9d<1D>Zd:d<1E>Zd;d<1F>Zd<d <20>Zd=d!<21>Zd>d"<22>Zd>d#<23>Zd:d$<24>Zd:d%<25>Z d?d&<26>Z d@d'<27>Z!d2dAd(<28>Z" dB dCd)<29>Z#y )D<>URLa<4C>
Represent the components of a URL used to connect to a database.
URLs are typically constructed from a fully formatted URL string, where the
:func:`.make_url` function is used internally by the
:func:`_sa.create_engine` function in order to parse the URL string into
its individual components, which are then used to construct a new
:class:`.URL` object. When parsing from a formatted URL string, the parsing
format generally follows
`RFC-1738 <https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions.
A :class:`_engine.URL` object may also be produced directly, either by
using the :func:`.make_url` function with a fully formed URL string, or
by using the :meth:`_engine.URL.create` constructor in order
to construct a :class:`_engine.URL` programmatically given individual
fields. The resulting :class:`.URL` object may be passed directly to
:func:`_sa.create_engine` in place of a string argument, which will bypass
the usage of :func:`.make_url` within the engine's creation process.
.. versionchanged:: 1.4
The :class:`_engine.URL` object is now an immutable object. To
create a URL, use the :func:`_engine.make_url` or
:meth:`_engine.URL.create` function / method. To modify
a :class:`_engine.URL`, use methods like
:meth:`_engine.URL.set` and
:meth:`_engine.URL.update_query_dict` to return a new
:class:`_engine.URL` object with modifications. See notes for this
change at :ref:`change_5526`.
.. seealso::
:ref:`database_urls`
:class:`_engine.URL` contains the following attributes:
* :attr:`_engine.URL.drivername`: database backend and driver name, such as
``postgresql+psycopg2``
* :attr:`_engine.URL.username`: username string
* :attr:`_engine.URL.password`: password string
* :attr:`_engine.URL.host`: string hostname
* :attr:`_engine.URL.port`: integer port number
* :attr:`_engine.URL.database`: string database name
* :attr:`_engine.URL.query`: an immutable mapping representing the query
string. contains strings for keys and either strings or tuples of
strings for values.
<20>str<74>
drivername<EFBFBD> Optional[str]<5D>username<6D>password<72>host<73> Optional[int]<5D>port<72>database<73>4util.immutabledict[str, Union[Tuple[str, ...], str]]<5D>queryNc <01><><00>||j|d<01>|j|d<02>||j|d<03>|j|<05>|j|d<04>|j|<07><00>S)a<>Create a new :class:`_engine.URL` object.
.. seealso::
:ref:`database_urls`
: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. Is typically a string, but may
also be an object that can be stringified with ``str()``.
.. note:: The password string should **not** be URL encoded when
passed as an argument to :meth:`_engine.URL.create`; the string
should contain the password characters exactly as they would be
typed.
.. note:: A password-producing object will be stringified only
**once** per :class:`_engine.Engine` object. For dynamic password
generation per connect, see :ref:`engines_dynamic_tokens`.
:param host: The name of the host.
:param port: The port number.
:param database: The database name.
:param query: A dictionary of string keys to string values to be passed
to the dialect and/or the DBAPI upon connect. To specify non-string
parameters to a Python DBAPI directly, use the
:paramref:`_sa.create_engine.connect_args` parameter to
:func:`_sa.create_engine`. See also
:attr:`_engine.URL.normalized_query` for a dictionary that is
consistently string->list of string.
:return: new :class:`_engine.URL` object.
.. versionadded:: 1.4
The :class:`_engine.URL` object is now an **immutable named
tuple**. In addition, the ``query`` dictionary is also immutable.
To create a URL, use the :func:`_engine.url.make_url` or
:meth:`_engine.URL.create` function/ method. To modify a
:class:`_engine.URL`, use the :meth:`_engine.URL.set` and
:meth:`_engine.URL.update_query` methods.
2025-08-29 00:34:40 +08:00
rr!r#r&)<04> _assert_str<74>_assert_none_str<74> _assert_port<72> _str_dict)<08>clsrr!r"r#r%r&r(s <20>BD:\pythonpj\aitsc\.venv\Lib\site-packages\sqlalchemy/engine/url.py<70>createz
2025-02-23 09:07:52 +08:00
URL.create<74>sm<00><00>p<13> <0F>O<EFBFBD>O<EFBFBD>J<EFBFBD> <0C> 5<> <0F> <20> <20><18>:<3A> 6<> <14> <0F> <20> <20><14>v<EFBFBD> .<2E> <0F> <1C> <1C>T<EFBFBD> "<22> <0F> <20> <20><18>:<3A> 6<> <0F>M<EFBFBD>M<EFBFBD>%<25> <20>
<EFBFBD>
<EFBFBD>c<01>P<00>|<01>y t|<01>S#t$r td<01><00>wxYw)Nz(Port argument must be an integer or None)<02>int<6E> TypeError)r.r%s r/r,zURL._assert_port<72>s7<00><00> <0F><<3C><17> H<01><16>t<EFBFBD>9<EFBFBD> <1C><><18> H<01><1B>F<>G<> G<> H<01>s<00>
<00>%c<01>B<00>t|t<00>std|z<00><00>|S)Nz%s must be a string<6E><03>
isinstancerr4<00>r.<00>v<> paramnames r/r*zURL._assert_str<74>s"<00><00><19>!<21>S<EFBFBD>!<21><1B>1<>I<EFBFBD>=<3D>><3E> ><3E><10>r1c<01>.<00>|<01>|S|j||<02>S<00>N)r*r8s r/r+zURL._assert_none_str<74>s<00><00> <0A>9<EFBFBD><14>H<EFBFBD><12><EFBFBD><EFBFBD>q<EFBFBD>)<29>,<2C>,r1c
<01>X<00><06>|<01>tjSt dd<01><04><00>t dd<02><04><00> d<07>fd<03> <0C>dd<04>}t|tj
<00>r|}n|j <00>}tj|D<00><04>cic]\}}||<04><00>|<05><00><02>c}}<04>Scc}}w) Nc<01><00>yr<<00><00><01>vals r/<00> _assert_valuez$URL._str_dict.<locals>._assert_value<75>s<00><00>r1c<01><00>yr<r?r@s r/rBz$URL._str_dict.<locals>._assert_values<00><00>+.r1c<01><><00><01>t|t<00>r|St|tj<00>rt <00>fd<01>|D<00><00>St d<02><00>)Nc3<01>.<00>K<00>|] }<00>|<01><00><01><00>y<00>wr<r?)<03>.0<EFBFBD>elemrBs <20>r/<00> <genexpr>z7URL._str_dict.<locals>._assert_value.<locals>.<genexpr>s<00><><00><><00>A<>S<EFBFBD>T<EFBFBD>]<5D>4<EFBFBD>0<>S<EFBFBD>s<00>z?Query dictionary values must be strings or sequences of strings)r7r<00>collections_abcr <00>tupler4)rArBs <20>r/rBz$URL._str_dict.<locals>._assert_value sG<00><><00><1A>#<23>s<EFBFBD>#<23><1A>
<EFBFBD><1B>C<EFBFBD><1F>!9<>!9<>:<3A><1C>A<>S<EFBFBD>A<>A<>A<><1F>+<2B><12>r1c<01><<00>t|t<00>s td<01><00>|S)Nz%Query dictionary keys must be stringsr6)r9s r/r*z"URL._str_dict.<locals>._assert_strs<00><00><1D>a<EFBFBD><13>%<25><1F> G<>H<>H<><14>Hr1)rAr<00>returnr)rAz Sequence[str]rL<00>Union[str, Tuple[str, ...]])rAzUnion[str, Sequence[str]]rLrM)r9rrLr)r<00>
EMPTY_DICTr r7rIr <00>items<6D> immutabledict)r.<00>dict_r*<00>
dict_items<EFBFBD>key<65>valuerBs @r/r-z URL._str_dict<63>s<><00><><00> <11>=<3D><17>?<3F>?<3F> "<22> <11> <16><14> <16> <10> <16>
<12> <16>
<12> .<2E><1E> .<2E> (<28> .<2E>
<12> .<2E> <12>*<2A> <12> (<28> <12> <15> <16>e<EFBFBD>_<EFBFBD>5<>5<> 6<><1E>J<EFBFBD><1E><1B><1B><1D>J<EFBFBD><13>!<21>!<21>
#-<2D>  <0E>#-<2D>J<EFBFBD>C<EFBFBD><15><1C>C<EFBFBD> <20>-<2D><19>#<12><12>#-<2D>  <0E>
<EFBFBD>
<EFBFBD><EFBFBD> s<00>B&
c<01><><00>i}|<01>||d<|<02>||d<|<03>||d<|<04>||d<|<05>||d<|<06>||d<|<07>||d<|jdi|<08><01>S) areturn a new :class:`_engine.URL` object with modifications.
Values are used if they are non-None. To set a value to ``None``
explicitly, use the :meth:`_engine.URL._replace` method adapted
from ``namedtuple``.
:param drivername: new drivername
:param username: new username
:param password: new password
:param host: new hostname
:param port: new port
:param query: new query parameters, passed a dict of string keys
referring to string or sequence of string values. Fully
replaces the previous list of arguments.
:return: new :class:`_engine.URL` object.
.. versionadded:: 1.4
.. seealso::
:meth:`_engine.URL.update_query_dict`
rr!r"r#r%r&r(r?)<01>_assert_replace) <09>selfrr!r"r#r%r&r(<00>kws r/<00>setzURL.set*s<><00><00>F <20><02> <15> !<21>)<29>B<EFBFBD>|<7C> <1C> <13> <1F>%<25>B<EFBFBD>z<EFBFBD>N<EFBFBD> <13> <1F>%<25>B<EFBFBD>z<EFBFBD>N<EFBFBD> <0F> <1B><1D>B<EFBFBD>v<EFBFBD>J<EFBFBD> <0F> <1B><1D>B<EFBFBD>v<EFBFBD>J<EFBFBD> <13> <1F>%<25>B<EFBFBD>z<EFBFBD>N<EFBFBD> <10> <1C><1F>B<EFBFBD>w<EFBFBD>K<EFBFBD>#<23>t<EFBFBD>#<23>#<23>)<29>b<EFBFBD>)<29>)r1c <01><00>d|vr|j|dd<01>dD]}||vs<01>|j|||<02><00>d|vr|j|d<00>d|vr|j|d<00>|d<|jdi|<01><01>S)z)argument checks before calling _replace()r)r!r#r&r%r(r?)r*r+r,r-<00>_replace)rWrX<00>names r/rVzURL._assert_replace_s<><00><00> <18>2<EFBFBD> <1D> <10> <1C> <1C>R<EFBFBD> <0C>-<2D>|<7C> <<3C>2<>D<EFBFBD><13>r<EFBFBD>z<EFBFBD><14>%<25>%<25>b<EFBFBD><14>h<EFBFBD><04>5<>3<> <12>R<EFBFBD><<3C> <10> <1D> <1D>b<EFBFBD><16>j<EFBFBD> )<29> <12>b<EFBFBD>=<3D><1E>.<2E>.<2E><12>G<EFBFBD><1B>5<>B<EFBFBD>w<EFBFBD>K<EFBFBD><1C>t<EFBFBD>}<7D>}<7D>"<22>r<EFBFBD>"<22>"r1c<01>:<00>|jt|<01>|<02><01>S)akReturn a new :class:`_engine.URL` object with the :attr:`_engine.URL.query`
parameter dictionary updated by the given query string.
E.g.::
>>> from sqlalchemy.engine import make_url
>>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
>>> url = url.update_query_string(
... "alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"
... )
>>> str(url)
'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
:param query_string: a URL escaped query string, not including the
question mark.
:param append: if True, parameters in the existing query string will
not be removed; new parameters will be in addition to those present.
If left at its default of False, keys present in the given query
parameters will replace those of the existing query string.
.. versionadded:: 1.4
.. seealso::
:attr:`_engine.URL.query`
:meth:`_engine.URL.update_query_dict`
<20><01>append)<02>update_query_pairsr)rW<00> query_stringr_s r/<00>update_query_stringzURL.update_query_stringns <00><00>B<14>&<26>&<26>y<EFBFBD><1C>'><3E>v<EFBFBD>&<26>N<>Nr1c <01>"<00>|j}i}|D]w\}}||vrHtj||<00>||<td||<00>j tt
|<06><00><00>Rt |ttf<02>r t|<06>n|||<<00>y|r<>i}|D]L}||vr>ttj||<00>tj||<00>z<00>||<<00>E||||<<00>N|jt|<03>j|<04>D<00>cic]}|||<00><02>
c}<08>nX|jj|j<00>D<00><08> cic]#\}} |t | t<00>r t| <09>n| <09><02>%c} }<08>}|j|<07><02>Scc}wcc} }w)aReturn a new :class:`_engine.URL` object with the
:attr:`_engine.URL.query`
parameter dictionary updated by the given sequence of key/value pairs
E.g.::
>>> from sqlalchemy.engine import make_url
>>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
>>> url = url.update_query_pairs(
... [
... ("alt_host", "host1"),
... ("alt_host", "host2"),
... ("ssl_cipher", "/path/to/crt"),
... ]
... )
>>> str(url)
'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
:param key_value_pairs: A sequence of tuples containing two strings
each.
:param append: if True, parameters in the existing query string will
not be removed; new parameters will be in addition to those present.
If left at its default of False, keys present in the given query
parameters will replace those of the existing query string.
.. versionadded:: 1.4
.. seealso::
:attr:`_engine.URL.query`
:meth:`_engine.URL.difference_update_query`
:meth:`_engine.URL.set`
<20> List[str])r()r(r<00>to_listrr_rr7<00>listrJ<00>updaterY<00>
difference<EFBFBD>unionrO)
rW<00>key_value_pairsr_<00>existing_query<72>new_keysrSrT<00> new_query<72>kr9s
r/r`zURL.update_query_pairs<72>s<><00><00>V<1E><1A><1A><0E>57<35><08>)<29>J<EFBFBD>C<EFBFBD><15><12>h<EFBFBD><EFBFBD> $<24> <0C> <0C>X<EFBFBD>c<EFBFBD>]<5D> ;<3B><08><13> <0A><14>[<5B>(<28>3<EFBFBD>-<2D>0<>7<>7<><04>S<EFBFBD>%<25>8H<38>I<>$.<2E>e<EFBFBD>d<EFBFBD>E<EFBFBD>]<5D>#C<>D<EFBFBD><15>K<EFBFBD><15><19><13> <0A> *<2A> <12><1A>I<EFBFBD><1D><01><14><0E>&<26>#(<28><1C> <0C> <0C>^<5E>A<EFBFBD>%6<>7<><1E>,<2C>,<2C>x<EFBFBD><01>{<7B>3<>4<>$<16>I<EFBFBD>a<EFBFBD>L<EFBFBD>
$,<2C>A<EFBFBD>;<3B>I<EFBFBD>a<EFBFBD>L<EFBFBD><1E> <16> <1C> <1C>!<21><1E>0<>;<3B>;<3B>H<EFBFBD>E<><12>E<><01><16>~<7E>a<EFBFBD>(<28>(<28>E<><12> <0E><1D>
<EFBFBD>
<EFBFBD>(<28>(<28>!)<29><0E><0E> 0<><12> 0<><04><01>1<EFBFBD><16>:<3A>a<EFBFBD><14>#6<>u<EFBFBD>Q<EFBFBD>x<EFBFBD>A<EFBFBD>=<3D> 0<><12><0E>I<EFBFBD> <14>x<EFBFBD>x<EFBFBD>i<EFBFBD>x<EFBFBD>(<28>(<28><><12><>s <00> F<08>(F
c<01>D<00>|j|j<00>|<02><01>S)a<>Return a new :class:`_engine.URL` object with the
:attr:`_engine.URL.query` parameter dictionary updated by the given
dictionary.
The dictionary typically contains string keys and string values.
In order to represent a query parameter that is expressed multiple
times, pass a sequence of string values.
E.g.::
>>> from sqlalchemy.engine import make_url
>>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
>>> url = url.update_query_dict(
... {"alt_host": ["host1", "host2"], "ssl_cipher": "/path/to/crt"}
... )
>>> str(url)
'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'
:param query_parameters: A dictionary with string keys and values
that are either strings, or sequences of strings.
:param append: if True, parameters in the existing query string will
not be removed; new parameters will be in addition to those present.
If left at its default of False, keys present in the given query
parameters will replace those of the existing query string.
.. versionadded:: 1.4
.. seealso::
:attr:`_engine.URL.query`
:meth:`_engine.URL.update_query_string`
:meth:`_engine.URL.update_query_pairs`
:meth:`_engine.URL.difference_update_query`
:meth:`_engine.URL.set`
r^)r`rO)rW<00>query_parametersr_s r/<00>update_query_dictzURL.update_query_dict<63>s%<00><00>b<14>&<26>&<26>'7<>'=<3D>'=<3D>'?<3F><06>&<26>O<>Or1c<01><><00>t|<01>j|j<00>s|St|j|j
|j |j|j|jtjt|j<00>j|<01>D<00>cic]}||j|<00><02>c}<02><00>Scc}w)a<>
Remove the given names from the :attr:`_engine.URL.query` dictionary,
returning the new :class:`_engine.URL`.
E.g.::
url = url.difference_update_query(["foo", "bar"])
Equivalent to using :meth:`_engine.URL.set` as follows::
url = url.set(
query={
key: url.query[key]
for key in set(url.query).difference(["foo", "bar"])
}
)
.. versionadded:: 1.4
.. seealso::
:attr:`_engine.URL.query`
:meth:`_engine.URL.update_query_dict`
:meth:`_engine.URL.set`
) rY<00> intersectionr(rrr!r"r#r%r&rrPrh)rW<00>namesrSs r/<00>difference_update_queryzURL.difference_update_querys<><00><00><<13>5<EFBFBD>z<EFBFBD>&<26>&<26>t<EFBFBD>z<EFBFBD>z<EFBFBD>2<><17>K<EFBFBD><12> <10>O<EFBFBD>O<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <10>I<EFBFBD>I<EFBFBD> <10>I<EFBFBD>I<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <10> <1E> <1E> #<23>4<EFBFBD>:<3A>:<3A><EFBFBD>9<>9<>%<25>@<40><12>@<40><03><18><14><1A><1A>C<EFBFBD><1F>(<28>@<40><12> <0E> 
<EFBFBD>
<EFBFBD><EFBFBD>s<00>#Cc <01><><00>tj|jj<00>D<00><01>cic]\}}|t |t
<00>s|fn|<02><02>c}}<01>Scc}}w)a&Return the :attr:`_engine.URL.query` dictionary with values normalized
into sequences.
As the :attr:`_engine.URL.query` dictionary may contain either
string values or sequences of string values to differentiate between
parameters that are specified multiple times in the query string,
code that needs to handle multiple parameters generically will wish
to use this attribute so that all parameters present are presented
as sequences. Inspiration is from Python's ``urllib.parse.parse_qs``
function. E.g.::
>>> from sqlalchemy.engine import make_url
>>> url = make_url(
... "postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"
... )
>>> url.query
immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': '/path/to/crt'})
>>> url.normalized_query
immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': ('/path/to/crt',)})
)rrPr(rOr7rJ)rWrnr9s r/<00>normalized_queryzURL.normalized_queryGs\<00><00>2<14>!<21>!<21>!<21>J<EFBFBD>J<EFBFBD>,<2C>,<2C>.<2E> <0E>.<2E>D<EFBFBD>A<EFBFBD>q<EFBFBD><12>z<EFBFBD>!<21>U<EFBFBD>3<>A<EFBFBD>4<EFBFBD><11>:<3A>.<2E> <0E>
<EFBFBD>
<EFBFBD><EFBFBD> s<00> A
<EFBFBD>1.4z<EFBFBD>The :meth:`_engine.URL.__to_string__ method is deprecated and will be removed in a future release. Please use the :meth:`_engine.URL.render_as_string` method.c<01>&<00>|j|<01><01>S)z<>Render this :class:`_engine.URL` object as a string.
:param hide_password: Defaults to True. The password is not shown
in the string unless this is set to False.
)<01> hide_password<72><01>render_as_string)rWrzs r/<00> __to_string__zURL.__to_string__gs<00><00><14>$<24>$<24>=<3D>$<24>A<>Ar1c<01><><00><00><00>jdz}<02>j<00>U|t<00>jd<02><03>z }<02>j<00>*|d|rdntt <00>j<00>d<02><03>zz }|dz }<02>j
<00>1d<04>j
vr|d<07>j
<00>d<08>z }n|<02>j
z }<02>j <00>|dt <00>j <00>zz }<02>j<00>|d <09>jzz }<02>jrEt<00>j<00>}|j<00>|d
d j<00>fd <0C>|D<00><00>zz }|S) aRRender this :class:`_engine.URL` object as a string.
This method is used when the ``__str__()`` or ``__repr__()``
methods are used. The method directly includes additional options.
:param hide_password: Defaults to True. The password is not shown
in the string unless this is set to False.
z://z +)<01>safe<66>:z***<2A>@<40>[<5B>]<5D>/<2F>?<3F>&c3<01><><00>K<00>|]D}tj<00>j|<00>D]}t|<01><00>dt|<02><00><00><03><01><00><00>Fy<01>w)<02>=N)rrer(r)rFrn<00>elementrWs <20>r/rHz'URL.render_as_string.<locals>.<genexpr><3E>sL<00><><00><><00> <0E><1D>A<EFBFBD>#<23>|<7C>|<7C>D<EFBFBD>J<EFBFBD>J<EFBFBD>q<EFBFBD>M<EFBFBD>:<3A>G<EFBFBD><1E>a<EFBFBD>=<3D>/<2F><11>:<3A>g<EFBFBD>#6<>"7<>8<>:<3A>9<><1D>s<00>A
A ) rr!rr"rr#r%r&r(rf<00>sort<72>join)rWrz<00>s<>keyss` r/r|zURL.render_as_stringvs9<00><><00> <11>O<EFBFBD>O<EFBFBD>e<EFBFBD> #<23><01> <0F>=<3D>=<3D> $<24> <0A><15>t<EFBFBD>}<7D>}<7D>4<EFBFBD>0<> 0<>A<EFBFBD><13>}<7D>}<7D>(<28><11>S<EFBFBD>$<24><1A><1E>s<EFBFBD>4<EFBFBD>=<3D>=<3D>1<><04>=<3D><12><12><01>
<0E><13>H<EFBFBD>A<EFBFBD> <0F>9<EFBFBD>9<EFBFBD> <20><12>d<EFBFBD>i<EFBFBD>i<EFBFBD><1F><11>q<EFBFBD><14><19><19> <0B>1<EFBFBD>%<25>%<25><01><11>T<EFBFBD>Y<EFBFBD>Y<EFBFBD><0E><01> <0F>9<EFBFBD>9<EFBFBD> <20> <0A><13>s<EFBFBD>4<EFBFBD>9<EFBFBD>9<EFBFBD>~<7E>%<25> %<25>A<EFBFBD> <0F>=<3D>=<3D> $<24> <0A><13>t<EFBFBD>}<7D>}<7D>$<24> $<24>A<EFBFBD> <0F>:<3A>:<3A><17><04>
<EFBFBD>
<EFBFBD>#<23>D<EFBFBD> <10>I<EFBFBD>I<EFBFBD>K<EFBFBD> <0A><13>s<EFBFBD>x<EFBFBD>x<EFBFBD> <0E><1D> <0E><0E><0E> <0E>A<EFBFBD>
<11>r1c<01>"<00>|j<00>Sr<r{<00>rWs r/<00>__repr__z URL.__repr__<5F>s<00><00><13>$<24>$<24>&<26>&r1c <01><><00>|jj|j|j|j|j
|j |j|j<00>Sr<) <09> __class__r0rr!r"r#r%r&r(r<>s r/<00>__copy__z URL.__copy__<5F>sL<00><00><13>~<7E>~<7E>$<24>$<24> <10>O<EFBFBD>O<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <10>I<EFBFBD>I<EFBFBD> <10>I<EFBFBD>I<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <11>J<EFBFBD>J<EFBFBD>

<EFBFBD>
r1c<01>"<00>|j<00>Sr<)r<>)rW<00>memos r/<00> __deepcopy__zURL.__deepcopy__<5F>s<00><00><13>}<7D>}<7D><EFBFBD>r1c<01>*<00>tt|<00><00>Sr<)<02>hashrr<>s r/<00>__hash__z URL.__hash__<5F>s<00><00><13>C<EFBFBD><04>I<EFBFBD><EFBFBD>r1c<01><><00>t|t<00>xr<>|j|jk(xr<>|j|jk(xr<>|j|jk(xrj|j
|j
k(xrO|j |j k(xr4|j|jk(xr|j|jk(Sr<) r7rrr!r"r#r&r(r%<00>rW<00>others r/<00>__eq__z
URL.__eq__<5F>s<><00><00> <16>u<EFBFBD>c<EFBFBD> "<22> (<28><14><0F><0F>5<EFBFBD>#3<>#3<>3<> (<28><14> <0A> <0A><15><1E><1E>/<2F> (<28><15> <0A> <0A><15><1E><1E>/<2F> (<28><15> <09> <09>U<EFBFBD>Z<EFBFBD>Z<EFBFBD>'<27>  (<28>
<15> <0A> <0A><15><1E><1E>/<2F>  (<28> <15>
<EFBFBD>
<EFBFBD>e<EFBFBD>k<EFBFBD>k<EFBFBD>)<29>  (<28><15> <09> <09>U<EFBFBD>Z<EFBFBD>Z<EFBFBD>'<27>
r1c<01><00>||k( Sr<r?r<>s r/<00>__ne__z
URL.__ne__<5F>s<00><00><17>5<EFBFBD>=<3D> <20> r1c<01>r<00>d|jvr |jS|jjd<01>dS)z<>Return the backend name.
This is the name that corresponds to the database backend in
use, and is the portion of the :attr:`_engine.URL.drivername`
that is to the left of the plus sign.
<20>+r)r<00>splitr<74>s r/<00>get_backend_namezURL.get_backend_name<6D>s4<00><00> <0F>d<EFBFBD>o<EFBFBD>o<EFBFBD> %<25><17>?<3F>?<3F> "<22><17>?<3F>?<3F>(<28>(<28><13>-<2D>a<EFBFBD>0<> 0r1c<01><><00>d|jvr|j<00>jS|jjd<01>dS)a<>Return the backend name.
This is the name that corresponds to the DBAPI driver in
use, and is the portion of the :attr:`_engine.URL.drivername`
that is to the right of the plus sign.
If the :attr:`_engine.URL.drivername` does not include a plus sign,
then the default :class:`_engine.Dialect` for this :class:`_engine.URL`
is imported in order to get the driver name.
r<>r)r<00> get_dialect<63>driverr<72>r<>s r/<00>get_driver_namezURL.get_driver_name<6D>s?<00><00> <0F>d<EFBFBD>o<EFBFBD>o<EFBFBD> %<25><17>#<23>#<23>%<25>,<2C>,<2C> ,<2C><17>?<3F>?<3F>(<28>(<28><13>-<2D>a<EFBFBD>0<> 0r1c<01><><00>tj|jjdd<02><00>}||jdg<00>z }t |<01>}|D<00>cgc]}t j |<03>||<01><00><02> }}|jddg<02>}|D]}|j|<05>}|<07><01>|}<05>|jdd<00>|||fScc}w)N<>pluginr?r)
rrer(<00>get<65>dictr<00>loadru<00>
update_url<EFBFBD>pop)rW<00>kwargs<67> plugin_names<65> plugin_name<6D>loaded_plugins<6E>ur<75><00>new_us r/<00>_instantiate_pluginszURL._instantiate_plugins<6E>s<><00><00><1C>|<7C>|<7C>D<EFBFBD>J<EFBFBD>J<EFBFBD>N<EFBFBD>N<EFBFBD>8<EFBFBD>R<EFBFBD>$@<40>A<> <0C><14><06>
<EFBFBD>
<EFBFBD>9<EFBFBD>b<EFBFBD>1<>1<> <0C><15>f<EFBFBD><1C><06> ,<2C>
<EFBFBD>+<2B> <0B> &<26>G<EFBFBD>L<EFBFBD>L<EFBFBD><1B> %<25>d<EFBFBD>F<EFBFBD> 3<>+<2B> <17>
<EFBFBD>
<11> (<28> (<28>(<28>I<EFBFBD>)><3E> ?<3F><01>$<24>F<EFBFBD><1A>%<25>%<25>a<EFBFBD>(<28>E<EFBFBD><14> <20><19><01>%<25>
<0F>
<EFBFBD>
<EFBFBD>9<EFBFBD>d<EFBFBD>#<23><10>.<2E>&<26>(<28>(<28><>
s<00>#Cc<01>J<00>d|jvr |j}n|jjdd<02>}tj|<01>}t |d<03>r@t |j t<00>r&t|j t<00>r |j Std|<02>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.
r<><00>.<2E>dialect<63> Type[Dialect]) r<00>replacerr<><00>hasattrr7r<><00>type<70>
issubclassrr)rWr\r.s r/<00>_get_entrypointzURL._get_entrypoint<6E>s|<00><00> <0F>d<EFBFBD>o<EFBFBD>o<EFBFBD> %<25><17>?<3F>?<3F>D<EFBFBD><17>?<3F>?<3F>*<2A>*<2A>3<EFBFBD><03>4<>D<EFBFBD><16>m<EFBFBD>m<EFBFBD>D<EFBFBD>!<21><03>
<14>C<EFBFBD><19> #<23><1A>3<EFBFBD>;<3B>;<3B><04>-<2D><1A>3<EFBFBD>;<3B>;<3B><07>0<><16>;<3B>;<3B> <1E><17><0F><13>-<2D> -r1c<01>r<00>|j<00>}|r|j|<00>}|S|j|<00>}|S)zoReturn the SQLAlchemy :class:`_engine.Dialect` class corresponding
to this URL's driver name.
)r<><00>get_async_dialect_cls<6C>get_dialect_cls)rW<00> _is_async<6E>
entrypoint<EFBFBD> dialect_clss r/r<>zURL.get_dialectsE<00><00>
<1A>)<29>)<29>+<2B>
<EFBFBD> <14>$<24>:<3A>:<3A>4<EFBFBD>@<40>K<EFBFBD><1B><1A>%<25>4<>4<>T<EFBFBD>:<3A>K<EFBFBD><1A>r1c <01> <00>|<01>tjdd<02>i}gd<03>}|D]`}|r|jd<04>}n ||vr||}n|}|<06><01>&t||d<05>s<01>4|dk(rt t||<05><00>||<<00>Rt||<05>||<<00>b|S)a2Translate url attributes into a dictionary of connection arguments.
Returns attributes of this url (`host`, `database`, `username`,
`password`, `port`) as a plain dictionary. The attribute names are
used as the keys by default. Unset or false attributes are omitted
from the final dictionary.
:param \**kw: Optional, alternate key names for url attributes.
:param names: Deprecated. Same purpose as the keyword-based alternate
names, but correlates the name to the original positionally.
zpThe `URL.translate_connect_args.name`s parameter is deprecated. Please pass the alternate names as kw arguments.rx)r#r&r!r"r%rFr")r<00>warn_deprecatedr<64><00>getattrr)rWrtrX<00>
translated<EFBFBD>attribute_names<65>snamer\s r/<00>translate_connect_argszURL.translate_connect_argss<><00><00> <11> <1C> <10> <20> <20>3<><16>  <0E><18>
<EFBFBD>N<><0F>$<24>E<EFBFBD><14><1C>y<EFBFBD>y<EFBFBD><11>|<7C><04><16>"<22><1B><19>%<25>y<EFBFBD><04><1C><04><13><1F>G<EFBFBD>D<EFBFBD>%<25><15>$?<3F><18>J<EFBFBD>&<26>'*<2A>7<EFBFBD>4<EFBFBD><15>+?<3F>'@<40>J<EFBFBD>t<EFBFBD>$<24>'.<2E>t<EFBFBD>U<EFBFBD>';<3B>J<EFBFBD>t<EFBFBD>$<24>%<25><1A>r1)rrr!r r"r r#r r%r$r&r r(z'Mapping[str, Union[Sequence[str], str]]rLr)r%r$rLr$)r9rr:rrLr)r9r r:rrLr )rQziOptional[Union[Sequence[Tuple[str, Union[Sequence[str], str]]], Mapping[str, Union[Sequence[str], str]]]]rLr')NNNNNNN)rr r!r r"r r#r r%r$r&r r(z1Optional[Mapping[str, Union[Sequence[str], str]]]rLr)rXrrLr)F)rarr_<00>boolrLr)rjz+Iterable[Tuple[str, Union[str, List[str]]]]r_r<>rLr)rpz#Mapping[str, Union[str, List[str]]]r_r<>rLr)rtz Iterable[str]rLr)rLzMapping[str, Sequence[str]])T)rzr<>rLr)rLr)rLr)r<>rrLr)rLr3)r<>rrLr<>)r<>zMapping[str, Any]rLz%Tuple[URL, List[Any], Dict[str, Any]])rLr<>)r<>r<>rLr<>r<)rtzOptional[List[str]]rXrrLzDict[str, Any])$<24>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>__annotations__<5F> classmethodrrNr0r,r*r+r-rYrVrbr`rqru<00>propertyrw<00>
deprecatedr}r|r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r?r1r/rr.s<><00><00>0<08>d<14>O<EFBFBD><08>
<1C><1B><15><1B><1B>/<2F> <18><17><10> <18><17><1D><1B><1B><17> ?<3F>?<3F><08>><11>#'<27>"&<26>"<22>"<22>"&<26>9=<3D><1F><1F>?
<EFBFBD><17>?
<EFBFBD> <20>?
<EFBFBD> <20> ?
<EFBFBD>
<1C> ?
<EFBFBD> <1C> ?
<EFBFBD> <20>?
<EFBFBD>7<>?
<EFBFBD>
<0A>?
<EFBFBD><11>?
<EFBFBD>B<11>H<01><11>H<01><11><11><11><11>
<11>-<2D><1D>-<2D>*-<2D>-<2D> <16>-<2D><11>-<2D><11>5
<EFBFBD>
<EFBFBD>5
<EFBFBD>
><3E>5
<EFBFBD><11>5
<EFBFBD>r%)<29>"&<26>"&<26>"<22>"<22>"&<26>CG<43>3*<2A>!<21>3*<2A> <20>3*<2A> <20> 3*<2A>
<1C> 3*<2A> <1C> 3*<2A> <20>3*<2A>A<01>3*<2A>
<0A>3*<2A>j #<23> 16<31>!O<01><1F>!O<01>)-<2D>!O<01> <0C>!O<01>L<1D>Q)<29>D<>Q)<29><15>Q)<29>
<0A> Q)<29>l<1D>1P<01>=<3D>1P<01><15>1P<01>
<0A> 1P<01>f.
<EFBFBD>`<0E>
<EFBFBD><0E>
<EFBFBD>><15>T<EFBFBD>_<EFBFBD>_<EFBFBD> <0A> 7<><06> B<01> <06> B<01>%<11>N'<27> 
<EFBFBD><1F><1F>

<EFBFBD>!<21> 1<>1<>$)<29>'<27>)<29> .<2E>)<29>0.<2E>0
<1B>,0<>'<1A>(<28>'<1A>7:<3A>'<1A> <17>'r1rc<01><><00>t|t<00>r t|<00>St|t<00>s$t |d<01>st j d|<00><02><02><00>|S)a<>Given a string, produce a new URL instance.
The format of the URL generally follows `RFC-1738
<https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions, including
that underscores, and not dashes or periods, are accepted within the
"scheme" portion.
If a :class:`.URL` object is passed, it is returned as is.
.. seealso::
:ref:`database_urls`
<20>)_sqla_is_testing_if_this_is_a_mock_objectz#Expected string or URL object, got )r7r<00>
_parse_urlrr<>r<00> ArgumentError)<01> name_or_urls r/<00>make_urlr<6C>GsW<00><00> <12>+<2B>s<EFBFBD>#<23><19>+<2B>&<26>&<26> <17> <0B>S<EFBFBD> )<29>'<27><13>@<40>3<06><12><1F><1F>1<>+<2B><1F> A<>
<EFBFBD>
2025-08-29 00:34:40 +08:00
<EFBFBD><1B>r1c<01><><00>tjdtj<00>}|j|<00>}|<02><01> |j <00>}|d<00>\i}t |d<00>D]H\}}||vr:t j||<00>||<td||<00>j|<06><00>D|||<<00>Jnd}||d<|d<00>t|d<00>|d<|d<00>t|d<00>|d<|jd<06>}|jd<07>}|xs||d<|jd <09>}|d
2025-02-23 09:07:52 +08:00
rt|d
<00>|d
2025-08-29 00:34:40 +08:00
<tj|fi|<03><01>Stj d <0B><00>) Na<4E>
2025-02-23 09:07:52 +08:00
(?P<name>[\w\+]+)://
(?:
(?P<username>[^:/]*)
(?::(?P<password>[^@]*))?
@)?
(?:
(?:
\[(?P<ipv6host>[^/\?]+)\] |
(?P<ipv4host>[^/:\?]+)
)?
(?::(?P<port>[^/\?]*))?
)?
(?:/(?P<database>[^\?]*))?
(?:\?(?P<query>.*))?
2025-08-29 00:34:40 +08:00
r(rdr!r"<00>ipv4host<73>ipv6hostr#r\r%z4Could not parse SQLAlchemy URL from given URL string)<11>re<72>compile<6C>X<>match<63> groupdictrrrerr_rr<>r3rr0rr<>) r\<00>pattern<72>m<>
componentsr(rSrTr<>r<>s r/r<>r<>csu<00><00><10>j<EFBFBD>j<EFBFBD> <10> <0B><04><04>#<06>G<EFBFBD>( <10> <0A> <0A>d<EFBFBD><1B>A<EFBFBD><08>}<7D><16>[<5B>[<5B>]<5D>
2025-02-23 09:07:52 +08:00
<EFBFBD> <15>g<EFBFBD> <1E> *<2A><16>E<EFBFBD>'<27>
<EFBFBD>7<EFBFBD>(;<3B><<3C>
<EFBFBD><03>U<EFBFBD><16>%<25><<3C>!%<25><1C><1C>e<EFBFBD>C<EFBFBD>j<EFBFBD>!9<>E<EFBFBD>#<23>J<EFBFBD><18><1B>e<EFBFBD>C<EFBFBD>j<EFBFBD>1<>8<>8<><15>?<3F>!&<26>E<EFBFBD>#<23>J<EFBFBD> =<3D><19>E<EFBFBD>#<23>
<EFBFBD>7<EFBFBD><1B> <15>j<EFBFBD> !<21> -<2D>%,<2C>Z<EFBFBD>
<EFBFBD>-C<>%D<>J<EFBFBD>z<EFBFBD> "<22> <15>j<EFBFBD> !<21> -<2D>%,<2C>Z<EFBFBD>
<EFBFBD>-C<>%D<>J<EFBFBD>z<EFBFBD> "<22><1D>><3E>><3E>*<2A>-<2D><08><1D>><3E>><3E>*<2A>-<2D><08>%<25>1<><18>
2025-08-29 00:34:40 +08:00
<EFBFBD>6<EFBFBD><1A><19>~<7E>~<7E>f<EFBFBD>%<25><04> <15>f<EFBFBD> <1D>!$<24>Z<EFBFBD><06>%7<>!8<>J<EFBFBD>v<EFBFBD> <1E><12>z<EFBFBD>z<EFBFBD>$<24>-<2D>*<2A>-<2D>-<2D><12><1F><1F> B<>
2025-02-23 09:07:52 +08:00
<EFBFBD>
r1)r<>zUnion[str, URL]rLr)r\rrLr)%r<><00>
__future__r<00>collections.abc<62>abcrIr<><00>typingrrrrrr r
r r r rrr<00> urllib.parserrrr<00>
interfacesr<00>rr<00>dialectsrrrr<>r<>r?r1r/<00><module>r<>sp<00><01><04>#<23>)<29> <09><16><17><17><1B><17><1A><1D><1B><1B><1B><18><17><18>"<22><1E>#<23> <20><1F><12><13><1E><1F>V <1A>*<2A>V <1A>r<1B>89
r1