summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/url.py
Commit message (Collapse)AuthorAgeFilesLines
* indicate private use of URL.__new__ privately onlyMike Bayer2021-10-011-1/+3
| | | | | | | | | | | Fixed issue where the deprecation warning for the :class:`.URL` constructor which indicates that the :meth:`.URL.create` method should be used would not emit if a full positional argument list of seven arguments were passed; additionally, validation of URL arguments will now occur if the constructor is called in this way, which was being skipped previously. Fixes: #7130 Change-Id: I8c8491d8aa7774afaf67c22b4f8e9859f780f2d9
* Ensure str is callect on the URL password.Federico Caselli2021-09-131-5/+27
| | | | | | | | | | | Ensure that ``str()`` is called on the an ``URL.password`` argument, allowing usage of objects that implement the ``__str__()`` method as password attributes. Also clarified that one such object is not appropriate to dynamically change the password. Fixes: #6958 Change-Id: Id0690990a64b9e0935537b7b8f5a73efe6a9e3dc
* remove erroneous None check from _assert_strMike Bayer2021-09-041-3/+0
| | | | | | | | Fixed issue in ``URL`` where validation of "drivername" would not appropriately respond to the ``None`` value where a string were expected. Fixes: #6983 Change-Id: If546c373a60533779595a9e393ea9a59a9b8a96f
* Avoid mutable object as default valuestsimafeip2021-08-241-1/+1
| | | | | | | | | Fixes: #6915 Closes: #6916 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6916 Pull-request-sha: 6ec484d3d14b7dd7053d10a5d550bd74eb524c8b Change-Id: I2c87fbed44870110e35a69ee9a9e678671eeb8f0
* Replace all http:// links to https://Federico Caselli2021-07-041-1/+1
| | | | | | Also replace http://pypi.python.org/pypi with https://pypi.org/project Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
* URL parsing fixesMike Bayer2021-05-241-22/+17
| | | | | | | | | | | | | Fixed a long-standing issue with :class:`.URL` where query parameters following the question mark would not be parsed correctly if the URL did not contain a database portion with a backslash. Fixed issue where an ``@`` sign in the database portion of a URL would not be interpreted correctly if the URL also had a username:password section. Fixes: #6329 Fixes: #6482 Change-Id: I6cb6478affa49b618335b947a74e64090657a98c
* Remove pep484 type comments from the codeFederico Caselli2021-05-161-31/+14
| | | | | | | | | | | | | Current effort is around the stub package, and having typing in two places makes thing worse, since the types here are usually outdated compared to the version in the stubs. Once v2 gets under way we can start consolidating the types here. Fixes: #6461 Change-Id: I7132a444bd7138123074bf5bc664b4bb119a85ce
* reformat URL attributesMike Bayer2021-05-121-11/+11
| | | | | | | | | these were using :var: which seems to not work now, not sure if this broke due to sphinx 1.4 or if this was broken anyway, but these are not even refs that can be picked up by zzzeeksphinx now. Change-Id: I24ae968ae5d870ec949b2b07dbad2afa6969a189
* Fix documentation type in URL classFederico Caselli2021-05-121-1/+1
| | | | Change-Id: I16a24718ee322efeffbf5a268d995ff53c23b696
* happy new yearMike Bayer2021-01-041-1/+1
| | | | Change-Id: Ic5bb19ca8be3cb47c95a0d3315d84cb484bac47c
* upgrade to black 20.8b1Mike Bayer2020-09-281-2/+4
| | | | | | | It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
* make URL immutableMike Bayer2020-08-251-47/+532
| | | | | | | | | | | | | | it's not really correct that URL is mutable and doesn't do any argument checking. propose replacing it with an immutable named tuple with rich copy-and-mutate methods. At the moment this makes a hard change to the CreateEnginePlugin docs that previously recommended url.query.pop(). I can't find any plugins on github other than my own that are using this feature, so see if we can just make a hard change on this one. Fixes: #5526 Change-Id: I28a0a471d80792fa8c28f4fa573d6352966a4a79
* Fix a wide variety of typos and broken linksaplatkouski2020-06-251-1/+1
| | | | | | | | | | | | Note the PR has a few remaining doc linking issues listed in the comment that must be addressed separately. Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com> Closes: #5371 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5371 Pull-request-sha: 7e7d233cf3a0c66980c27db0fcdb3c7d93bc2510 Change-Id: I9c36e8d8804483950db4b42c38ee456e384c59e3
* Fix query string escaping in engine URLsMiguel Grinberg2020-05-211-1/+1
| | | | | | | | | | | | | Fixed issue in :class:`.URL` object where stringifying the object would not URL encode special characters, preventing the URL from being re-consumable as a real URL. Pull request courtesy Miguel Grinberg. Fixes: #5341 Closes: #5342 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5342 Pull-request-sha: 362ca3398336a3a892e8020530f0c68d4f2d1d01 Change-Id: Ief6218122d1ec0c70479eb1a90e1c16433801924
* happy new yearMike Bayer2020-01-011-1/+1
| | | | Change-Id: I08440dc25e40ea1ccea1778f6ee9e28a00808235
* Add port comparison in __eq__() and __ne__() method to URLSanjana2019-02-281-0/+4
| | | | | | | | | | | | | | | | | Comparing two objects of :class:`.URL` using ``__eq__()`` did not take port number into consideration, two objects differing only by port number were considered equal. Port comparison is now added in ``__eq__()`` method of :class:`.URL`, objects differing by port number are now not equal. Additionally, ``__ne__()`` was not implemented for :class:`.URL` which caused unexpected result when ``!=`` was used in Python2, since there are no implied relationships among the comparison operators in Python2. Fixes: #4406 Closes: #4515 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4515 Pull-request-sha: 0f15b805f07e7fca1f82ca6c3aad98d50ea705b8 Change-Id: Iba7d224f1282dc3f4b884d1a746f2d46669f551e
* happy new yearMike Bayer2019-01-111-1/+1
| | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Post black reformattingMike Bayer2019-01-061-3/+6
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-50/+65
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Allow multiple plugin namesMike Bayer2018-02-131-5/+21
| | | | | | | | | | | | The :class:`.URL` object now allows query keys to be specified multiple times where their values will be joined into a list. This is to support the plugins feature documented at :class:`.CreateEnginePlugin` which documents that "plugin" can be passed multiple times. Additionally, the plugin names can be passed to :func:`.create_engine` outside of the URL using the new :paramref:`.create_engine.plugins` parameter. Change-Id: Ifc48ad120bd6c6204eda567492caf79832aeeaa5 Fixes: #4170
* happy new yearMike Bayer2018-01-121-1/+1
| | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* Allow url.password to be an objectMike Bayer2017-12-041-1/+12
| | | | | | | | | | | | The "password" attribute of the :class:`.url.URL` object can now be any user-defined or user-subclassed string object that responds to the Python ``str()`` builtin. The object passed will be maintained as the datamember :attr:`.url.URL.password_original` and will be consulted when the :attr:`.url.URL.password` attribute is read to produce the string value. Change-Id: I91d101c3b10e135ae7e4de60a5104b51776db84f Fixes: #4089
* New features from python 2.7Катаев Денис2017-03-171-1/+1
| | | | | | | After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
* Support python3.6Mike Bayer2017-01-131-1/+1
| | | | | | | | | | | Corrects some warnings and adds tox config. Adds DeprecationWarning to the error category. Large sweep for string literals w/ backslashes as this is common in docstrings Co-authored-by: Andrii Soldatenko Fixes: #3886 Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - Added a new entrypoint system to the engine to allow "plugins" toMike Bayer2016-01-061-1/+9
| | | | | | | | | | | be stated in the query string for a URL. Custom plugins can be written which will be given the chance up front to alter and/or consume the engine's URL and keyword arguments, and then at engine create time will be given the engine itself to allow additional modifications or event registration. Plugins are written as a subclass of :class:`.CreateEnginePlugin`; see that class for details. fixes #3536
* - fix some tests related to the URL change and try to makeMike Bayer2015-05-231-5/+11
| | | | the URL design a little simpler
* - Adjustments to the engine plugin hook, such that theMike Bayer2015-05-221-7/+11
| | | | | | | | :meth:`.URL.get_dialect` method will continue to return the ultimate :class:`.Dialect` object when a dialect plugin is used, without the need for the caller to be aware of the :meth:`.Dialect.get_dialect_cls` method. reference #3379
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - rework the exclusions system to have much better support for compoundMike Bayer2014-07-261-0/+12
| | | | rules, better message formatting
* PEP8 style fixesBrian Jarrett2014-07-131-5/+8
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - adjustment, the spec says: "Within the user and password field, any ":",Mike Bayer2013-11-251-2/+15
| | | | | | | "@", or "/" must be encoded." - so re-apply encoding to both password and username, don't encode spaces as plus signs, don't encode any chars outside of :, @, / on stringification - but we still parse for any %XX character (is that right?)
* - The :func:`.create_engine` routine and the relatedMike Bayer2013-11-241-7/+2
| | | | | | | :func:`.make_url` function **no longer URL encode the password**. Database passwords that include characters like spaces, plus signs and anything else should now represent these characters directly, without any URL escaping. [ticket:2873]
* Ensure API doc for make_url and resolve referencesVraj Mohan2013-11-131-2/+2
|
* - The regexp used by the :func:`.url.make_url` function now parsesMike Bayer2013-10-231-2/+11
| | | | ipv6 addresses, e.g. surrounded by brackets. [ticket:2851]
* Hide password in URL and Engine __repr__pr/25Gunnlaugur Þór Briem2013-09-061-2/+9
| | | | Fixes #2821
* find some more inline imports and move them outMike Bayer2013-08-041-1/+1
|
* do a sweep of some obvious 3kismsMike Bayer2013-05-261-1/+1
|
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-8/+5
|
* - the raw 2to3 runMike Bayer2013-04-271-9/+9
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/engine/Diana Clarke2012-11-191-9/+13
|
* - break out engine/base.py into base, interfaces, result, util.Mike Bayer2012-08-071-2/+2
| | | | - remove deprecated 0.7 engine methods
* more import cleanupsMike Bayer2012-08-071-3/+4
|
* - [feature] Added a new systemMike Bayer2012-04-241-42/+15
| | | | | | | for registration of new dialects in-process without using an entrypoint. See the docs for "Registering New Dialects". [ticket:2462]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - The entry point resolution supported byMike Bayer2011-09-241-2/+9
| | | | | | | | | create_engine() now supports resolution of individual DBAPI drivers on top of a built-in or entry point-resolved dialect, using the standard '+' notation - it's converted to a '.' before being resolved as an entry point. [ticket:2286]