Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/AUTHORS.rst +7 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/INSTALLER +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/LICENSE +21 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/METADATA +107 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/RECORD +32 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/WHEEL +5 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/top_level.txt +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/INSTALLER +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/LICENSE +174 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/METADATA +246 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/RECORD +68 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/WHEEL +5 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/top_level.txt +2 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/INSTALLER +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/LICENSE +19 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/METADATA +242 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/RECORD +530 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/REQUESTED +0 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/WHEEL +5 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/top_level.txt +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/_distutils_hack/__init__.py +220 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/_distutils_hack/override.py +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/INSTALLER +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/LICENSE.txt +165 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/METADATA +94 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/RECORD +132 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/REQUESTED +0 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/WHEEL +5 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/top_level.txt +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/__init__.py +110 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_adapters_map.py +296 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_cmodule.py +24 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_column.py +142 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_compat.py +72 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_dns.py +223 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_encodings.py +170 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_enums.py +79 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_pipeline.py +298 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_preparing.py +194 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_queries.py +415 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_struct.py +57 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_tpc.py +116 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_transform.py +354 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_typeinfo.py +500 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_tz.py +44 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_wrappers.py +137 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/version.py +14 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/waiting.py +393 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg_c-3.1.12.dist-info/INSTALLER +1 -0
- pgsql/pgAdmin 4/python/Lib/site-packages/psycopg_c-3.1.12.dist-info/LICENSE.txt +165 -0
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/AUTHORS.rst
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Authors
|
| 2 |
+
=======
|
| 3 |
+
|
| 4 |
+
``pyjwt`` is currently written and maintained by `Jose Padilla <https://github.com/jpadilla>`_.
|
| 5 |
+
Originally written and maintained by `Jeff Lindsay <https://github.com/progrium>`_.
|
| 6 |
+
|
| 7 |
+
A full list of contributors can be found on GitHub’s `overview <https://github.com/jpadilla/pyjwt/graphs/contributors>`_.
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2015-2022 José Padilla
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: PyJWT
|
| 3 |
+
Version: 2.8.0
|
| 4 |
+
Summary: JSON Web Token implementation in Python
|
| 5 |
+
Home-page: https://github.com/jpadilla/pyjwt
|
| 6 |
+
Author: Jose Padilla
|
| 7 |
+
Author-email: hello@jpadilla.com
|
| 8 |
+
License: MIT
|
| 9 |
+
Keywords: json,jwt,security,signing,token,web
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: Natural Language :: English
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 22 |
+
Classifier: Topic :: Utilities
|
| 23 |
+
Requires-Python: >=3.7
|
| 24 |
+
Description-Content-Type: text/x-rst
|
| 25 |
+
License-File: LICENSE
|
| 26 |
+
License-File: AUTHORS.rst
|
| 27 |
+
Requires-Dist: typing-extensions ; python_version <= "3.7"
|
| 28 |
+
Provides-Extra: crypto
|
| 29 |
+
Requires-Dist: cryptography (>=3.4.0) ; extra == 'crypto'
|
| 30 |
+
Provides-Extra: dev
|
| 31 |
+
Requires-Dist: sphinx (<5.0.0,>=4.5.0) ; extra == 'dev'
|
| 32 |
+
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
|
| 33 |
+
Requires-Dist: zope.interface ; extra == 'dev'
|
| 34 |
+
Requires-Dist: cryptography (>=3.4.0) ; extra == 'dev'
|
| 35 |
+
Requires-Dist: pytest (<7.0.0,>=6.0.0) ; extra == 'dev'
|
| 36 |
+
Requires-Dist: coverage[toml] (==5.0.4) ; extra == 'dev'
|
| 37 |
+
Requires-Dist: pre-commit ; extra == 'dev'
|
| 38 |
+
Provides-Extra: docs
|
| 39 |
+
Requires-Dist: sphinx (<5.0.0,>=4.5.0) ; extra == 'docs'
|
| 40 |
+
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
|
| 41 |
+
Requires-Dist: zope.interface ; extra == 'docs'
|
| 42 |
+
Provides-Extra: tests
|
| 43 |
+
Requires-Dist: pytest (<7.0.0,>=6.0.0) ; extra == 'tests'
|
| 44 |
+
Requires-Dist: coverage[toml] (==5.0.4) ; extra == 'tests'
|
| 45 |
+
|
| 46 |
+
PyJWT
|
| 47 |
+
=====
|
| 48 |
+
|
| 49 |
+
.. image:: https://github.com/jpadilla/pyjwt/workflows/CI/badge.svg
|
| 50 |
+
:target: https://github.com/jpadilla/pyjwt/actions?query=workflow%3ACI
|
| 51 |
+
|
| 52 |
+
.. image:: https://img.shields.io/pypi/v/pyjwt.svg
|
| 53 |
+
:target: https://pypi.python.org/pypi/pyjwt
|
| 54 |
+
|
| 55 |
+
.. image:: https://codecov.io/gh/jpadilla/pyjwt/branch/master/graph/badge.svg
|
| 56 |
+
:target: https://codecov.io/gh/jpadilla/pyjwt
|
| 57 |
+
|
| 58 |
+
.. image:: https://readthedocs.org/projects/pyjwt/badge/?version=stable
|
| 59 |
+
:target: https://pyjwt.readthedocs.io/en/stable/
|
| 60 |
+
|
| 61 |
+
A Python implementation of `RFC 7519 <https://tools.ietf.org/html/rfc7519>`_. Original implementation was written by `@progrium <https://github.com/progrium>`_.
|
| 62 |
+
|
| 63 |
+
Sponsor
|
| 64 |
+
-------
|
| 65 |
+
|
| 66 |
+
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 67 |
+
| |auth0-logo| | If you want to quickly add secure token-based authentication to Python projects, feel free to check Auth0's Python SDK and free plan at `auth0.com/developers <https://auth0.com/developers?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=pyjwt&utm_content=auth>`_. |
|
| 68 |
+
+--------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 69 |
+
|
| 70 |
+
.. |auth0-logo| image:: https://user-images.githubusercontent.com/83319/31722733-de95bbde-b3ea-11e7-96bf-4f4e8f915588.png
|
| 71 |
+
|
| 72 |
+
Installing
|
| 73 |
+
----------
|
| 74 |
+
|
| 75 |
+
Install with **pip**:
|
| 76 |
+
|
| 77 |
+
.. code-block:: console
|
| 78 |
+
|
| 79 |
+
$ pip install PyJWT
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
Usage
|
| 83 |
+
-----
|
| 84 |
+
|
| 85 |
+
.. code-block:: pycon
|
| 86 |
+
|
| 87 |
+
>>> import jwt
|
| 88 |
+
>>> encoded = jwt.encode({"some": "payload"}, "secret", algorithm="HS256")
|
| 89 |
+
>>> print(encoded)
|
| 90 |
+
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
|
| 91 |
+
>>> jwt.decode(encoded, "secret", algorithms=["HS256"])
|
| 92 |
+
{'some': 'payload'}
|
| 93 |
+
|
| 94 |
+
Documentation
|
| 95 |
+
-------------
|
| 96 |
+
|
| 97 |
+
View the full docs online at https://pyjwt.readthedocs.io/en/stable/
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
Tests
|
| 101 |
+
-----
|
| 102 |
+
|
| 103 |
+
You can run tests from the project root after cloning with:
|
| 104 |
+
|
| 105 |
+
.. code-block:: console
|
| 106 |
+
|
| 107 |
+
$ tox
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PyJWT-2.8.0.dist-info/AUTHORS.rst,sha256=klzkNGECnu2_VY7At89_xLBF3vUSDruXk3xwgUBxzwc,322
|
| 2 |
+
PyJWT-2.8.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 3 |
+
PyJWT-2.8.0.dist-info/LICENSE,sha256=eXp6ICMdTEM-nxkR2xcx0GtYKLmPSZgZoDT3wPVvXOU,1085
|
| 4 |
+
PyJWT-2.8.0.dist-info/METADATA,sha256=pV2XZjvithGcVesLHWAv0J4T5t8Qc66fip2sbxwoz1o,4160
|
| 5 |
+
PyJWT-2.8.0.dist-info/RECORD,,
|
| 6 |
+
PyJWT-2.8.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
| 7 |
+
PyJWT-2.8.0.dist-info/top_level.txt,sha256=RP5DHNyJbMq2ka0FmfTgoSaQzh7e3r5XuCWCO8a00k8,4
|
| 8 |
+
jwt/__init__.py,sha256=mV9lg6n4-0xiqCKaE1eEPC9a4j6sEkEYQcKghULE7kU,1670
|
| 9 |
+
jwt/__pycache__/__init__.cpython-311.pyc,,
|
| 10 |
+
jwt/__pycache__/algorithms.cpython-311.pyc,,
|
| 11 |
+
jwt/__pycache__/api_jwk.cpython-311.pyc,,
|
| 12 |
+
jwt/__pycache__/api_jws.cpython-311.pyc,,
|
| 13 |
+
jwt/__pycache__/api_jwt.cpython-311.pyc,,
|
| 14 |
+
jwt/__pycache__/exceptions.cpython-311.pyc,,
|
| 15 |
+
jwt/__pycache__/help.cpython-311.pyc,,
|
| 16 |
+
jwt/__pycache__/jwk_set_cache.cpython-311.pyc,,
|
| 17 |
+
jwt/__pycache__/jwks_client.cpython-311.pyc,,
|
| 18 |
+
jwt/__pycache__/types.cpython-311.pyc,,
|
| 19 |
+
jwt/__pycache__/utils.cpython-311.pyc,,
|
| 20 |
+
jwt/__pycache__/warnings.cpython-311.pyc,,
|
| 21 |
+
jwt/algorithms.py,sha256=RDsv5Lm3bzwsiWT3TynT7JR41R6H6s_fWUGOIqd9x_I,29800
|
| 22 |
+
jwt/api_jwk.py,sha256=HPxVqgBZm7RTaEXydciNBCuYNKDYOC_prTdaN9toGbo,4196
|
| 23 |
+
jwt/api_jws.py,sha256=da17RrDe0PDccTbx3rx2lLezEG_c_YGw_vVHa335IOk,11099
|
| 24 |
+
jwt/api_jwt.py,sha256=yF9DwF1kt3PA5n_TiU0OmHd0LtPHfe4JCE1XOfKPjw0,12638
|
| 25 |
+
jwt/exceptions.py,sha256=KDC3M7cTrpR4OQXVURlVMThem0pfANSgBxRz-ttivmo,1046
|
| 26 |
+
jwt/help.py,sha256=Jrp84fG43sCwmSIaDtY08I6ZR2VE7NhrTff89tYSE40,1749
|
| 27 |
+
jwt/jwk_set_cache.py,sha256=hBKmN-giU7-G37L_XKgc_OZu2ah4wdbj1ZNG_GkoSE8,959
|
| 28 |
+
jwt/jwks_client.py,sha256=9W8JVyGByQgoLbBN1u5iY1_jlgfnnukeOBTpqaM_9SE,4222
|
| 29 |
+
jwt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 30 |
+
jwt/types.py,sha256=VnhGv_VFu5a7_mrPoSCB7HaNLrJdhM8Sq1sSfEg0gLU,99
|
| 31 |
+
jwt/utils.py,sha256=PAI05_8MHQCxWQTDlwN0hTtTIT2DTTZ28mm1x6-26UY,3903
|
| 32 |
+
jwt/warnings.py,sha256=50XWOnyNsIaqzUJTk6XHNiIDykiL763GYA92MjTKmok,59
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.40.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyJWT-2.8.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
jwt
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: PyNaCl
|
| 3 |
+
Version: 1.5.0
|
| 4 |
+
Summary: Python binding to the Networking and Cryptography (NaCl) library
|
| 5 |
+
Home-page: https://github.com/pyca/pynacl/
|
| 6 |
+
Author: The PyNaCl developers
|
| 7 |
+
Author-email: cryptography-dev@python.org
|
| 8 |
+
License: Apache License 2.0
|
| 9 |
+
Platform: UNKNOWN
|
| 10 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 11 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 12 |
+
Classifier: Programming Language :: Python :: 3
|
| 13 |
+
Classifier: Programming Language :: Python :: 3.6
|
| 14 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 18 |
+
Requires-Python: >=3.6
|
| 19 |
+
License-File: LICENSE
|
| 20 |
+
Requires-Dist: cffi (>=1.4.1)
|
| 21 |
+
Provides-Extra: docs
|
| 22 |
+
Requires-Dist: sphinx (>=1.6.5) ; extra == 'docs'
|
| 23 |
+
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
|
| 24 |
+
Provides-Extra: tests
|
| 25 |
+
Requires-Dist: pytest (!=3.3.0,>=3.2.1) ; extra == 'tests'
|
| 26 |
+
Requires-Dist: hypothesis (>=3.27.0) ; extra == 'tests'
|
| 27 |
+
|
| 28 |
+
===============================================
|
| 29 |
+
PyNaCl: Python binding to the libsodium library
|
| 30 |
+
===============================================
|
| 31 |
+
|
| 32 |
+
.. image:: https://img.shields.io/pypi/v/pynacl.svg
|
| 33 |
+
:target: https://pypi.org/project/PyNaCl/
|
| 34 |
+
:alt: Latest Version
|
| 35 |
+
|
| 36 |
+
.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=main
|
| 37 |
+
:target: https://codecov.io/github/pyca/pynacl?branch=main
|
| 38 |
+
|
| 39 |
+
.. image:: https://img.shields.io/pypi/pyversions/pynacl.svg
|
| 40 |
+
:target: https://pypi.org/project/PyNaCl/
|
| 41 |
+
:alt: Compatible Python Versions
|
| 42 |
+
|
| 43 |
+
PyNaCl is a Python binding to `libsodium`_, which is a fork of the
|
| 44 |
+
`Networking and Cryptography library`_. These libraries have a stated goal of
|
| 45 |
+
improving usability, security and speed. It supports Python 3.6+ as well as
|
| 46 |
+
PyPy 3.
|
| 47 |
+
|
| 48 |
+
.. _libsodium: https://github.com/jedisct1/libsodium
|
| 49 |
+
.. _Networking and Cryptography library: https://nacl.cr.yp.to/
|
| 50 |
+
|
| 51 |
+
Features
|
| 52 |
+
--------
|
| 53 |
+
|
| 54 |
+
* Digital signatures
|
| 55 |
+
* Secret-key encryption
|
| 56 |
+
* Public-key encryption
|
| 57 |
+
* Hashing and message authentication
|
| 58 |
+
* Password based key derivation and password hashing
|
| 59 |
+
|
| 60 |
+
`Changelog`_
|
| 61 |
+
------------
|
| 62 |
+
|
| 63 |
+
.. _Changelog: https://pynacl.readthedocs.io/en/stable/changelog/
|
| 64 |
+
|
| 65 |
+
Installation
|
| 66 |
+
============
|
| 67 |
+
|
| 68 |
+
Binary wheel install
|
| 69 |
+
--------------------
|
| 70 |
+
|
| 71 |
+
PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ ,
|
| 72 |
+
so all dependencies are included. Make sure you have an up-to-date pip
|
| 73 |
+
and run:
|
| 74 |
+
|
| 75 |
+
.. code-block:: console
|
| 76 |
+
|
| 77 |
+
$ pip install pynacl
|
| 78 |
+
|
| 79 |
+
Faster wheel build
|
| 80 |
+
------------------
|
| 81 |
+
|
| 82 |
+
You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make``
|
| 83 |
+
and enable `parallelization`_:
|
| 84 |
+
|
| 85 |
+
.. code-block:: console
|
| 86 |
+
|
| 87 |
+
$ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl
|
| 88 |
+
|
| 89 |
+
Linux source build
|
| 90 |
+
------------------
|
| 91 |
+
|
| 92 |
+
PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled
|
| 93 |
+
with PyNaCl so to install you can run:
|
| 94 |
+
|
| 95 |
+
.. code-block:: console
|
| 96 |
+
|
| 97 |
+
$ pip install pynacl
|
| 98 |
+
|
| 99 |
+
If you'd prefer to use the version of ``libsodium`` provided by your
|
| 100 |
+
distribution, you can disable the bundled copy during install by running:
|
| 101 |
+
|
| 102 |
+
.. code-block:: console
|
| 103 |
+
|
| 104 |
+
$ SODIUM_INSTALL=system pip install pynacl
|
| 105 |
+
|
| 106 |
+
.. warning:: Usage of the legacy ``easy_install`` command provided by setuptools
|
| 107 |
+
is generally discouraged, and is completely unsupported in PyNaCl's case.
|
| 108 |
+
|
| 109 |
+
.. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html
|
| 110 |
+
|
| 111 |
+
.. _libsodium: https://github.com/jedisct1/libsodium
|
| 112 |
+
|
| 113 |
+
.. [#many] `manylinux1 wheels <https://www.python.org/dev/peps/pep-0513/>`_
|
| 114 |
+
are built on a baseline linux environment based on Centos 5.11
|
| 115 |
+
and should work on most x86 and x86_64 glibc based linux environments.
|
| 116 |
+
|
| 117 |
+
Changelog
|
| 118 |
+
=========
|
| 119 |
+
|
| 120 |
+
1.5.0 (2022-01-07)
|
| 121 |
+
------------------
|
| 122 |
+
|
| 123 |
+
* **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5.
|
| 124 |
+
* **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1``
|
| 125 |
+
wheels.
|
| 126 |
+
* Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS
|
| 127 |
+
``universal2`` wheels (the latter supports macOS ``arm64``).
|
| 128 |
+
* Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release).
|
| 129 |
+
* Add inline type hints.
|
| 130 |
+
|
| 131 |
+
1.4.0 (2020-05-25)
|
| 132 |
+
------------------
|
| 133 |
+
|
| 134 |
+
* Update ``libsodium`` to 1.0.18.
|
| 135 |
+
* **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1``
|
| 136 |
+
wheels. Continuing to produce them was a maintenance burden.
|
| 137 |
+
* Added support for Python 3.8, and removed support for Python 3.4.
|
| 138 |
+
* Add low level bindings for extracting the seed and the public key
|
| 139 |
+
from crypto_sign_ed25519 secret key
|
| 140 |
+
* Add low level bindings for deterministic random generation.
|
| 141 |
+
* Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485)
|
| 142 |
+
* Fix checks on very slow builders (#481, #495)
|
| 143 |
+
* Add low-level bindings to ed25519 arithmetic functions
|
| 144 |
+
* Update low-level blake2b state implementation
|
| 145 |
+
* Fix wrong short-input behavior of SealedBox.decrypt() (#517)
|
| 146 |
+
* Raise CryptPrefixError exception instead of InvalidkeyError when trying
|
| 147 |
+
to check a password against a verifier stored in a unknown format (#519)
|
| 148 |
+
* Add support for minimal builds of libsodium. Trying to call functions
|
| 149 |
+
not available in a minimal build will raise an UnavailableError
|
| 150 |
+
exception. To compile a minimal build of the bundled libsodium, set
|
| 151 |
+
the SODIUM_INSTALL_MINIMAL environment variable to any non-empty
|
| 152 |
+
string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup.
|
| 153 |
+
|
| 154 |
+
1.3.0 2018-09-26
|
| 155 |
+
----------------
|
| 156 |
+
|
| 157 |
+
* Added support for Python 3.7.
|
| 158 |
+
* Update ``libsodium`` to 1.0.16.
|
| 159 |
+
* Run and test all code examples in PyNaCl docs through sphinx's
|
| 160 |
+
doctest builder.
|
| 161 |
+
* Add low-level bindings for chacha20-poly1305 AEAD constructions.
|
| 162 |
+
* Add low-level bindings for the chacha20-poly1305 secretstream constructions.
|
| 163 |
+
* Add low-level bindings for ed25519ph pre-hashed signing construction.
|
| 164 |
+
* Add low-level bindings for constant-time increment and addition
|
| 165 |
+
on fixed-precision big integers represented as little-endian
|
| 166 |
+
byte sequences.
|
| 167 |
+
* Add low-level bindings for the ISO/IEC 7816-4 compatible padding API.
|
| 168 |
+
* Add low-level bindings for libsodium's crypto_kx... key exchange
|
| 169 |
+
construction.
|
| 170 |
+
* Set hypothesis deadline to None in tests/test_pwhash.py to avoid
|
| 171 |
+
incorrect test failures on slower processor architectures. GitHub
|
| 172 |
+
issue #370
|
| 173 |
+
|
| 174 |
+
1.2.1 - 2017-12-04
|
| 175 |
+
------------------
|
| 176 |
+
|
| 177 |
+
* Update hypothesis minimum allowed version.
|
| 178 |
+
* Infrastructure: add proper configuration for readthedocs builder
|
| 179 |
+
runtime environment.
|
| 180 |
+
|
| 181 |
+
1.2.0 - 2017-11-01
|
| 182 |
+
------------------
|
| 183 |
+
|
| 184 |
+
* Update ``libsodium`` to 1.0.15.
|
| 185 |
+
* Infrastructure: add jenkins support for automatic build of
|
| 186 |
+
``manylinux1`` binary wheels
|
| 187 |
+
* Added support for ``SealedBox`` construction.
|
| 188 |
+
* Added support for ``argon2i`` and ``argon2id`` password hashing constructs
|
| 189 |
+
and restructured high-level password hashing implementation to expose
|
| 190 |
+
the same interface for all hashers.
|
| 191 |
+
* Added support for 128 bit ``siphashx24`` variant of ``siphash24``.
|
| 192 |
+
* Added support for ``from_seed`` APIs for X25519 keypair generation.
|
| 193 |
+
* Dropped support for Python 3.3.
|
| 194 |
+
|
| 195 |
+
1.1.2 - 2017-03-31
|
| 196 |
+
------------------
|
| 197 |
+
|
| 198 |
+
* reorder link time library search path when using bundled
|
| 199 |
+
libsodium
|
| 200 |
+
|
| 201 |
+
1.1.1 - 2017-03-15
|
| 202 |
+
------------------
|
| 203 |
+
|
| 204 |
+
* Fixed a circular import bug in ``nacl.utils``.
|
| 205 |
+
|
| 206 |
+
1.1.0 - 2017-03-14
|
| 207 |
+
------------------
|
| 208 |
+
|
| 209 |
+
* Dropped support for Python 2.6.
|
| 210 |
+
* Added ``shared_key()`` method on ``Box``.
|
| 211 |
+
* You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or
|
| 212 |
+
``SecretBox`` and it will automatically generate a random nonce.
|
| 213 |
+
* Added support for ``siphash24``.
|
| 214 |
+
* Added support for ``blake2b``.
|
| 215 |
+
* Added support for ``scrypt``.
|
| 216 |
+
* Update ``libsodium`` to 1.0.11.
|
| 217 |
+
* Default to the bundled ``libsodium`` when compiling.
|
| 218 |
+
* All raised exceptions are defined mixing-in
|
| 219 |
+
``nacl.exceptions.CryptoError``
|
| 220 |
+
|
| 221 |
+
1.0.1 - 2016-01-24
|
| 222 |
+
------------------
|
| 223 |
+
|
| 224 |
+
* Fix an issue with absolute paths that prevented the creation of wheels.
|
| 225 |
+
|
| 226 |
+
1.0 - 2016-01-23
|
| 227 |
+
----------------
|
| 228 |
+
|
| 229 |
+
* PyNaCl has been ported to use the new APIs available in cffi 1.0+.
|
| 230 |
+
Due to this change we no longer support PyPy releases older than 2.6.
|
| 231 |
+
* Python 3.2 support has been dropped.
|
| 232 |
+
* Functions to convert between Ed25519 and Curve25519 keys have been added.
|
| 233 |
+
|
| 234 |
+
0.3.0 - 2015-03-04
|
| 235 |
+
------------------
|
| 236 |
+
|
| 237 |
+
* The low-level API (`nacl.c.*`) has been changed to match the
|
| 238 |
+
upstream NaCl C/C++ conventions (as well as those of other NaCl bindings).
|
| 239 |
+
The order of arguments and return values has changed significantly. To
|
| 240 |
+
avoid silent failures, `nacl.c` has been removed, and replaced with
|
| 241 |
+
`nacl.bindings` (with the new argument ordering). If you have code which
|
| 242 |
+
calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review
|
| 243 |
+
the new docstrings and update your code/imports to match the new
|
| 244 |
+
conventions.
|
| 245 |
+
|
| 246 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PyNaCl-1.5.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
PyNaCl-1.5.0.dist-info/LICENSE,sha256=d69bve2VkRS216XupRiyvjZOBPT0qV-eh9mHDCdxPSQ,9868
|
| 3 |
+
PyNaCl-1.5.0.dist-info/METADATA,sha256=U9PLLkcKk_YC_Tl5OSoMiAmblalKU9qFsRtxiwa-TiM,8656
|
| 4 |
+
PyNaCl-1.5.0.dist-info/RECORD,,
|
| 5 |
+
PyNaCl-1.5.0.dist-info/WHEEL,sha256=nYCSW5p8tLyDU-wbqo3uRlCluAzwxLmyyRK2pVs4-Ag,100
|
| 6 |
+
PyNaCl-1.5.0.dist-info/top_level.txt,sha256=wfdEOI_G2RIzmzsMyhpqP17HUh6Jcqi99to9aHLEslo,13
|
| 7 |
+
nacl/__init__.py,sha256=W0JhVbFcnhlrEtK0tdRGDcX8aucbKCQmRBmf9hGFWQY,1155
|
| 8 |
+
nacl/__pycache__/__init__.cpython-311.pyc,,
|
| 9 |
+
nacl/__pycache__/encoding.cpython-311.pyc,,
|
| 10 |
+
nacl/__pycache__/exceptions.cpython-311.pyc,,
|
| 11 |
+
nacl/__pycache__/hash.cpython-311.pyc,,
|
| 12 |
+
nacl/__pycache__/hashlib.cpython-311.pyc,,
|
| 13 |
+
nacl/__pycache__/public.cpython-311.pyc,,
|
| 14 |
+
nacl/__pycache__/secret.cpython-311.pyc,,
|
| 15 |
+
nacl/__pycache__/signing.cpython-311.pyc,,
|
| 16 |
+
nacl/__pycache__/utils.cpython-311.pyc,,
|
| 17 |
+
nacl/_sodium.pyd,sha256=1zPCPGpLIWJaT_B_ZWK6iCvL2w9QgmJpQZ2N4FdPiM0,348672
|
| 18 |
+
nacl/bindings/__init__.py,sha256=erC7ta0z7XQSmfeYcnCVhFKqBtkkK6wJq8PKsEnjqSg,17448
|
| 19 |
+
nacl/bindings/__pycache__/__init__.cpython-311.pyc,,
|
| 20 |
+
nacl/bindings/__pycache__/crypto_aead.cpython-311.pyc,,
|
| 21 |
+
nacl/bindings/__pycache__/crypto_box.cpython-311.pyc,,
|
| 22 |
+
nacl/bindings/__pycache__/crypto_core.cpython-311.pyc,,
|
| 23 |
+
nacl/bindings/__pycache__/crypto_generichash.cpython-311.pyc,,
|
| 24 |
+
nacl/bindings/__pycache__/crypto_hash.cpython-311.pyc,,
|
| 25 |
+
nacl/bindings/__pycache__/crypto_kx.cpython-311.pyc,,
|
| 26 |
+
nacl/bindings/__pycache__/crypto_pwhash.cpython-311.pyc,,
|
| 27 |
+
nacl/bindings/__pycache__/crypto_scalarmult.cpython-311.pyc,,
|
| 28 |
+
nacl/bindings/__pycache__/crypto_secretbox.cpython-311.pyc,,
|
| 29 |
+
nacl/bindings/__pycache__/crypto_secretstream.cpython-311.pyc,,
|
| 30 |
+
nacl/bindings/__pycache__/crypto_shorthash.cpython-311.pyc,,
|
| 31 |
+
nacl/bindings/__pycache__/crypto_sign.cpython-311.pyc,,
|
| 32 |
+
nacl/bindings/__pycache__/randombytes.cpython-311.pyc,,
|
| 33 |
+
nacl/bindings/__pycache__/sodium_core.cpython-311.pyc,,
|
| 34 |
+
nacl/bindings/__pycache__/utils.cpython-311.pyc,,
|
| 35 |
+
nacl/bindings/crypto_aead.py,sha256=fxSgpeI48HkxwsZEk9cTxigdJ5k7PvMh1mxr7M0LK9A,16156
|
| 36 |
+
nacl/bindings/crypto_box.py,sha256=6M7qSZu806POBtEoK5e9Ui-JcSYaFDI6tTnllVJ0F7U,10463
|
| 37 |
+
nacl/bindings/crypto_core.py,sha256=KccKcEGpoEsQjkYRcwpsBse-g_iGXNgQHeb1gCdZR4E,14148
|
| 38 |
+
nacl/bindings/crypto_generichash.py,sha256=8nEG1ntZSqVOTAV6-_EZg-gNbV5UJc-SbDUa2GdkxRs,9133
|
| 39 |
+
nacl/bindings/crypto_hash.py,sha256=8GO8el_rZgD2ITJyEbiejHXZimfrxckXc9cUppv1vpk,2238
|
| 40 |
+
nacl/bindings/crypto_kx.py,sha256=8gmFRbU7NKHqCLZ1HsObilmeTboYFW6tEJCEUucje9Q,6923
|
| 41 |
+
nacl/bindings/crypto_pwhash.py,sha256=sIugQ9Rx8KTy3vnOsQwz_kV2PhqwqVOsfbkR_sKnudc,19448
|
| 42 |
+
nacl/bindings/crypto_scalarmult.py,sha256=gMNDgWl-P6ua8I3kAM2yt4dNzK9gY742C424z-yBMUU,8484
|
| 43 |
+
nacl/bindings/crypto_secretbox.py,sha256=WEX2_Ea79pQkUshr_sVlslA28Zx_66tYFawW1qipleY,3000
|
| 44 |
+
nacl/bindings/crypto_secretstream.py,sha256=3uZN9XET8AeFKn365K2gfcZKYjkOFfyLr8GCUw8Wx6g,11522
|
| 45 |
+
nacl/bindings/crypto_shorthash.py,sha256=NDmmvG77ZhGLmbK0USoLW2dOveUcGdUFqL1fi5ozcDc,2684
|
| 46 |
+
nacl/bindings/crypto_sign.py,sha256=IMKXZCAb8oF0tLQR6UcpJk0zTRFDeW4IWNvo9XdZfgw,10669
|
| 47 |
+
nacl/bindings/randombytes.py,sha256=JmR-o2Bpj1ssJp8GDj4KgutPknEZGgogUSdnW4kRI5Q,1614
|
| 48 |
+
nacl/bindings/sodium_core.py,sha256=8o4mDDahmmAIf4Xk3hJE5C-B6Ms5mbeu64_ylW9kY6I,1072
|
| 49 |
+
nacl/bindings/utils.py,sha256=2WefZr1MOFTWKn6h6ODuw4u8D9PEfDWMaayXiPUm6RA,4439
|
| 50 |
+
nacl/encoding.py,sha256=xKwjFb5F1jEfmazetwtaQpsUPvzYLh3RU6Wkiq56NzI,3020
|
| 51 |
+
nacl/exceptions.py,sha256=gM8gN01HFGCUw8L1VjmEhBPf00r-igNJo-nAEsrhEBU,2539
|
| 52 |
+
nacl/hash.py,sha256=_H8JOPecwna4GP8CaMorghfetykbuO9q4oteek9bfVo,6574
|
| 53 |
+
nacl/hashlib.py,sha256=x74Z29ExS3e5yFV0Mzij9gnU_eRKWwkD6YPYfI5eUFw,4543
|
| 54 |
+
nacl/public.py,sha256=kVoz1R9zkNnczDUsBDnYYXL_6C9jsga6ph3rk32uFNo,15215
|
| 55 |
+
nacl/pwhash/__init__.py,sha256=2vX9OivKZsrMVjh2vjfbdBVDsUml8AEnIRsa1d6ZzG0,2750
|
| 56 |
+
nacl/pwhash/__pycache__/__init__.cpython-311.pyc,,
|
| 57 |
+
nacl/pwhash/__pycache__/_argon2.cpython-311.pyc,,
|
| 58 |
+
nacl/pwhash/__pycache__/argon2i.cpython-311.pyc,,
|
| 59 |
+
nacl/pwhash/__pycache__/argon2id.cpython-311.pyc,,
|
| 60 |
+
nacl/pwhash/__pycache__/scrypt.cpython-311.pyc,,
|
| 61 |
+
nacl/pwhash/_argon2.py,sha256=uR1Y_DnX8RZIfmTHborlXWcJ-re_wDryOIhVYssjj8I,1828
|
| 62 |
+
nacl/pwhash/argon2i.py,sha256=dJmM_bVP0LALK9I4TfaZsWqEah7z7sprd3mw8TRPr-4,4537
|
| 63 |
+
nacl/pwhash/argon2id.py,sha256=dJ7kpU-b07YzMPlrsMW9K_tV-xnA0bE7pj-ZFo-z0wc,4568
|
| 64 |
+
nacl/pwhash/scrypt.py,sha256=_qbeDojJzzE42RvwwUsELA8pGgXDInb1ht6ec1w3_1Y,7197
|
| 65 |
+
nacl/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 66 |
+
nacl/secret.py,sha256=YShCAvKF7sHAGOBRSnWKMJvJChQ7SuhlQXRCz32MdrM,12413
|
| 67 |
+
nacl/signing.py,sha256=CR9ZRXYSrdZFkNiIQTIplFS8UQ0Z_OzXqaaQ_HdhSQ4,8587
|
| 68 |
+
nacl/utils.py,sha256=iEQ0LtPtyV7Cqo4wpn9CvQunwsM5ShEZlO9IvT1r4dk,2429
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.37.1)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp36-abi3-win_amd64
|
| 5 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/PyNaCl-1.5.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_sodium
|
| 2 |
+
nacl
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2005-2024 SQLAlchemy authors and contributors <see AUTHORS file>.
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 4 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 5 |
+
the Software without restriction, including without limitation the rights to
|
| 6 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
| 7 |
+
of the Software, and to permit persons to whom the Software is furnished to do
|
| 8 |
+
so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in all
|
| 11 |
+
copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 19 |
+
SOFTWARE.
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/METADATA
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: SQLAlchemy
|
| 3 |
+
Version: 2.0.30
|
| 4 |
+
Summary: Database Abstraction Library
|
| 5 |
+
Home-page: https://www.sqlalchemy.org
|
| 6 |
+
Author: Mike Bayer
|
| 7 |
+
Author-email: mike_mp@zzzcomputing.com
|
| 8 |
+
License: MIT
|
| 9 |
+
Project-URL: Documentation, https://docs.sqlalchemy.org
|
| 10 |
+
Project-URL: Issue Tracker, https://github.com/sqlalchemy/sqlalchemy/
|
| 11 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Operating System :: OS Independent
|
| 15 |
+
Classifier: Programming Language :: Python
|
| 16 |
+
Classifier: Programming Language :: Python :: 3
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 23 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 24 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 25 |
+
Classifier: Topic :: Database :: Front-Ends
|
| 26 |
+
Requires-Python: >=3.7
|
| 27 |
+
Description-Content-Type: text/x-rst
|
| 28 |
+
License-File: LICENSE
|
| 29 |
+
Requires-Dist: typing-extensions >=4.6.0
|
| 30 |
+
Requires-Dist: greenlet !=0.4.17 ; platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))
|
| 31 |
+
Requires-Dist: importlib-metadata ; python_version < "3.8"
|
| 32 |
+
Provides-Extra: aiomysql
|
| 33 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'aiomysql'
|
| 34 |
+
Requires-Dist: aiomysql >=0.2.0 ; extra == 'aiomysql'
|
| 35 |
+
Provides-Extra: aioodbc
|
| 36 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'aioodbc'
|
| 37 |
+
Requires-Dist: aioodbc ; extra == 'aioodbc'
|
| 38 |
+
Provides-Extra: aiosqlite
|
| 39 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'aiosqlite'
|
| 40 |
+
Requires-Dist: aiosqlite ; extra == 'aiosqlite'
|
| 41 |
+
Requires-Dist: typing-extensions !=3.10.0.1 ; extra == 'aiosqlite'
|
| 42 |
+
Provides-Extra: asyncio
|
| 43 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'asyncio'
|
| 44 |
+
Provides-Extra: asyncmy
|
| 45 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'asyncmy'
|
| 46 |
+
Requires-Dist: asyncmy !=0.2.4,!=0.2.6,>=0.2.3 ; extra == 'asyncmy'
|
| 47 |
+
Provides-Extra: mariadb_connector
|
| 48 |
+
Requires-Dist: mariadb !=1.1.2,!=1.1.5,>=1.0.1 ; extra == 'mariadb_connector'
|
| 49 |
+
Provides-Extra: mssql
|
| 50 |
+
Requires-Dist: pyodbc ; extra == 'mssql'
|
| 51 |
+
Provides-Extra: mssql_pymssql
|
| 52 |
+
Requires-Dist: pymssql ; extra == 'mssql_pymssql'
|
| 53 |
+
Provides-Extra: mssql_pyodbc
|
| 54 |
+
Requires-Dist: pyodbc ; extra == 'mssql_pyodbc'
|
| 55 |
+
Provides-Extra: mypy
|
| 56 |
+
Requires-Dist: mypy >=0.910 ; extra == 'mypy'
|
| 57 |
+
Provides-Extra: mysql
|
| 58 |
+
Requires-Dist: mysqlclient >=1.4.0 ; extra == 'mysql'
|
| 59 |
+
Provides-Extra: mysql_connector
|
| 60 |
+
Requires-Dist: mysql-connector-python ; extra == 'mysql_connector'
|
| 61 |
+
Provides-Extra: oracle
|
| 62 |
+
Requires-Dist: cx-oracle >=8 ; extra == 'oracle'
|
| 63 |
+
Provides-Extra: oracle_oracledb
|
| 64 |
+
Requires-Dist: oracledb >=1.0.1 ; extra == 'oracle_oracledb'
|
| 65 |
+
Provides-Extra: postgresql
|
| 66 |
+
Requires-Dist: psycopg2 >=2.7 ; extra == 'postgresql'
|
| 67 |
+
Provides-Extra: postgresql_asyncpg
|
| 68 |
+
Requires-Dist: greenlet !=0.4.17 ; extra == 'postgresql_asyncpg'
|
| 69 |
+
Requires-Dist: asyncpg ; extra == 'postgresql_asyncpg'
|
| 70 |
+
Provides-Extra: postgresql_pg8000
|
| 71 |
+
Requires-Dist: pg8000 >=1.29.1 ; extra == 'postgresql_pg8000'
|
| 72 |
+
Provides-Extra: postgresql_psycopg
|
| 73 |
+
Requires-Dist: psycopg >=3.0.7 ; extra == 'postgresql_psycopg'
|
| 74 |
+
Provides-Extra: postgresql_psycopg2binary
|
| 75 |
+
Requires-Dist: psycopg2-binary ; extra == 'postgresql_psycopg2binary'
|
| 76 |
+
Provides-Extra: postgresql_psycopg2cffi
|
| 77 |
+
Requires-Dist: psycopg2cffi ; extra == 'postgresql_psycopg2cffi'
|
| 78 |
+
Provides-Extra: postgresql_psycopgbinary
|
| 79 |
+
Requires-Dist: psycopg[binary] >=3.0.7 ; extra == 'postgresql_psycopgbinary'
|
| 80 |
+
Provides-Extra: pymysql
|
| 81 |
+
Requires-Dist: pymysql ; extra == 'pymysql'
|
| 82 |
+
Provides-Extra: sqlcipher
|
| 83 |
+
Requires-Dist: sqlcipher3-binary ; extra == 'sqlcipher'
|
| 84 |
+
|
| 85 |
+
SQLAlchemy
|
| 86 |
+
==========
|
| 87 |
+
|
| 88 |
+
|PyPI| |Python| |Downloads|
|
| 89 |
+
|
| 90 |
+
.. |PyPI| image:: https://img.shields.io/pypi/v/sqlalchemy
|
| 91 |
+
:target: https://pypi.org/project/sqlalchemy
|
| 92 |
+
:alt: PyPI
|
| 93 |
+
|
| 94 |
+
.. |Python| image:: https://img.shields.io/pypi/pyversions/sqlalchemy
|
| 95 |
+
:target: https://pypi.org/project/sqlalchemy
|
| 96 |
+
:alt: PyPI - Python Version
|
| 97 |
+
|
| 98 |
+
.. |Downloads| image:: https://static.pepy.tech/badge/sqlalchemy/month
|
| 99 |
+
:target: https://pepy.tech/project/sqlalchemy
|
| 100 |
+
:alt: PyPI - Downloads
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
The Python SQL Toolkit and Object Relational Mapper
|
| 104 |
+
|
| 105 |
+
Introduction
|
| 106 |
+
-------------
|
| 107 |
+
|
| 108 |
+
SQLAlchemy is the Python SQL toolkit and Object Relational Mapper
|
| 109 |
+
that gives application developers the full power and
|
| 110 |
+
flexibility of SQL. SQLAlchemy provides a full suite
|
| 111 |
+
of well known enterprise-level persistence patterns,
|
| 112 |
+
designed for efficient and high-performing database
|
| 113 |
+
access, adapted into a simple and Pythonic domain
|
| 114 |
+
language.
|
| 115 |
+
|
| 116 |
+
Major SQLAlchemy features include:
|
| 117 |
+
|
| 118 |
+
* An industrial strength ORM, built
|
| 119 |
+
from the core on the identity map, unit of work,
|
| 120 |
+
and data mapper patterns. These patterns
|
| 121 |
+
allow transparent persistence of objects
|
| 122 |
+
using a declarative configuration system.
|
| 123 |
+
Domain models
|
| 124 |
+
can be constructed and manipulated naturally,
|
| 125 |
+
and changes are synchronized with the
|
| 126 |
+
current transaction automatically.
|
| 127 |
+
* A relationally-oriented query system, exposing
|
| 128 |
+
the full range of SQL's capabilities
|
| 129 |
+
explicitly, including joins, subqueries,
|
| 130 |
+
correlation, and most everything else,
|
| 131 |
+
in terms of the object model.
|
| 132 |
+
Writing queries with the ORM uses the same
|
| 133 |
+
techniques of relational composition you use
|
| 134 |
+
when writing SQL. While you can drop into
|
| 135 |
+
literal SQL at any time, it's virtually never
|
| 136 |
+
needed.
|
| 137 |
+
* A comprehensive and flexible system
|
| 138 |
+
of eager loading for related collections and objects.
|
| 139 |
+
Collections are cached within a session,
|
| 140 |
+
and can be loaded on individual access, all
|
| 141 |
+
at once using joins, or by query per collection
|
| 142 |
+
across the full result set.
|
| 143 |
+
* A Core SQL construction system and DBAPI
|
| 144 |
+
interaction layer. The SQLAlchemy Core is
|
| 145 |
+
separate from the ORM and is a full database
|
| 146 |
+
abstraction layer in its own right, and includes
|
| 147 |
+
an extensible Python-based SQL expression
|
| 148 |
+
language, schema metadata, connection pooling,
|
| 149 |
+
type coercion, and custom types.
|
| 150 |
+
* All primary and foreign key constraints are
|
| 151 |
+
assumed to be composite and natural. Surrogate
|
| 152 |
+
integer primary keys are of course still the
|
| 153 |
+
norm, but SQLAlchemy never assumes or hardcodes
|
| 154 |
+
to this model.
|
| 155 |
+
* Database introspection and generation. Database
|
| 156 |
+
schemas can be "reflected" in one step into
|
| 157 |
+
Python structures representing database metadata;
|
| 158 |
+
those same structures can then generate
|
| 159 |
+
CREATE statements right back out - all within
|
| 160 |
+
the Core, independent of the ORM.
|
| 161 |
+
|
| 162 |
+
SQLAlchemy's philosophy:
|
| 163 |
+
|
| 164 |
+
* SQL databases behave less and less like object
|
| 165 |
+
collections the more size and performance start to
|
| 166 |
+
matter; object collections behave less and less like
|
| 167 |
+
tables and rows the more abstraction starts to matter.
|
| 168 |
+
SQLAlchemy aims to accommodate both of these
|
| 169 |
+
principles.
|
| 170 |
+
* An ORM doesn't need to hide the "R". A relational
|
| 171 |
+
database provides rich, set-based functionality
|
| 172 |
+
that should be fully exposed. SQLAlchemy's
|
| 173 |
+
ORM provides an open-ended set of patterns
|
| 174 |
+
that allow a developer to construct a custom
|
| 175 |
+
mediation layer between a domain model and
|
| 176 |
+
a relational schema, turning the so-called
|
| 177 |
+
"object relational impedance" issue into
|
| 178 |
+
a distant memory.
|
| 179 |
+
* The developer, in all cases, makes all decisions
|
| 180 |
+
regarding the design, structure, and naming conventions
|
| 181 |
+
of both the object model as well as the relational
|
| 182 |
+
schema. SQLAlchemy only provides the means
|
| 183 |
+
to automate the execution of these decisions.
|
| 184 |
+
* With SQLAlchemy, there's no such thing as
|
| 185 |
+
"the ORM generated a bad query" - you
|
| 186 |
+
retain full control over the structure of
|
| 187 |
+
queries, including how joins are organized,
|
| 188 |
+
how subqueries and correlation is used, what
|
| 189 |
+
columns are requested. Everything SQLAlchemy
|
| 190 |
+
does is ultimately the result of a developer-initiated
|
| 191 |
+
decision.
|
| 192 |
+
* Don't use an ORM if the problem doesn't need one.
|
| 193 |
+
SQLAlchemy consists of a Core and separate ORM
|
| 194 |
+
component. The Core offers a full SQL expression
|
| 195 |
+
language that allows Pythonic construction
|
| 196 |
+
of SQL constructs that render directly to SQL
|
| 197 |
+
strings for a target database, returning
|
| 198 |
+
result sets that are essentially enhanced DBAPI
|
| 199 |
+
cursors.
|
| 200 |
+
* Transactions should be the norm. With SQLAlchemy's
|
| 201 |
+
ORM, nothing goes to permanent storage until
|
| 202 |
+
commit() is called. SQLAlchemy encourages applications
|
| 203 |
+
to create a consistent means of delineating
|
| 204 |
+
the start and end of a series of operations.
|
| 205 |
+
* Never render a literal value in a SQL statement.
|
| 206 |
+
Bound parameters are used to the greatest degree
|
| 207 |
+
possible, allowing query optimizers to cache
|
| 208 |
+
query plans effectively and making SQL injection
|
| 209 |
+
attacks a non-issue.
|
| 210 |
+
|
| 211 |
+
Documentation
|
| 212 |
+
-------------
|
| 213 |
+
|
| 214 |
+
Latest documentation is at:
|
| 215 |
+
|
| 216 |
+
https://www.sqlalchemy.org/docs/
|
| 217 |
+
|
| 218 |
+
Installation / Requirements
|
| 219 |
+
---------------------------
|
| 220 |
+
|
| 221 |
+
Full documentation for installation is at
|
| 222 |
+
`Installation <https://www.sqlalchemy.org/docs/intro.html#installation>`_.
|
| 223 |
+
|
| 224 |
+
Getting Help / Development / Bug reporting
|
| 225 |
+
------------------------------------------
|
| 226 |
+
|
| 227 |
+
Please refer to the `SQLAlchemy Community Guide <https://www.sqlalchemy.org/support.html>`_.
|
| 228 |
+
|
| 229 |
+
Code of Conduct
|
| 230 |
+
---------------
|
| 231 |
+
|
| 232 |
+
Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
|
| 233 |
+
constructive communication between users and developers.
|
| 234 |
+
Please see our current Code of Conduct at
|
| 235 |
+
`Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_.
|
| 236 |
+
|
| 237 |
+
License
|
| 238 |
+
-------
|
| 239 |
+
|
| 240 |
+
SQLAlchemy is distributed under the `MIT license
|
| 241 |
+
<https://www.opensource.org/licenses/mit-license.php>`_.
|
| 242 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/RECORD
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-info/WHEEL,sha256=nSybvzWlmdJnHiUQSY-d7V1ycwEVUTqXiTvr2eshg44,102
|
| 7 |
+
SQLAlchemy-2.0.30.dist-info/top_level.txt,sha256=rp-ZgB7D8G11ivXON5VGPjupT1voYmWqkciDt5Uaw_Q,11
|
| 8 |
+
sqlalchemy/__init__.py,sha256=5bmbSs8TTDzkjc4FtkQKI8WvmicPtjfPg-zCQhte1eI,13327
|
| 9 |
+
sqlalchemy/__pycache__/__init__.cpython-311.pyc,,
|
| 10 |
+
sqlalchemy/__pycache__/events.cpython-311.pyc,,
|
| 11 |
+
sqlalchemy/__pycache__/exc.cpython-311.pyc,,
|
| 12 |
+
sqlalchemy/__pycache__/inspection.cpython-311.pyc,,
|
| 13 |
+
sqlalchemy/__pycache__/log.cpython-311.pyc,,
|
| 14 |
+
sqlalchemy/__pycache__/schema.cpython-311.pyc,,
|
| 15 |
+
sqlalchemy/__pycache__/types.cpython-311.pyc,,
|
| 16 |
+
sqlalchemy/connectors/__init__.py,sha256=A2AI8p63aT0jT5CsVX33xlTfiGWliOcGahlK0RyTLXg,494
|
| 17 |
+
sqlalchemy/connectors/__pycache__/__init__.cpython-311.pyc,,
|
| 18 |
+
sqlalchemy/connectors/__pycache__/aioodbc.cpython-311.pyc,,
|
| 19 |
+
sqlalchemy/connectors/__pycache__/asyncio.cpython-311.pyc,,
|
| 20 |
+
sqlalchemy/connectors/__pycache__/pyodbc.cpython-311.pyc,,
|
| 21 |
+
sqlalchemy/connectors/aioodbc.py,sha256=fg3xfG-5gLsy-DSyVonNNKYhOf0_lzHmixRFa5edtWI,5462
|
| 22 |
+
sqlalchemy/connectors/asyncio.py,sha256=OHCD6Jtk0RBjmS4DGVwngAqBSVsLe6Auj4IrJMh6Lvc,6082
|
| 23 |
+
sqlalchemy/connectors/pyodbc.py,sha256=IG5lLCyFbnv1wB85HQuMO3S5piWHaB660OBWvBIQhbg,8750
|
| 24 |
+
sqlalchemy/cyextension/__init__.py,sha256=Hlfk91RinbOuNF_fybR5R2UtiIcTeUOXS66QOfSSCV0,250
|
| 25 |
+
sqlalchemy/cyextension/__pycache__/__init__.cpython-311.pyc,,
|
| 26 |
+
sqlalchemy/cyextension/collections.cp311-win_amd64.pyd,sha256=lHBCKiG8IB7uP7nz0MlJyKpUxjpUu_w9O5WBsiPwq0U,175104
|
| 27 |
+
sqlalchemy/cyextension/collections.pyx,sha256=GXPkr9cHRLW3Vcu-ik3dVBZMR-zf0Q5_K4J-_8yV-gk,12980
|
| 28 |
+
sqlalchemy/cyextension/immutabledict.cp311-win_amd64.pyd,sha256=mFLMhNRta3uYfdSCq2ah5ai3KK09c0I6T5JrZrYkfe0,72704
|
| 29 |
+
sqlalchemy/cyextension/immutabledict.pxd,sha256=5iGndSbJCgCkNmRbJ_z14RANs2dSSnAzyiRPUTBk58Y,299
|
| 30 |
+
sqlalchemy/cyextension/immutabledict.pyx,sha256=IhB2pR49CrORXQ3LXMFpuCIRc6I08QNvIylE1cPQA5o,3668
|
| 31 |
+
sqlalchemy/cyextension/processors.cp311-win_amd64.pyd,sha256=YLQHyoN_7JijAuwBt1lbHQwU1jQRjEZXxnshm40oyb4,58368
|
| 32 |
+
sqlalchemy/cyextension/processors.pyx,sha256=V9gzqXiNHWsa5DBgYl-3KzclFHY8kXGF_TD1xHFE7eM,1860
|
| 33 |
+
sqlalchemy/cyextension/resultproxy.cp311-win_amd64.pyd,sha256=IsBgDSN0SYKheogaDMKswUWNgdkuHHyhThprTfbW9CY,60928
|
| 34 |
+
sqlalchemy/cyextension/resultproxy.pyx,sha256=h_RrKasbLtKK3LqUh6UiWtkumBlKtcN5eeB_1bZROMA,2827
|
| 35 |
+
sqlalchemy/cyextension/util.cp311-win_amd64.pyd,sha256=viHyeVi1yiqnP0qjfWwUcJLH5LrbZsWRZlI3z9hpsFU,72704
|
| 36 |
+
sqlalchemy/cyextension/util.pyx,sha256=50QYpSAKgLSUfhFEQgSN2e1qHWCMh_b6ZNlErDUS7ec,2621
|
| 37 |
+
sqlalchemy/dialects/__init__.py,sha256=SJfQyxMhOL58EB-S6GQv_0jf2oP7MMfmVdlV2UxGWQo,1831
|
| 38 |
+
sqlalchemy/dialects/__pycache__/__init__.cpython-311.pyc,,
|
| 39 |
+
sqlalchemy/dialects/__pycache__/_typing.cpython-311.pyc,,
|
| 40 |
+
sqlalchemy/dialects/_typing.py,sha256=mN2r8mU8z-mRh4YS3VeK8Nv_IKJmE0Mb1CrJ-ptILas,913
|
| 41 |
+
sqlalchemy/dialects/mssql/__init__.py,sha256=r3oTfX2LLbJAGhM57wdPLWxaZBzunkcmyaTbW0FjLuY,1968
|
| 42 |
+
sqlalchemy/dialects/mssql/__pycache__/__init__.cpython-311.pyc,,
|
| 43 |
+
sqlalchemy/dialects/mssql/__pycache__/aioodbc.cpython-311.pyc,,
|
| 44 |
+
sqlalchemy/dialects/mssql/__pycache__/base.cpython-311.pyc,,
|
| 45 |
+
sqlalchemy/dialects/mssql/__pycache__/information_schema.cpython-311.pyc,,
|
| 46 |
+
sqlalchemy/dialects/mssql/__pycache__/json.cpython-311.pyc,,
|
| 47 |
+
sqlalchemy/dialects/mssql/__pycache__/provision.cpython-311.pyc,,
|
| 48 |
+
sqlalchemy/dialects/mssql/__pycache__/pymssql.cpython-311.pyc,,
|
| 49 |
+
sqlalchemy/dialects/mssql/__pycache__/pyodbc.cpython-311.pyc,,
|
| 50 |
+
sqlalchemy/dialects/mssql/aioodbc.py,sha256=b9bhUKcVj4NzoqJIDfECeE_Rmt51sRy8OOUFz_R3vpg,2086
|
| 51 |
+
sqlalchemy/dialects/mssql/base.py,sha256=eGtwgBdABesJ0AnVTXl6HnisZaCB42TZlN6POgpf0ss,136308
|
| 52 |
+
sqlalchemy/dialects/mssql/information_schema.py,sha256=A1UJAoFb3UtE8YCY3heBgeTMkzWq3j7C2caZ3gcMGZk,8338
|
| 53 |
+
sqlalchemy/dialects/mssql/json.py,sha256=nZVVsgmR4Z4dNn9cv5Gucq596gsQ0MvASPuEEtz-Gek,4949
|
| 54 |
+
sqlalchemy/dialects/mssql/provision.py,sha256=pa-b74Xr2qsto3BFG1O0I_B25TUT3TOecg6cAKuRcf8,5517
|
| 55 |
+
sqlalchemy/dialects/mssql/pymssql.py,sha256=f7xqRif9Dp64de9G8yuC4OyWArwXy_oVq5X0oiwIX4E,4163
|
| 56 |
+
sqlalchemy/dialects/mssql/pyodbc.py,sha256=YVI19AnrqxPCBwDqcjrO_rqUUWbV2re7E8iLuV1ilqE,27801
|
| 57 |
+
sqlalchemy/dialects/mysql/__init__.py,sha256=PPQDwNqcpxWMt3nFQ66KefX9T9iz7d8lybEwKlfXB1U,2254
|
| 58 |
+
sqlalchemy/dialects/mysql/__pycache__/__init__.cpython-311.pyc,,
|
| 59 |
+
sqlalchemy/dialects/mysql/__pycache__/aiomysql.cpython-311.pyc,,
|
| 60 |
+
sqlalchemy/dialects/mysql/__pycache__/asyncmy.cpython-311.pyc,,
|
| 61 |
+
sqlalchemy/dialects/mysql/__pycache__/base.cpython-311.pyc,,
|
| 62 |
+
sqlalchemy/dialects/mysql/__pycache__/cymysql.cpython-311.pyc,,
|
| 63 |
+
sqlalchemy/dialects/mysql/__pycache__/dml.cpython-311.pyc,,
|
| 64 |
+
sqlalchemy/dialects/mysql/__pycache__/enumerated.cpython-311.pyc,,
|
| 65 |
+
sqlalchemy/dialects/mysql/__pycache__/expression.cpython-311.pyc,,
|
| 66 |
+
sqlalchemy/dialects/mysql/__pycache__/json.cpython-311.pyc,,
|
| 67 |
+
sqlalchemy/dialects/mysql/__pycache__/mariadb.cpython-311.pyc,,
|
| 68 |
+
sqlalchemy/dialects/mysql/__pycache__/mariadbconnector.cpython-311.pyc,,
|
| 69 |
+
sqlalchemy/dialects/mysql/__pycache__/mysqlconnector.cpython-311.pyc,,
|
| 70 |
+
sqlalchemy/dialects/mysql/__pycache__/mysqldb.cpython-311.pyc,,
|
| 71 |
+
sqlalchemy/dialects/mysql/__pycache__/provision.cpython-311.pyc,,
|
| 72 |
+
sqlalchemy/dialects/mysql/__pycache__/pymysql.cpython-311.pyc,,
|
| 73 |
+
sqlalchemy/dialects/mysql/__pycache__/pyodbc.cpython-311.pyc,,
|
| 74 |
+
sqlalchemy/dialects/mysql/__pycache__/reflection.cpython-311.pyc,,
|
| 75 |
+
sqlalchemy/dialects/mysql/__pycache__/reserved_words.cpython-311.pyc,,
|
| 76 |
+
sqlalchemy/dialects/mysql/__pycache__/types.cpython-311.pyc,,
|
| 77 |
+
sqlalchemy/dialects/mysql/aiomysql.py,sha256=-YFqFQEx0M2pww3xvsOlaVKflTeoUfIsM8BgfhP1MP0,10296
|
| 78 |
+
sqlalchemy/dialects/mysql/asyncmy.py,sha256=h9BBhGsqPG2LWdoh0lPieRLhaQ_BJrhxwsR_G5yPLDQ,10370
|
| 79 |
+
sqlalchemy/dialects/mysql/base.py,sha256=LQ-nvj7HIQSntwAycof93th3kpMBatHl402HNQ8z9hc,124297
|
| 80 |
+
sqlalchemy/dialects/mysql/cymysql.py,sha256=0mRP3gFe2t7iJYQqJz1Os_TztFwMAF34w2MmXe-4B_w,2384
|
| 81 |
+
sqlalchemy/dialects/mysql/dml.py,sha256=n31-m4vfOIL0MdHpUdIfTLgaMzusfQ-yHYoJWO_ndEc,7864
|
| 82 |
+
sqlalchemy/dialects/mysql/enumerated.py,sha256=Nz9Sv3ENX-1T18aEoOY8QfZlAcwRf65lIOse7vwjil8,8692
|
| 83 |
+
sqlalchemy/dialects/mysql/expression.py,sha256=uxD1fICubfGh8BhAn6WoeS8AF6hAVEvreDShXqRZTqM,4238
|
| 84 |
+
sqlalchemy/dialects/mysql/json.py,sha256=i0Lrd_7VKTd3fNm6kQKzrtPERuW0JeSw7XSUWnl1HQI,2350
|
| 85 |
+
sqlalchemy/dialects/mysql/mariadb.py,sha256=WoNxkjiPfIbWAkrVEU9MTM7mePeLHZ2uiJsyfvcpv1s,885
|
| 86 |
+
sqlalchemy/dialects/mysql/mariadbconnector.py,sha256=76uTMieZ6o3_m0HCP1hdamMWjovy5-fK_mk8SfNrD34,8843
|
| 87 |
+
sqlalchemy/dialects/mysql/mysqlconnector.py,sha256=1ga6IV7lVLH9BKsMh2M2wSz78l5a82BZnyRqJMaS5Qw,5854
|
| 88 |
+
sqlalchemy/dialects/mysql/mysqldb.py,sha256=l9bse7w0BwZrM96A_LKdyK4p0D_ksjflLX_OShj4JTk,9805
|
| 89 |
+
sqlalchemy/dialects/mysql/provision.py,sha256=2ecdVRnZSXy5GF3hpLtQp3T8QW-oFjtTSQgbEePDH1k,3581
|
| 90 |
+
sqlalchemy/dialects/mysql/pymysql.py,sha256=Kxi_A34-nbQ5UEFSmy14TXc1v43-1SZ8gE628REGTFo,4220
|
| 91 |
+
sqlalchemy/dialects/mysql/pyodbc.py,sha256=CZCEnhyLIgbuiAW32Cw7N1m1aiQv1eBB34pV-txOs70,4435
|
| 92 |
+
sqlalchemy/dialects/mysql/reflection.py,sha256=wn8qKHxDb9Dnr8zC_uEgAVjk2lVuObvqPOEiad8568c,23499
|
| 93 |
+
sqlalchemy/dialects/mysql/reserved_words.py,sha256=qzej7CIVFz2Q2ywue7nKL59cca2kzXhKpDOSQYMlxjU,9829
|
| 94 |
+
sqlalchemy/dialects/mysql/types.py,sha256=wqfI5QZ8__Uzn9cYefTMZ387cJJJgbNkCDE9Ax2k1pY,25117
|
| 95 |
+
sqlalchemy/dialects/oracle/__init__.py,sha256=_yFT_k0R6yc7MKQG-Al9QZt8wYZsiCtpkhNlba5xqn8,1560
|
| 96 |
+
sqlalchemy/dialects/oracle/__pycache__/__init__.cpython-311.pyc,,
|
| 97 |
+
sqlalchemy/dialects/oracle/__pycache__/base.cpython-311.pyc,,
|
| 98 |
+
sqlalchemy/dialects/oracle/__pycache__/cx_oracle.cpython-311.pyc,,
|
| 99 |
+
sqlalchemy/dialects/oracle/__pycache__/dictionary.cpython-311.pyc,,
|
| 100 |
+
sqlalchemy/dialects/oracle/__pycache__/oracledb.cpython-311.pyc,,
|
| 101 |
+
sqlalchemy/dialects/oracle/__pycache__/provision.cpython-311.pyc,,
|
| 102 |
+
sqlalchemy/dialects/oracle/__pycache__/types.cpython-311.pyc,,
|
| 103 |
+
sqlalchemy/dialects/oracle/base.py,sha256=haztCHFbuhnhpcBUr8h1PDLXAavdwtpIjgOg_PSDI_A,121486
|
| 104 |
+
sqlalchemy/dialects/oracle/cx_oracle.py,sha256=3Tx3DKvqcCKyXupBuCiCL4B8D5TDO934Q7LYsLJjlkk,57058
|
| 105 |
+
sqlalchemy/dialects/oracle/dictionary.py,sha256=tmAZLEACqBAPBE0SEV2jr1R4aPcpNOrbomJl-UmgiR4,20026
|
| 106 |
+
sqlalchemy/dialects/oracle/oracledb.py,sha256=kuw08rp-tXKPOtGGutqcs5o2gvRptQXAzNBqPVZoLxg,9798
|
| 107 |
+
sqlalchemy/dialects/oracle/provision.py,sha256=KKlXDQnC8n6BjLJWA7AJg3lwXluH1OyStqfP2Uf9rq0,8524
|
| 108 |
+
sqlalchemy/dialects/oracle/types.py,sha256=U9EReFRcr0PiwOxT9vg2cA7WOix8LQ2sVp0gRkMHcPo,8518
|
| 109 |
+
sqlalchemy/dialects/postgresql/__init__.py,sha256=C0BhKzUkClwGfAetbBIEd4KQohOtSmfHo5TwhoZLCK0,4059
|
| 110 |
+
sqlalchemy/dialects/postgresql/__pycache__/__init__.cpython-311.pyc,,
|
| 111 |
+
sqlalchemy/dialects/postgresql/__pycache__/_psycopg_common.cpython-311.pyc,,
|
| 112 |
+
sqlalchemy/dialects/postgresql/__pycache__/array.cpython-311.pyc,,
|
| 113 |
+
sqlalchemy/dialects/postgresql/__pycache__/asyncpg.cpython-311.pyc,,
|
| 114 |
+
sqlalchemy/dialects/postgresql/__pycache__/base.cpython-311.pyc,,
|
| 115 |
+
sqlalchemy/dialects/postgresql/__pycache__/dml.cpython-311.pyc,,
|
| 116 |
+
sqlalchemy/dialects/postgresql/__pycache__/ext.cpython-311.pyc,,
|
| 117 |
+
sqlalchemy/dialects/postgresql/__pycache__/hstore.cpython-311.pyc,,
|
| 118 |
+
sqlalchemy/dialects/postgresql/__pycache__/json.cpython-311.pyc,,
|
| 119 |
+
sqlalchemy/dialects/postgresql/__pycache__/named_types.cpython-311.pyc,,
|
| 120 |
+
sqlalchemy/dialects/postgresql/__pycache__/operators.cpython-311.pyc,,
|
| 121 |
+
sqlalchemy/dialects/postgresql/__pycache__/pg8000.cpython-311.pyc,,
|
| 122 |
+
sqlalchemy/dialects/postgresql/__pycache__/pg_catalog.cpython-311.pyc,,
|
| 123 |
+
sqlalchemy/dialects/postgresql/__pycache__/provision.cpython-311.pyc,,
|
| 124 |
+
sqlalchemy/dialects/postgresql/__pycache__/psycopg.cpython-311.pyc,,
|
| 125 |
+
sqlalchemy/dialects/postgresql/__pycache__/psycopg2.cpython-311.pyc,,
|
| 126 |
+
sqlalchemy/dialects/postgresql/__pycache__/psycopg2cffi.cpython-311.pyc,,
|
| 127 |
+
sqlalchemy/dialects/postgresql/__pycache__/ranges.cpython-311.pyc,,
|
| 128 |
+
sqlalchemy/dialects/postgresql/__pycache__/types.cpython-311.pyc,,
|
| 129 |
+
sqlalchemy/dialects/postgresql/_psycopg_common.py,sha256=fYFqLVxNxAqh3nOvzGOv3Pfpm2BsclHrk71MJZrpJKo,5883
|
| 130 |
+
sqlalchemy/dialects/postgresql/array.py,sha256=_vzfyGBY1NsT6blooCgHrLC38VZbM4UWKQHgXLmmyYs,14159
|
| 131 |
+
sqlalchemy/dialects/postgresql/asyncpg.py,sha256=g2pZ8FhZtyE8-tD33WEFD2nA9H3mANq2mUtfiag1GIs,41502
|
| 132 |
+
sqlalchemy/dialects/postgresql/base.py,sha256=wS7qpm6T_MpcV5wlcPPAxFun75wOshKq9eXqLRqeAdQ,183996
|
| 133 |
+
sqlalchemy/dialects/postgresql/dml.py,sha256=uMiqxEkji-UXqk8gO1ramQEvEfCugYmy8Cv1cnG7DQs,11522
|
| 134 |
+
sqlalchemy/dialects/postgresql/ext.py,sha256=ct6NQfMAfBnLYhybpF2wPEq-p8-U0tEpy-aq8NwqJLw,16758
|
| 135 |
+
sqlalchemy/dialects/postgresql/hstore.py,sha256=4jAZQMPWl3VE4weDRZrgrbVDRZJTM3X0Xj4twr5znYQ,11938
|
| 136 |
+
sqlalchemy/dialects/postgresql/json.py,sha256=XSt9Vj71cv-FFpaOVMt-hiJ8Id-nVgup_V0eRAMU4SM,11542
|
| 137 |
+
sqlalchemy/dialects/postgresql/named_types.py,sha256=Ykl4GWSf5pQynkAWfZsAjgYU0R_TSvEvaZrb8mI4PuQ,18103
|
| 138 |
+
sqlalchemy/dialects/postgresql/operators.py,sha256=iyZuyx_daRyJjiS5rw-XnZlaWj1bmRiHdy5MXzBrFZw,2937
|
| 139 |
+
sqlalchemy/dialects/postgresql/pg8000.py,sha256=TPJXX078vW0FSwZ-DlWNkEOXg7Z4xk8IFwi1droMhPw,19302
|
| 140 |
+
sqlalchemy/dialects/postgresql/pg_catalog.py,sha256=rG_AGLtjSQ6DAnkqAiurYpnIuLhN9Ib_QydWbmjK--s,9554
|
| 141 |
+
sqlalchemy/dialects/postgresql/provision.py,sha256=Uo_6vxVzFryFjLqsrvesRO55VqHrnsAs_pBH_8JtFcA,5937
|
| 142 |
+
sqlalchemy/dialects/postgresql/psycopg.py,sha256=kL1wUUN7V-GlveQPdf7iVWtthUZVJQNW9wNASX3RotI,24159
|
| 143 |
+
sqlalchemy/dialects/postgresql/psycopg2.py,sha256=4aYG9D0ZdYMtGZ-jtCxB8094N7ddpfp2hQJ7PmziqYo,32481
|
| 144 |
+
sqlalchemy/dialects/postgresql/psycopg2cffi.py,sha256=hFg-9GH08ApPy3foVPUdJKwCEzNSv2zD5l4nH97AqgI,1817
|
| 145 |
+
sqlalchemy/dialects/postgresql/ranges.py,sha256=oiTmnZ-hd5WqqGNsXbuOJfoNxpbso_M_49gky8dlCrE,33978
|
| 146 |
+
sqlalchemy/dialects/postgresql/types.py,sha256=pd1QmuGwJFLqpY2tK-Ql3FNjtT1Ha-lVvfaR9dimvHc,7603
|
| 147 |
+
sqlalchemy/dialects/sqlite/__init__.py,sha256=MmQfjHun1U_4q-Dq_yhs9RzAX0VLixSwWeY5xWiDwag,1239
|
| 148 |
+
sqlalchemy/dialects/sqlite/__pycache__/__init__.cpython-311.pyc,,
|
| 149 |
+
sqlalchemy/dialects/sqlite/__pycache__/aiosqlite.cpython-311.pyc,,
|
| 150 |
+
sqlalchemy/dialects/sqlite/__pycache__/base.cpython-311.pyc,,
|
| 151 |
+
sqlalchemy/dialects/sqlite/__pycache__/dml.cpython-311.pyc,,
|
| 152 |
+
sqlalchemy/dialects/sqlite/__pycache__/json.cpython-311.pyc,,
|
| 153 |
+
sqlalchemy/dialects/sqlite/__pycache__/provision.cpython-311.pyc,,
|
| 154 |
+
sqlalchemy/dialects/sqlite/__pycache__/pysqlcipher.cpython-311.pyc,,
|
| 155 |
+
sqlalchemy/dialects/sqlite/__pycache__/pysqlite.cpython-311.pyc,,
|
| 156 |
+
sqlalchemy/dialects/sqlite/aiosqlite.py,sha256=TgobCILLu2mjGvDgMTxX3-CPxkj_c5LDYRDJHo5W5qg,12701
|
| 157 |
+
sqlalchemy/dialects/sqlite/base.py,sha256=8Ft5tZeT1lHiWliTwoJaNslf8PRITVKKWhjhhRCeVDk,99576
|
| 158 |
+
sqlalchemy/dialects/sqlite/dml.py,sha256=8JV6Ise7WtmFniy590X5b19AYZcE51M6N5hef7d9JoA,8683
|
| 159 |
+
sqlalchemy/dialects/sqlite/json.py,sha256=-9afZnBt07vInCX20CKzjlTG85wHTO5_cxhcYU4phDc,2869
|
| 160 |
+
sqlalchemy/dialects/sqlite/provision.py,sha256=nAXZPEjXFrb6a1LxXZMqKmkQoXgl3MPsSHuMyBQ76NU,5830
|
| 161 |
+
sqlalchemy/dialects/sqlite/pysqlcipher.py,sha256=p0KfzHBwANDMwKTKEJCjR5RxMYqQwS4E8KXjl3Bx6Fw,5511
|
| 162 |
+
sqlalchemy/dialects/sqlite/pysqlite.py,sha256=l1nNdt0e4P4LiqesERAt8sngot8jh8sDc7HZDL_R14Q,28801
|
| 163 |
+
sqlalchemy/dialects/type_migration_guidelines.txt,sha256=gyh3JCauAIFi_9XEfqm3vYv_jb2Eqcz2HjpmC9ZEPMM,8384
|
| 164 |
+
sqlalchemy/engine/__init__.py,sha256=93FWhb62dLCidc6e4FE65wq_P8GeoWQG1OG6RZMBqhM,2880
|
| 165 |
+
sqlalchemy/engine/__pycache__/__init__.cpython-311.pyc,,
|
| 166 |
+
sqlalchemy/engine/__pycache__/_py_processors.cpython-311.pyc,,
|
| 167 |
+
sqlalchemy/engine/__pycache__/_py_row.cpython-311.pyc,,
|
| 168 |
+
sqlalchemy/engine/__pycache__/_py_util.cpython-311.pyc,,
|
| 169 |
+
sqlalchemy/engine/__pycache__/base.cpython-311.pyc,,
|
| 170 |
+
sqlalchemy/engine/__pycache__/characteristics.cpython-311.pyc,,
|
| 171 |
+
sqlalchemy/engine/__pycache__/create.cpython-311.pyc,,
|
| 172 |
+
sqlalchemy/engine/__pycache__/cursor.cpython-311.pyc,,
|
| 173 |
+
sqlalchemy/engine/__pycache__/default.cpython-311.pyc,,
|
| 174 |
+
sqlalchemy/engine/__pycache__/events.cpython-311.pyc,,
|
| 175 |
+
sqlalchemy/engine/__pycache__/interfaces.cpython-311.pyc,,
|
| 176 |
+
sqlalchemy/engine/__pycache__/mock.cpython-311.pyc,,
|
| 177 |
+
sqlalchemy/engine/__pycache__/processors.cpython-311.pyc,,
|
| 178 |
+
sqlalchemy/engine/__pycache__/reflection.cpython-311.pyc,,
|
| 179 |
+
sqlalchemy/engine/__pycache__/result.cpython-311.pyc,,
|
| 180 |
+
sqlalchemy/engine/__pycache__/row.cpython-311.pyc,,
|
| 181 |
+
sqlalchemy/engine/__pycache__/strategies.cpython-311.pyc,,
|
| 182 |
+
sqlalchemy/engine/__pycache__/url.cpython-311.pyc,,
|
| 183 |
+
sqlalchemy/engine/__pycache__/util.cpython-311.pyc,,
|
| 184 |
+
sqlalchemy/engine/_py_processors.py,sha256=-jlAYPM6etmuKeViiI7BD41kqY0Pr8nzaox22TPqCCQ,3880
|
| 185 |
+
sqlalchemy/engine/_py_row.py,sha256=UEGCjAeRsggcUn0QB0PdFC82kuykrOiOZ1KGq_Gf_qQ,3915
|
| 186 |
+
sqlalchemy/engine/_py_util.py,sha256=nh1XoVq1b-eGgkdzbqFqzje0RNSmVWotoa6yaB7J5Sw,2558
|
| 187 |
+
sqlalchemy/engine/base.py,sha256=kKfJ47SMw3LHw4LzfAXzunnGVAL44DFRS_s3c42OVww,126271
|
| 188 |
+
sqlalchemy/engine/characteristics.py,sha256=hfTuHv_WxSNHOS_LFIypSb27lqoZKRXIQKyT7ay5lTY,4920
|
| 189 |
+
sqlalchemy/engine/create.py,sha256=-SCpvMx3DIwt8TD6Cyh_ChieKQ8y3hDD9YLDBIKgY6o,34081
|
| 190 |
+
sqlalchemy/engine/cursor.py,sha256=zKN-AiwE-0KkvdWqhg8dOAT4R1U1a4I0tFgAqzihSnE,78573
|
| 191 |
+
sqlalchemy/engine/default.py,sha256=4y8rliMWsWeMd1gGEljZH0dNrJ1JoXwj36tKfVfic7k,86485
|
| 192 |
+
sqlalchemy/engine/events.py,sha256=e0VHj69fH20sB7gocBhr5Rs2FjR8ioY4iE8VQt70oJg,38332
|
| 193 |
+
sqlalchemy/engine/interfaces.py,sha256=xc_QjKogI0vWG1BQMb-0pexDrmgyy1jQR9xvRW5ECOE,116227
|
| 194 |
+
sqlalchemy/engine/mock.py,sha256=wInBRiHwydTc5ELQLivdezDd1ikbSMVXgLVzZrSC0iQ,4310
|
| 195 |
+
sqlalchemy/engine/processors.py,sha256=w4MiVMlU6VvfhIW49nygbHcwX8FteGpz7g3IGEqtZb8,2440
|
| 196 |
+
sqlalchemy/engine/reflection.py,sha256=TO-tymk7BsfAzc6Fi0GmwtYyOWjfMGkyvytJyMVz_oY,77216
|
| 197 |
+
sqlalchemy/engine/result.py,sha256=U245Q3kGUOugqjmv-qSkx8eyDn27fLYV5agIoBHXQCA,79985
|
| 198 |
+
sqlalchemy/engine/row.py,sha256=g7ZqmsqX_BtRUzY-zfXoZZ4-5xZ_KJEVbvqKHUIlqRg,12433
|
| 199 |
+
sqlalchemy/engine/strategies.py,sha256=fD4DJn0AD371wlUa7s5Sy4j7QtgGyP7gMy_kUyqCLDQ,461
|
| 200 |
+
sqlalchemy/engine/url.py,sha256=tOCRmKkqrpsIfNeSDoy6KKTLtQAMtoIn9xa5kmJQebk,31694
|
| 201 |
+
sqlalchemy/engine/util.py,sha256=wIrPulEwr7kAxJ-vNj5QSPGNfWoFx5B4zzJdXu_ZIFg,5849
|
| 202 |
+
sqlalchemy/event/__init__.py,sha256=09qZzHwt0PkIDsPwuPUVJvNakjtCBjuUJeY0AEJ9j7k,1022
|
| 203 |
+
sqlalchemy/event/__pycache__/__init__.cpython-311.pyc,,
|
| 204 |
+
sqlalchemy/event/__pycache__/api.cpython-311.pyc,,
|
| 205 |
+
sqlalchemy/event/__pycache__/attr.cpython-311.pyc,,
|
| 206 |
+
sqlalchemy/event/__pycache__/base.cpython-311.pyc,,
|
| 207 |
+
sqlalchemy/event/__pycache__/legacy.cpython-311.pyc,,
|
| 208 |
+
sqlalchemy/event/__pycache__/registry.cpython-311.pyc,,
|
| 209 |
+
sqlalchemy/event/api.py,sha256=I7XWFczjgl3RcBH_52TbQ0S3_W4RZz1Be9dXkxtFw5U,8451
|
| 210 |
+
sqlalchemy/event/attr.py,sha256=-SHjzXMOs7IICPSgNwpgRS3FIEeLIpB5PyvVlpw8Gp8,21406
|
| 211 |
+
sqlalchemy/event/base.py,sha256=haAsH-KuvvY52A6OjwATfvCXy3hdYGgZxkDZiOqbMvI,15416
|
| 212 |
+
sqlalchemy/event/legacy.py,sha256=a8VEvS83PvgbomNnaSa3okZmTkxl_buZ7Lfilechjh8,8473
|
| 213 |
+
sqlalchemy/event/registry.py,sha256=f31k0FLqIlWpOK9tksiYXnv-yuZPPz9iLQqvKEYV7ko,11221
|
| 214 |
+
sqlalchemy/events.py,sha256=OAy8TK21lWzSe8bDUnAbmsP82bsBYy0LL19hR6y3BrM,542
|
| 215 |
+
sqlalchemy/exc.py,sha256=k01TD2xp2BM3DrXdo2U5r8yuRfsoqBND4kwvtD1SVN0,24806
|
| 216 |
+
sqlalchemy/ext/__init__.py,sha256=YbMQmRS_9HxRyWM-KA_F76WOss1_Em1ZcrnQDIDXoOc,333
|
| 217 |
+
sqlalchemy/ext/__pycache__/__init__.cpython-311.pyc,,
|
| 218 |
+
sqlalchemy/ext/__pycache__/associationproxy.cpython-311.pyc,,
|
| 219 |
+
sqlalchemy/ext/__pycache__/automap.cpython-311.pyc,,
|
| 220 |
+
sqlalchemy/ext/__pycache__/baked.cpython-311.pyc,,
|
| 221 |
+
sqlalchemy/ext/__pycache__/compiler.cpython-311.pyc,,
|
| 222 |
+
sqlalchemy/ext/__pycache__/horizontal_shard.cpython-311.pyc,,
|
| 223 |
+
sqlalchemy/ext/__pycache__/hybrid.cpython-311.pyc,,
|
| 224 |
+
sqlalchemy/ext/__pycache__/indexable.cpython-311.pyc,,
|
| 225 |
+
sqlalchemy/ext/__pycache__/instrumentation.cpython-311.pyc,,
|
| 226 |
+
sqlalchemy/ext/__pycache__/mutable.cpython-311.pyc,,
|
| 227 |
+
sqlalchemy/ext/__pycache__/orderinglist.cpython-311.pyc,,
|
| 228 |
+
sqlalchemy/ext/__pycache__/serializer.cpython-311.pyc,,
|
| 229 |
+
sqlalchemy/ext/associationproxy.py,sha256=MBtGwISA4wwT9i6op8jfY6u9lCUYn_4JCqtxZpjggok,67776
|
| 230 |
+
sqlalchemy/ext/asyncio/__init__.py,sha256=tKYIrERYf8hov9m8DuKWRO_53qhrvj2jRmIYjSGQ2Po,1342
|
| 231 |
+
sqlalchemy/ext/asyncio/__pycache__/__init__.cpython-311.pyc,,
|
| 232 |
+
sqlalchemy/ext/asyncio/__pycache__/base.cpython-311.pyc,,
|
| 233 |
+
sqlalchemy/ext/asyncio/__pycache__/engine.cpython-311.pyc,,
|
| 234 |
+
sqlalchemy/ext/asyncio/__pycache__/exc.cpython-311.pyc,,
|
| 235 |
+
sqlalchemy/ext/asyncio/__pycache__/result.cpython-311.pyc,,
|
| 236 |
+
sqlalchemy/ext/asyncio/__pycache__/scoping.cpython-311.pyc,,
|
| 237 |
+
sqlalchemy/ext/asyncio/__pycache__/session.cpython-311.pyc,,
|
| 238 |
+
sqlalchemy/ext/asyncio/base.py,sha256=slWQTFdgQQlkzrnx3m5a9xT8IRg4iM0gkEbypXr_YXQ,9184
|
| 239 |
+
sqlalchemy/ext/asyncio/engine.py,sha256=HJ5IZD0_xfVOMEGYZ1XtDir73SpzBk6ODDUN75ltvzo,49656
|
| 240 |
+
sqlalchemy/ext/asyncio/exc.py,sha256=0awLfUB4PhEPVVTKYluyor1tW91GPZZnvdQ-GGSOmJY,660
|
| 241 |
+
sqlalchemy/ext/asyncio/result.py,sha256=MtKAqA7hwYIdkpRxlCgHNYYzlB7dvqCtEp-aoDdFjDA,31370
|
| 242 |
+
sqlalchemy/ext/asyncio/scoping.py,sha256=CiMQ7ewPNsyEtl9aGOiEZOrUaNYOTP_LrR0_xkdV3r8,54211
|
| 243 |
+
sqlalchemy/ext/asyncio/session.py,sha256=vqP3qYsUyVqXas30zdMmnymXLrNCYqgExeWrgK-Hcn0,65028
|
| 244 |
+
sqlalchemy/ext/automap.py,sha256=q9_8jk1puxgfGiYTX5il6snOHNv6bOAE7nRlQbym_cY,63280
|
| 245 |
+
sqlalchemy/ext/baked.py,sha256=jc6vPocoXXsvdZsOsqgT4kG6guWSZD1TdPjoRBmkbRU,18381
|
| 246 |
+
sqlalchemy/ext/compiler.py,sha256=PbvelWqZdzL6y1C6rEc8ledF79t_04MtYV26RUwNhik,20946
|
| 247 |
+
sqlalchemy/ext/declarative/__init__.py,sha256=MHSOffOS4MWcqshAuLNQv0vDXpK_Z3lpGXTm1riyLls,1883
|
| 248 |
+
sqlalchemy/ext/declarative/__pycache__/__init__.cpython-311.pyc,,
|
| 249 |
+
sqlalchemy/ext/declarative/__pycache__/extensions.cpython-311.pyc,,
|
| 250 |
+
sqlalchemy/ext/declarative/extensions.py,sha256=aPpW0PvTKH3CoSMhsOY5GcUMZOVq-OFsV1hflxmb3Lw,20095
|
| 251 |
+
sqlalchemy/ext/horizontal_shard.py,sha256=V8vXEt5ZQb_PM39agZD2IyoQNGSqVI1MhY-6mNV5MRY,17231
|
| 252 |
+
sqlalchemy/ext/hybrid.py,sha256=UpWd9hOD5I3hCT5FJW9twSDyShDVyygRIFtv-FmMHgM,53972
|
| 253 |
+
sqlalchemy/ext/indexable.py,sha256=aDlVpN4rilRrer9qKg3kO7fqnqB5NX4M5qzYuYM8pvw,11373
|
| 254 |
+
sqlalchemy/ext/instrumentation.py,sha256=lFsJECWlN1oc1E0r9TaQDZcxAx4VOz6PSHYrl5fLk9Y,16157
|
| 255 |
+
sqlalchemy/ext/mutable.py,sha256=nAz3_lF2xkYSARt7GAWQh-OUMcnpe6s1ocjvQGxCPkc,38428
|
| 256 |
+
sqlalchemy/ext/mypy/__init__.py,sha256=aqT8_9sNwzC8PIaEZ4zkCYGBvYPaDD3eCgJtJuk3g6A,247
|
| 257 |
+
sqlalchemy/ext/mypy/__pycache__/__init__.cpython-311.pyc,,
|
| 258 |
+
sqlalchemy/ext/mypy/__pycache__/apply.cpython-311.pyc,,
|
| 259 |
+
sqlalchemy/ext/mypy/__pycache__/decl_class.cpython-311.pyc,,
|
| 260 |
+
sqlalchemy/ext/mypy/__pycache__/infer.cpython-311.pyc,,
|
| 261 |
+
sqlalchemy/ext/mypy/__pycache__/names.cpython-311.pyc,,
|
| 262 |
+
sqlalchemy/ext/mypy/__pycache__/plugin.cpython-311.pyc,,
|
| 263 |
+
sqlalchemy/ext/mypy/__pycache__/util.cpython-311.pyc,,
|
| 264 |
+
sqlalchemy/ext/mypy/apply.py,sha256=1Qb-_FpQ_0LVB2KFA5hVjfPv6DDMIcxXe86Ts1X9GBk,10870
|
| 265 |
+
sqlalchemy/ext/mypy/decl_class.py,sha256=f2iWiFVlDFqGb_IoGGotI3IEOUErh25sLT7B_cMfx0g,17899
|
| 266 |
+
sqlalchemy/ext/mypy/infer.py,sha256=O-3IjELDSBEAwGGxRM7lr0NWwGD0HMK4vda_iY6iwjs,19959
|
| 267 |
+
sqlalchemy/ext/mypy/names.py,sha256=2bHYuQJe71c9JtuJSZP-WWGiOJmY9-FuMQGMDBB6dRs,10814
|
| 268 |
+
sqlalchemy/ext/mypy/plugin.py,sha256=TDTziLsYFRqyX8UcQMtBBa6TFR4z9N-XNO8wRkHlEOI,10053
|
| 269 |
+
sqlalchemy/ext/mypy/util.py,sha256=3iQ1zVpXSUoj2aHa-Kkg4O83JOzqVd8TDEwpZj3SWWs,9786
|
| 270 |
+
sqlalchemy/ext/orderinglist.py,sha256=r7La_3nZlGevIgsBL1IB30FvWO_tZHlTKo_FWwid-aY,14800
|
| 271 |
+
sqlalchemy/ext/serializer.py,sha256=_7gottqRCI-qkW4Go4o2EnOSnieKDCQ8jQ6muHXw-RM,6363
|
| 272 |
+
sqlalchemy/future/__init__.py,sha256=6-qPdjMHX-V-kAPjTQgNuHztmYiwKlJhKhhljuETvoQ,528
|
| 273 |
+
sqlalchemy/future/__pycache__/__init__.cpython-311.pyc,,
|
| 274 |
+
sqlalchemy/future/__pycache__/engine.cpython-311.pyc,,
|
| 275 |
+
sqlalchemy/future/engine.py,sha256=N_5W2ab5-ueedWzqNdgLPzTW9audT1IbxF6FCDLRZOc,510
|
| 276 |
+
sqlalchemy/inspection.py,sha256=GpmMuSAZ53u4W__iGpvzQKCBMFnTxnHt4Lo7Nq1FSKM,5237
|
| 277 |
+
sqlalchemy/log.py,sha256=Sg6PGR_wmseiCCpJfRDEkaMs08XTPPsf0X_iYJLvzS0,8895
|
| 278 |
+
sqlalchemy/orm/__init__.py,sha256=I-XesvuyjkAAwnsiF5FnXRLNV6W2nW70EnGAIt2GAjU,8633
|
| 279 |
+
sqlalchemy/orm/__pycache__/__init__.cpython-311.pyc,,
|
| 280 |
+
sqlalchemy/orm/__pycache__/_orm_constructors.cpython-311.pyc,,
|
| 281 |
+
sqlalchemy/orm/__pycache__/_typing.cpython-311.pyc,,
|
| 282 |
+
sqlalchemy/orm/__pycache__/attributes.cpython-311.pyc,,
|
| 283 |
+
sqlalchemy/orm/__pycache__/base.cpython-311.pyc,,
|
| 284 |
+
sqlalchemy/orm/__pycache__/bulk_persistence.cpython-311.pyc,,
|
| 285 |
+
sqlalchemy/orm/__pycache__/clsregistry.cpython-311.pyc,,
|
| 286 |
+
sqlalchemy/orm/__pycache__/collections.cpython-311.pyc,,
|
| 287 |
+
sqlalchemy/orm/__pycache__/context.cpython-311.pyc,,
|
| 288 |
+
sqlalchemy/orm/__pycache__/decl_api.cpython-311.pyc,,
|
| 289 |
+
sqlalchemy/orm/__pycache__/decl_base.cpython-311.pyc,,
|
| 290 |
+
sqlalchemy/orm/__pycache__/dependency.cpython-311.pyc,,
|
| 291 |
+
sqlalchemy/orm/__pycache__/descriptor_props.cpython-311.pyc,,
|
| 292 |
+
sqlalchemy/orm/__pycache__/dynamic.cpython-311.pyc,,
|
| 293 |
+
sqlalchemy/orm/__pycache__/evaluator.cpython-311.pyc,,
|
| 294 |
+
sqlalchemy/orm/__pycache__/events.cpython-311.pyc,,
|
| 295 |
+
sqlalchemy/orm/__pycache__/exc.cpython-311.pyc,,
|
| 296 |
+
sqlalchemy/orm/__pycache__/identity.cpython-311.pyc,,
|
| 297 |
+
sqlalchemy/orm/__pycache__/instrumentation.cpython-311.pyc,,
|
| 298 |
+
sqlalchemy/orm/__pycache__/interfaces.cpython-311.pyc,,
|
| 299 |
+
sqlalchemy/orm/__pycache__/loading.cpython-311.pyc,,
|
| 300 |
+
sqlalchemy/orm/__pycache__/mapped_collection.cpython-311.pyc,,
|
| 301 |
+
sqlalchemy/orm/__pycache__/mapper.cpython-311.pyc,,
|
| 302 |
+
sqlalchemy/orm/__pycache__/path_registry.cpython-311.pyc,,
|
| 303 |
+
sqlalchemy/orm/__pycache__/persistence.cpython-311.pyc,,
|
| 304 |
+
sqlalchemy/orm/__pycache__/properties.cpython-311.pyc,,
|
| 305 |
+
sqlalchemy/orm/__pycache__/query.cpython-311.pyc,,
|
| 306 |
+
sqlalchemy/orm/__pycache__/relationships.cpython-311.pyc,,
|
| 307 |
+
sqlalchemy/orm/__pycache__/scoping.cpython-311.pyc,,
|
| 308 |
+
sqlalchemy/orm/__pycache__/session.cpython-311.pyc,,
|
| 309 |
+
sqlalchemy/orm/__pycache__/state.cpython-311.pyc,,
|
| 310 |
+
sqlalchemy/orm/__pycache__/state_changes.cpython-311.pyc,,
|
| 311 |
+
sqlalchemy/orm/__pycache__/strategies.cpython-311.pyc,,
|
| 312 |
+
sqlalchemy/orm/__pycache__/strategy_options.cpython-311.pyc,,
|
| 313 |
+
sqlalchemy/orm/__pycache__/sync.cpython-311.pyc,,
|
| 314 |
+
sqlalchemy/orm/__pycache__/unitofwork.cpython-311.pyc,,
|
| 315 |
+
sqlalchemy/orm/__pycache__/util.cpython-311.pyc,,
|
| 316 |
+
sqlalchemy/orm/__pycache__/writeonly.cpython-311.pyc,,
|
| 317 |
+
sqlalchemy/orm/_orm_constructors.py,sha256=xLdlm6hTk7mDHZLpUi5Y3QOZkI9rAHtze2tQQRZVerg,101932
|
| 318 |
+
sqlalchemy/orm/_typing.py,sha256=Z9GZT8Vb-wFwvHeOeVE37dvmCWdItLZnqI_pLin4cMc,5152
|
| 319 |
+
sqlalchemy/orm/attributes.py,sha256=n4gfW0mFEqwRqezFwd5SBIIusK3B9EgBtnTS1Splq34,95370
|
| 320 |
+
sqlalchemy/orm/base.py,sha256=1yljObgot8oYfYoq3X13jfMMxSfdrMcLMPCcBPrrf9s,28437
|
| 321 |
+
sqlalchemy/orm/bulk_persistence.py,sha256=arYeLK98O2jhX-VdtVLqaOUc-f-F0re6Q3m2BoSymWM,72141
|
| 322 |
+
sqlalchemy/orm/clsregistry.py,sha256=ZumBI7I2O-l93LbA4eyMKm0w6al-nNS2QV1VDcJxGko,18528
|
| 323 |
+
sqlalchemy/orm/collections.py,sha256=lHjP6uDz0WdwedTqyh_8R2_nzRAK_5ONCIoisHrsb94,53797
|
| 324 |
+
sqlalchemy/orm/context.py,sha256=2nMlrdBEtqLSIsk2cxoIUa71UUrWEFGJh3utZNCyxw4,115700
|
| 325 |
+
sqlalchemy/orm/decl_api.py,sha256=i6mXKqNrCxu3bJKhhBt_KtsPZHVVDHemAFEQpUdQvAM,65881
|
| 326 |
+
sqlalchemy/orm/decl_base.py,sha256=g6bhTg5M9hsf3JVnMaqn1NS7MTdBJY--L-qf9aQabgs,83753
|
| 327 |
+
sqlalchemy/orm/dependency.py,sha256=glstmbB4t-PIRA47u9NgTyyxbENfyQuG9Uzj2iezB_s,48935
|
| 328 |
+
sqlalchemy/orm/descriptor_props.py,sha256=PpDt83EX72AhCbBjixQDpYG1P1MqWqGdA-bJpXMSxSw,38254
|
| 329 |
+
sqlalchemy/orm/dynamic.py,sha256=m7V2GPS5__4y_hP7BQjD66b6BVEre1pzPwaj2bmRFRM,10084
|
| 330 |
+
sqlalchemy/orm/evaluator.py,sha256=gQIDxuoB5Ut2hiFdN768U67JusVkbFt-Bdna_T8npPA,12293
|
| 331 |
+
sqlalchemy/orm/events.py,sha256=UHJ9ZD1WFrFssXbrGEVq0KJQkId0VgKACAnORFVlabg,130962
|
| 332 |
+
sqlalchemy/orm/exc.py,sha256=fd24WdW3CP3oxFcz9CLXPeBIAfqJZbKv7K4G-5X4EOg,7641
|
| 333 |
+
sqlalchemy/orm/identity.py,sha256=fOpANTf73r12F_w9DhVoyjkAdh8ldgJcNnwxx0GY8YM,9551
|
| 334 |
+
sqlalchemy/orm/instrumentation.py,sha256=a8vi3qEAyO7Z9PYksLkFi_YzxqQhzB-anblegiAtsFw,25075
|
| 335 |
+
sqlalchemy/orm/interfaces.py,sha256=tTV0drZDoYX2MhHUYQEGoALuTWxgfNdnKeYM3I38BO8,49971
|
| 336 |
+
sqlalchemy/orm/loading.py,sha256=RCEUmTS--9QntLQcnwYVxHRsC3ILE58AVNHb8MGcybg,59959
|
| 337 |
+
sqlalchemy/orm/mapped_collection.py,sha256=AeSzQwj56cLr1tVMC0B-3JsC74IAP7_gbr-EPc4_2uw,20250
|
| 338 |
+
sqlalchemy/orm/mapper.py,sha256=WSDQZ_rwMd6mEwJDaS9oztcCBuNjw7fb5NlJiaLQtl0,175509
|
| 339 |
+
sqlalchemy/orm/path_registry.py,sha256=GQS4KatFTi_6LKdi6I4185igHE6DDwrm8b1AMOHMom4,26731
|
| 340 |
+
sqlalchemy/orm/persistence.py,sha256=MKb7TuSLJUQpyqnHxf6uNmGXSznmZgkkFTD04nHbNUQ,63483
|
| 341 |
+
sqlalchemy/orm/properties.py,sha256=DicF2OHW-b5z7xJrahELKd5OPm9cVfTIYjQcoEM1naw,30192
|
| 342 |
+
sqlalchemy/orm/query.py,sha256=7cxWJw-bfxtNEwUIitF3MW3JiJPMJu4EnAbl-lMI5aY,120990
|
| 343 |
+
sqlalchemy/orm/relationships.py,sha256=tj00j1ISHQmJbWeegWn8U29lL6WUnqd8fdY7NRHcLWU,132144
|
| 344 |
+
sqlalchemy/orm/scoping.py,sha256=aAQMIAAZ-M_m6UGndmkUiDazcphE-klw6wZjFT2Az7E,80842
|
| 345 |
+
sqlalchemy/orm/session.py,sha256=jlPYQoKYTO1ragBcPpaXbO8OU4TgW5vTwrv59hVUBr8,200540
|
| 346 |
+
sqlalchemy/orm/state.py,sha256=9opH8AR6LnbCRmW1lN2RxEQyxnEi1rcDXlySqrDeUiw,38656
|
| 347 |
+
sqlalchemy/orm/state_changes.py,sha256=4i90vDgBGvVGUzhlonlBkZBAZFOWaAXij2X8OEA3-BA,7013
|
| 348 |
+
sqlalchemy/orm/strategies.py,sha256=GFppPikNxZJdsi4DW1HcU6pv-EvIeFvTI8K_LDY5nmk,117550
|
| 349 |
+
sqlalchemy/orm/strategy_options.py,sha256=XwkyZ0vu1_P9hrecyROHw7wsjqstuKfsfGAm4W_78x8,87935
|
| 350 |
+
sqlalchemy/orm/sync.py,sha256=aMEMhYTj2rtJZJvjqm-cUx2CoQxYl8P6YddCLpLelhM,5943
|
| 351 |
+
sqlalchemy/orm/unitofwork.py,sha256=THggzzAaqmYh5PBDob5dHTP_YyHXYdscs3fIxtRV-gE,27829
|
| 352 |
+
sqlalchemy/orm/util.py,sha256=FSxDa0XwheHyU28ahF1KfdaPp_-9n4P5D_CO2GhjIOQ,83076
|
| 353 |
+
sqlalchemy/orm/writeonly.py,sha256=j5DcpZKOv1tLGQLhKfk-Uw-B0yEG7LezwJWNTq0FtWQ,22983
|
| 354 |
+
sqlalchemy/pool/__init__.py,sha256=ZKUPMKdBU57mhu677UsvRs5Aq9s9BwIbMmSNRoTRPoY,1848
|
| 355 |
+
sqlalchemy/pool/__pycache__/__init__.cpython-311.pyc,,
|
| 356 |
+
sqlalchemy/pool/__pycache__/base.cpython-311.pyc,,
|
| 357 |
+
sqlalchemy/pool/__pycache__/events.cpython-311.pyc,,
|
| 358 |
+
sqlalchemy/pool/__pycache__/impl.cpython-311.pyc,,
|
| 359 |
+
sqlalchemy/pool/base.py,sha256=D0sKTRla6wpIFbELyGY2JEHUHR324rveIl93qjjmYr8,53751
|
| 360 |
+
sqlalchemy/pool/events.py,sha256=ysyFh0mNDpL4N4rQ-o_BC6tpo_zt0_au_QLBgJqaKY8,13517
|
| 361 |
+
sqlalchemy/pool/impl.py,sha256=BU5vUQ6NDFIldsG9og6mtO14SsqwpUqvwyGqZsKT6i0,19525
|
| 362 |
+
sqlalchemy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 363 |
+
sqlalchemy/schema.py,sha256=UFhZjGmYoqN3zkId7M4CbVCd8KaeZUfKUjdlk0sHQ_E,3264
|
| 364 |
+
sqlalchemy/sql/__init__.py,sha256=T16ZB3Za0Tq1LQGXeJuuxDkyu2t-XHR2t-8QH1mE1Uw,5965
|
| 365 |
+
sqlalchemy/sql/__pycache__/__init__.cpython-311.pyc,,
|
| 366 |
+
sqlalchemy/sql/__pycache__/_dml_constructors.cpython-311.pyc,,
|
| 367 |
+
sqlalchemy/sql/__pycache__/_elements_constructors.cpython-311.pyc,,
|
| 368 |
+
sqlalchemy/sql/__pycache__/_orm_types.cpython-311.pyc,,
|
| 369 |
+
sqlalchemy/sql/__pycache__/_py_util.cpython-311.pyc,,
|
| 370 |
+
sqlalchemy/sql/__pycache__/_selectable_constructors.cpython-311.pyc,,
|
| 371 |
+
sqlalchemy/sql/__pycache__/_typing.cpython-311.pyc,,
|
| 372 |
+
sqlalchemy/sql/__pycache__/annotation.cpython-311.pyc,,
|
| 373 |
+
sqlalchemy/sql/__pycache__/base.cpython-311.pyc,,
|
| 374 |
+
sqlalchemy/sql/__pycache__/cache_key.cpython-311.pyc,,
|
| 375 |
+
sqlalchemy/sql/__pycache__/coercions.cpython-311.pyc,,
|
| 376 |
+
sqlalchemy/sql/__pycache__/compiler.cpython-311.pyc,,
|
| 377 |
+
sqlalchemy/sql/__pycache__/crud.cpython-311.pyc,,
|
| 378 |
+
sqlalchemy/sql/__pycache__/ddl.cpython-311.pyc,,
|
| 379 |
+
sqlalchemy/sql/__pycache__/default_comparator.cpython-311.pyc,,
|
| 380 |
+
sqlalchemy/sql/__pycache__/dml.cpython-311.pyc,,
|
| 381 |
+
sqlalchemy/sql/__pycache__/elements.cpython-311.pyc,,
|
| 382 |
+
sqlalchemy/sql/__pycache__/events.cpython-311.pyc,,
|
| 383 |
+
sqlalchemy/sql/__pycache__/expression.cpython-311.pyc,,
|
| 384 |
+
sqlalchemy/sql/__pycache__/functions.cpython-311.pyc,,
|
| 385 |
+
sqlalchemy/sql/__pycache__/lambdas.cpython-311.pyc,,
|
| 386 |
+
sqlalchemy/sql/__pycache__/naming.cpython-311.pyc,,
|
| 387 |
+
sqlalchemy/sql/__pycache__/operators.cpython-311.pyc,,
|
| 388 |
+
sqlalchemy/sql/__pycache__/roles.cpython-311.pyc,,
|
| 389 |
+
sqlalchemy/sql/__pycache__/schema.cpython-311.pyc,,
|
| 390 |
+
sqlalchemy/sql/__pycache__/selectable.cpython-311.pyc,,
|
| 391 |
+
sqlalchemy/sql/__pycache__/sqltypes.cpython-311.pyc,,
|
| 392 |
+
sqlalchemy/sql/__pycache__/traversals.cpython-311.pyc,,
|
| 393 |
+
sqlalchemy/sql/__pycache__/type_api.cpython-311.pyc,,
|
| 394 |
+
sqlalchemy/sql/__pycache__/util.cpython-311.pyc,,
|
| 395 |
+
sqlalchemy/sql/__pycache__/visitors.cpython-311.pyc,,
|
| 396 |
+
sqlalchemy/sql/_dml_constructors.py,sha256=1xMH5Kd6SLhlFwfIs_lOXGC8GTrqW8mQM7Kc3cKyLuw,4007
|
| 397 |
+
sqlalchemy/sql/_elements_constructors.py,sha256=gYSQwuVF0rTd40zGCrPzHdBAZj5kaCtf27S6sCVhbSU,64895
|
| 398 |
+
sqlalchemy/sql/_orm_types.py,sha256=_bzlAh3-vTIZoLvAM2ry1SF7rsYRM3-jupfhGWZZn5Y,645
|
| 399 |
+
sqlalchemy/sql/_py_util.py,sha256=VzThcXk7fKqT9_mZmXrkxePdwyyl_wIciCftzl2Z_-g,2248
|
| 400 |
+
sqlalchemy/sql/_selectable_constructors.py,sha256=mRgtlGyctlb1LMBqFxgn0eGzIXMbyZtQafjUuJWhYjs,19415
|
| 401 |
+
sqlalchemy/sql/_typing.py,sha256=FzAwrbL9o2CMluxxj1MfYh9ut7NDqkzD6dkWk5tz_dI,13231
|
| 402 |
+
sqlalchemy/sql/annotation.py,sha256=PslN1KQV9hN8Ji4k8I3-W-cDuRMCCLwMmJcg-n86Yy4,18830
|
| 403 |
+
sqlalchemy/sql/base.py,sha256=e8lPtvznlRmFilfvhO0721rsq2ShadtRoivSvIcAI2o,76084
|
| 404 |
+
sqlalchemy/sql/cache_key.py,sha256=nEvUQ4yjtWWblrKjLLDd_b9i5zudgYhkOdJvI1U8Lvo,34725
|
| 405 |
+
sqlalchemy/sql/coercions.py,sha256=O6PA7Gzhr9XQedJs3zIngCivN1vcrNyEhFueN5CqriI,41882
|
| 406 |
+
sqlalchemy/sql/compiler.py,sha256=LHzSUkjNiJZlKGRovv0v6oy7omVD-YRSGN_2NKpEzn4,282463
|
| 407 |
+
sqlalchemy/sql/crud.py,sha256=I5nPPnujtNKHC5C2v1vW4A0mbyomwChT21IYOX3z5fw,58190
|
| 408 |
+
sqlalchemy/sql/ddl.py,sha256=NbW8F3UT4BTnda5w5TNPGxXPtv0wHSNB51hhr4gBSJM,46980
|
| 409 |
+
sqlalchemy/sql/default_comparator.py,sha256=lXmd8yAUzfyeP5w4vebrQG99oC0bTrmdGc0crBq1GKw,17259
|
| 410 |
+
sqlalchemy/sql/dml.py,sha256=lt5FC6BbJNotE65U-fmvEovBxkADfKBnVcnkVYYQxUM,67431
|
| 411 |
+
sqlalchemy/sql/elements.py,sha256=ugtfbolfLwgoxKYpu1zKEJBs5eYIpKAw4pYhKIRWMfQ,180054
|
| 412 |
+
sqlalchemy/sql/events.py,sha256=pG3jqJbPX18N9Amp47aXiQYMYD_HL_lOXHk-0m8m7Hw,18745
|
| 413 |
+
sqlalchemy/sql/expression.py,sha256=T-AgCPp30tgKQYLKeSyqQg_VoJFE69m2yDTz6fn-u1E,7748
|
| 414 |
+
sqlalchemy/sql/functions.py,sha256=9iazLxbvCMH35CzgtZaNJ0IUn8wz04w9DofY3jNfIHc,65817
|
| 415 |
+
sqlalchemy/sql/lambdas.py,sha256=eKlhUhD8urNVvOm_1tUf8ESPIpo2qTAidKHJEarUhj8,50741
|
| 416 |
+
sqlalchemy/sql/naming.py,sha256=ERVjqo6fBHBw2BwNgpbb5cvsCkq1jjdztczP9BKzVt8,7070
|
| 417 |
+
sqlalchemy/sql/operators.py,sha256=6rpSbuFon7iIUCT4SDowYctDyOmFpe2-FdLu2HIX3x8,78508
|
| 418 |
+
sqlalchemy/sql/roles.py,sha256=8nO4y1hbP1cA8IzeOn6uPgNZNVILb3E-IMeJWOIScu8,7985
|
| 419 |
+
sqlalchemy/sql/schema.py,sha256=YwuzYFaP7BtJr5dDoEBIRbYbqE4spMhbux51zL7DDuU,235372
|
| 420 |
+
sqlalchemy/sql/selectable.py,sha256=xz5T08lU9xHpCQKyXRaot7TsEalzmpjqHOOI_DqlJTw,240437
|
| 421 |
+
sqlalchemy/sql/sqltypes.py,sha256=Yo0FaBhO9EZ_IvKqaqsPjzNPjb1V_goVK13I1KJlwno,129862
|
| 422 |
+
sqlalchemy/sql/traversals.py,sha256=p2iXAQc0FvV-l1Q3NNMxIhRYTm8U3Ul630jG3Ys6qCI,34611
|
| 423 |
+
sqlalchemy/sql/type_api.py,sha256=Okt_vXFk8L0_mDHiX5lrtAgirx62EUnXKyBMpmV62yw,85511
|
| 424 |
+
sqlalchemy/sql/util.py,sha256=ftTiyNGeJK0MIRMqWMV7Xf8iZuiRGocoJRp3MIO3F3Y,49563
|
| 425 |
+
sqlalchemy/sql/visitors.py,sha256=oudlabsf9qleuC78GFe_iflRSAD8H-HjaM7T8Frc538,37482
|
| 426 |
+
sqlalchemy/testing/__init__.py,sha256=8iT66v5k4J9RmquaH4GLI2DjEA7c_JZSTVig-uuBNw8,3221
|
| 427 |
+
sqlalchemy/testing/__pycache__/__init__.cpython-311.pyc,,
|
| 428 |
+
sqlalchemy/testing/__pycache__/assertions.cpython-311.pyc,,
|
| 429 |
+
sqlalchemy/testing/__pycache__/assertsql.cpython-311.pyc,,
|
| 430 |
+
sqlalchemy/testing/__pycache__/asyncio.cpython-311.pyc,,
|
| 431 |
+
sqlalchemy/testing/__pycache__/config.cpython-311.pyc,,
|
| 432 |
+
sqlalchemy/testing/__pycache__/engines.cpython-311.pyc,,
|
| 433 |
+
sqlalchemy/testing/__pycache__/entities.cpython-311.pyc,,
|
| 434 |
+
sqlalchemy/testing/__pycache__/exclusions.cpython-311.pyc,,
|
| 435 |
+
sqlalchemy/testing/__pycache__/pickleable.cpython-311.pyc,,
|
| 436 |
+
sqlalchemy/testing/__pycache__/profiling.cpython-311.pyc,,
|
| 437 |
+
sqlalchemy/testing/__pycache__/provision.cpython-311.pyc,,
|
| 438 |
+
sqlalchemy/testing/__pycache__/requirements.cpython-311.pyc,,
|
| 439 |
+
sqlalchemy/testing/__pycache__/schema.cpython-311.pyc,,
|
| 440 |
+
sqlalchemy/testing/__pycache__/util.cpython-311.pyc,,
|
| 441 |
+
sqlalchemy/testing/__pycache__/warnings.cpython-311.pyc,,
|
| 442 |
+
sqlalchemy/testing/assertions.py,sha256=bBn2Ep89FF-WBmzh0VkvnJ9gNMKuqk8OXq7ALpUwar4,32428
|
| 443 |
+
sqlalchemy/testing/assertsql.py,sha256=gj4YRBR9cjOtS1WgR3nsyIze1tmqctsNs1uCV8N2Q4w,17333
|
| 444 |
+
sqlalchemy/testing/asyncio.py,sha256=xYuWjKFHzolBLgddy1ePI9l8KRRUOWpT-FWjhtV2Ei0,3965
|
| 445 |
+
sqlalchemy/testing/config.py,sha256=jfFVUiAOm8im6SlqyAdZVSaA51kmADgfBDqrHnngH7c,12517
|
| 446 |
+
sqlalchemy/testing/engines.py,sha256=8R7nbmLNUv2w7tiyVpiVI1s-57wpEs70UAgY-pkPX8k,13953
|
| 447 |
+
sqlalchemy/testing/entities.py,sha256=Um-DFSz81p06DhTK899ZRUOZRw3FtUDeNMVHcIg3eLc,3471
|
| 448 |
+
sqlalchemy/testing/exclusions.py,sha256=8kjsaFfjCvPlLsQLD_LIDwuqvVlIVbD5qTWBlKdtNkM,12895
|
| 449 |
+
sqlalchemy/testing/fixtures/__init__.py,sha256=B1IFCzEVdCqhEvFrLmgxZ_Fr08jDus5FddSA-lnnAAU,1226
|
| 450 |
+
sqlalchemy/testing/fixtures/__pycache__/__init__.cpython-311.pyc,,
|
| 451 |
+
sqlalchemy/testing/fixtures/__pycache__/base.cpython-311.pyc,,
|
| 452 |
+
sqlalchemy/testing/fixtures/__pycache__/mypy.cpython-311.pyc,,
|
| 453 |
+
sqlalchemy/testing/fixtures/__pycache__/orm.cpython-311.pyc,,
|
| 454 |
+
sqlalchemy/testing/fixtures/__pycache__/sql.cpython-311.pyc,,
|
| 455 |
+
sqlalchemy/testing/fixtures/base.py,sha256=S0ODuph0jA2Za4GN3NNhYVIqN9jAa3Q9Vd1N4O4rcTc,12622
|
| 456 |
+
sqlalchemy/testing/fixtures/mypy.py,sha256=2H8QxvGvwsb_Z3alRtvCvfXeqGjOb8aemfoYxQiuGMc,12285
|
| 457 |
+
sqlalchemy/testing/fixtures/orm.py,sha256=6JvQpIfmgmSTH3Hie4nhmUFfvH0pseujIFA9Lup2Dzw,6322
|
| 458 |
+
sqlalchemy/testing/fixtures/sql.py,sha256=BLtJYAQZ3NjIwNrK_E9miordz7utWzjYqePj88hN3NA,16267
|
| 459 |
+
sqlalchemy/testing/pickleable.py,sha256=uYLl557iNep6jSOVl0vK1GwaLHUKidALoPJc-QIrC08,2988
|
| 460 |
+
sqlalchemy/testing/plugin/__init__.py,sha256=bbtVIt7LzVnUCcVxHWRH2owOQD067bQwwhyMf_whqHs,253
|
| 461 |
+
sqlalchemy/testing/plugin/__pycache__/__init__.cpython-311.pyc,,
|
| 462 |
+
sqlalchemy/testing/plugin/__pycache__/bootstrap.cpython-311.pyc,,
|
| 463 |
+
sqlalchemy/testing/plugin/__pycache__/plugin_base.cpython-311.pyc,,
|
| 464 |
+
sqlalchemy/testing/plugin/__pycache__/pytestplugin.cpython-311.pyc,,
|
| 465 |
+
sqlalchemy/testing/plugin/bootstrap.py,sha256=USn6pE-JcE5pSmnEd2wad3goKLx2hdJS3AUUFpXHm-I,1736
|
| 466 |
+
sqlalchemy/testing/plugin/plugin_base.py,sha256=CgrNj2wj9KNALu9YfnGSaHX2fXfTtiim_cfx0CPVoy8,22357
|
| 467 |
+
sqlalchemy/testing/plugin/pytestplugin.py,sha256=acuAWFec8QGzC_AWOhTsRRgB6dttkbNdoyGVb7WvTng,28524
|
| 468 |
+
sqlalchemy/testing/profiling.py,sha256=o8_V3TpF_WytudMQQLm1UxlfNDrLCWxUvkH-Kd0unKU,10472
|
| 469 |
+
sqlalchemy/testing/provision.py,sha256=ciWoXf3P9ql4hh1yBp0RNEtPr5vyvPbd8RD_DYxNG9U,15115
|
| 470 |
+
sqlalchemy/testing/requirements.py,sha256=L_DKVqVxVMbB3JveC_6UhD5oVry2KjBHPxfQd35hrWQ,53600
|
| 471 |
+
sqlalchemy/testing/schema.py,sha256=z2Z5rm3iJ1-vgifUxwzxEjt1qu7QOyr3TeDnQdCHlWE,6737
|
| 472 |
+
sqlalchemy/testing/suite/__init__.py,sha256=YvTEqUNHaBlgLgWDAWn79mQrUR4VBGUHtprywJlmDT8,741
|
| 473 |
+
sqlalchemy/testing/suite/__pycache__/__init__.cpython-311.pyc,,
|
| 474 |
+
sqlalchemy/testing/suite/__pycache__/test_cte.cpython-311.pyc,,
|
| 475 |
+
sqlalchemy/testing/suite/__pycache__/test_ddl.cpython-311.pyc,,
|
| 476 |
+
sqlalchemy/testing/suite/__pycache__/test_deprecations.cpython-311.pyc,,
|
| 477 |
+
sqlalchemy/testing/suite/__pycache__/test_dialect.cpython-311.pyc,,
|
| 478 |
+
sqlalchemy/testing/suite/__pycache__/test_insert.cpython-311.pyc,,
|
| 479 |
+
sqlalchemy/testing/suite/__pycache__/test_reflection.cpython-311.pyc,,
|
| 480 |
+
sqlalchemy/testing/suite/__pycache__/test_results.cpython-311.pyc,,
|
| 481 |
+
sqlalchemy/testing/suite/__pycache__/test_rowcount.cpython-311.pyc,,
|
| 482 |
+
sqlalchemy/testing/suite/__pycache__/test_select.cpython-311.pyc,,
|
| 483 |
+
sqlalchemy/testing/suite/__pycache__/test_sequence.cpython-311.pyc,,
|
| 484 |
+
sqlalchemy/testing/suite/__pycache__/test_types.cpython-311.pyc,,
|
| 485 |
+
sqlalchemy/testing/suite/__pycache__/test_unicode_ddl.cpython-311.pyc,,
|
| 486 |
+
sqlalchemy/testing/suite/__pycache__/test_update_delete.cpython-311.pyc,,
|
| 487 |
+
sqlalchemy/testing/suite/test_cte.py,sha256=C_viXJKClFAm91rtPb42tiAA7gYJwKkqGYVJYap0cLM,6662
|
| 488 |
+
sqlalchemy/testing/suite/test_ddl.py,sha256=k6D6RreLkDSSpRUM2hQz-_CA48qV2PYx_2LNyUSoZzE,12420
|
| 489 |
+
sqlalchemy/testing/suite/test_deprecations.py,sha256=SKRFZDteBO1rw9-BQjDic5nh7fdyw2ypVOewR2pj7-Q,5490
|
| 490 |
+
sqlalchemy/testing/suite/test_dialect.py,sha256=ftOWRXWOotB2_jMJJqwoH9f3X2ucc1HwwOiXp573GwM,23663
|
| 491 |
+
sqlalchemy/testing/suite/test_insert.py,sha256=v3zrUZaGlke3cI4vabHg7xaI4gNqcHhtMPgYuf0mOxc,19454
|
| 492 |
+
sqlalchemy/testing/suite/test_reflection.py,sha256=C6P9ccG5Eog5uiIHO4s6M7ThnBbEUZKh83CmOMn-KSo,109594
|
| 493 |
+
sqlalchemy/testing/suite/test_results.py,sha256=1SlvhdioM1_ZrkQX2IJbJgXNHuleizwAge6-XvHtA0s,16405
|
| 494 |
+
sqlalchemy/testing/suite/test_rowcount.py,sha256=DCEGxorDcrT5JCLd3_SNQeZmxT6sKIcuKxX1r6vK4Mg,8158
|
| 495 |
+
sqlalchemy/testing/suite/test_select.py,sha256=NwHUSVc4UptVYMGjp3QVLr0OpGxpz2qJG4cNWZW8vTo,60462
|
| 496 |
+
sqlalchemy/testing/suite/test_sequence.py,sha256=sIqkfgVqPIgl4lm75EPdag9gK-rTHfUm3pWX-JijPy4,10240
|
| 497 |
+
sqlalchemy/testing/suite/test_types.py,sha256=i1fCIXERdtGABdp_T3l1vaPH9AhQ80DJvbjOPbeng1c,67748
|
| 498 |
+
sqlalchemy/testing/suite/test_unicode_ddl.py,sha256=juF_KTK1nGrSlsL8z0Ky0rFSNkPGheLB3e0Kq3yRqss,6330
|
| 499 |
+
sqlalchemy/testing/suite/test_update_delete.py,sha256=TnJI5U_ZEuu3bni4sH-S6CENxvSZwDgZL-FKSV45bAo,4133
|
| 500 |
+
sqlalchemy/testing/util.py,sha256=jX9jlUHSH-7_2OCypZUvitP8JkJbNdr5_ZxU6Aa8DPY,14599
|
| 501 |
+
sqlalchemy/testing/warnings.py,sha256=3EhbTlPe4gJnoydj-OKueNOOtGwIRF2kV4XvlFwFYOA,1598
|
| 502 |
+
sqlalchemy/types.py,sha256=unCm_O8qKxU3LjLbqeqSNQSsK5k5R5POsyEx2gH6CF4,3244
|
| 503 |
+
sqlalchemy/util/__init__.py,sha256=3-O9j9qPk-gTx6hlyLsISc_JOW5MhjV0J_L5nV19qI8,8436
|
| 504 |
+
sqlalchemy/util/__pycache__/__init__.cpython-311.pyc,,
|
| 505 |
+
sqlalchemy/util/__pycache__/_collections.cpython-311.pyc,,
|
| 506 |
+
sqlalchemy/util/__pycache__/_concurrency_py3k.cpython-311.pyc,,
|
| 507 |
+
sqlalchemy/util/__pycache__/_has_cy.cpython-311.pyc,,
|
| 508 |
+
sqlalchemy/util/__pycache__/_py_collections.cpython-311.pyc,,
|
| 509 |
+
sqlalchemy/util/__pycache__/compat.cpython-311.pyc,,
|
| 510 |
+
sqlalchemy/util/__pycache__/concurrency.cpython-311.pyc,,
|
| 511 |
+
sqlalchemy/util/__pycache__/deprecations.cpython-311.pyc,,
|
| 512 |
+
sqlalchemy/util/__pycache__/langhelpers.cpython-311.pyc,,
|
| 513 |
+
sqlalchemy/util/__pycache__/preloaded.cpython-311.pyc,,
|
| 514 |
+
sqlalchemy/util/__pycache__/queue.cpython-311.pyc,,
|
| 515 |
+
sqlalchemy/util/__pycache__/tool_support.cpython-311.pyc,,
|
| 516 |
+
sqlalchemy/util/__pycache__/topological.cpython-311.pyc,,
|
| 517 |
+
sqlalchemy/util/__pycache__/typing.cpython-311.pyc,,
|
| 518 |
+
sqlalchemy/util/_collections.py,sha256=O3iqq0R9TbcXNyFk8nG4QLwkUzdWkCFmqBYcDrajvl8,20778
|
| 519 |
+
sqlalchemy/util/_concurrency_py3k.py,sha256=FRTlTPGNcw4YNPlIDn7TNYPUmIBZdVoicRo8aKp4rSY,9481
|
| 520 |
+
sqlalchemy/util/_has_cy.py,sha256=IHGc5hUFbXQuv1a1z2P8yVwz0yGbCYXyQM2qsdcBTyg,1287
|
| 521 |
+
sqlalchemy/util/_py_collections.py,sha256=2PUqiKIsF8d-gNDAAqYI8WE6XPyRf1flRLkVsJeXuOo,17255
|
| 522 |
+
sqlalchemy/util/compat.py,sha256=ojCAtKHlkqNdYB33PXbAP0zTH1ZXYdTZkJl32cqGnMQ,9014
|
| 523 |
+
sqlalchemy/util/concurrency.py,sha256=zlmuK99p5cPpEPxBQYSDfLHP0Pbuw4iDeUzU49Pb1Ow,3412
|
| 524 |
+
sqlalchemy/util/deprecations.py,sha256=AnHpDWHi7g2gv_QUTGStQTnr0J94lIF-3aFLOsv9yzg,12372
|
| 525 |
+
sqlalchemy/util/langhelpers.py,sha256=f3IhEhNMnohDNDqSWWABPZi6U9ZrF0YGHyAc4h3n91Y,67099
|
| 526 |
+
sqlalchemy/util/preloaded.py,sha256=78Sl7VjzTOPajbovvARxNeuZb-iYRpEvL5k8m5Bz4vQ,6054
|
| 527 |
+
sqlalchemy/util/queue.py,sha256=4SbSbVamUECjCDpMPR035N1ooVHt9W5GjbqkxfZmH5k,10507
|
| 528 |
+
sqlalchemy/util/tool_support.py,sha256=DuurikYgDUIIxk3gubUKl6rs-etXt3eeHaZ4ZkIyJXQ,6336
|
| 529 |
+
sqlalchemy/util/topological.py,sha256=_NdtAghZjhZ4e2fwWHmn25erP5cvtGgOUMplsCa_VCE,3578
|
| 530 |
+
sqlalchemy/util/typing.py,sha256=oir6FlMQOcfAfbTKaUDSYSVf94M0r1z6aF3qr3f-UnI,17251
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/REQUESTED
ADDED
|
File without changes
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.43.0)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp311-cp311-win_amd64
|
| 5 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/SQLAlchemy-2.0.30.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
sqlalchemy
|
pgsql/pgAdmin 4/python/Lib/site-packages/_distutils_hack/__init__.py
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# don't import any costly modules
|
| 2 |
+
import sys
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def warn_distutils_present():
|
| 7 |
+
if 'distutils' not in sys.modules:
|
| 8 |
+
return
|
| 9 |
+
import warnings
|
| 10 |
+
|
| 11 |
+
warnings.warn(
|
| 12 |
+
"Distutils was imported before Setuptools, but importing Setuptools "
|
| 13 |
+
"also replaces the `distutils` module in `sys.modules`. This may lead "
|
| 14 |
+
"to undesirable behaviors or errors. To avoid these issues, avoid "
|
| 15 |
+
"using distutils directly, ensure that setuptools is installed in the "
|
| 16 |
+
"traditional way (e.g. not an editable install), and/or make sure "
|
| 17 |
+
"that setuptools is always imported before distutils."
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def clear_distutils():
|
| 22 |
+
if 'distutils' not in sys.modules:
|
| 23 |
+
return
|
| 24 |
+
import warnings
|
| 25 |
+
|
| 26 |
+
warnings.warn("Setuptools is replacing distutils.")
|
| 27 |
+
mods = [
|
| 28 |
+
name
|
| 29 |
+
for name in sys.modules
|
| 30 |
+
if name == "distutils" or name.startswith("distutils.")
|
| 31 |
+
]
|
| 32 |
+
for name in mods:
|
| 33 |
+
del sys.modules[name]
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def enabled():
|
| 37 |
+
"""
|
| 38 |
+
Allow selection of distutils by environment variable.
|
| 39 |
+
"""
|
| 40 |
+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
|
| 41 |
+
return which == 'local'
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def ensure_local_distutils():
|
| 45 |
+
import importlib
|
| 46 |
+
|
| 47 |
+
clear_distutils()
|
| 48 |
+
|
| 49 |
+
# With the DistutilsMetaFinder in place,
|
| 50 |
+
# perform an import to cause distutils to be
|
| 51 |
+
# loaded from setuptools._distutils. Ref #2906.
|
| 52 |
+
with shim():
|
| 53 |
+
importlib.import_module('distutils')
|
| 54 |
+
|
| 55 |
+
# check that submodules load as expected
|
| 56 |
+
core = importlib.import_module('distutils.core')
|
| 57 |
+
assert '_distutils' in core.__file__, core.__file__
|
| 58 |
+
assert 'setuptools._distutils.log' not in sys.modules
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def do_override():
|
| 62 |
+
"""
|
| 63 |
+
Ensure that the local copy of distutils is preferred over stdlib.
|
| 64 |
+
|
| 65 |
+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
|
| 66 |
+
for more motivation.
|
| 67 |
+
"""
|
| 68 |
+
if enabled():
|
| 69 |
+
warn_distutils_present()
|
| 70 |
+
ensure_local_distutils()
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
class _TrivialRe:
|
| 74 |
+
def __init__(self, *patterns):
|
| 75 |
+
self._patterns = patterns
|
| 76 |
+
|
| 77 |
+
def match(self, string):
|
| 78 |
+
return all(pat in string for pat in self._patterns)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
class DistutilsMetaFinder:
|
| 82 |
+
def find_spec(self, fullname, path, target=None):
|
| 83 |
+
# optimization: only consider top level modules and those
|
| 84 |
+
# found in the CPython test suite.
|
| 85 |
+
if path is not None and not fullname.startswith('test.'):
|
| 86 |
+
return None
|
| 87 |
+
|
| 88 |
+
method_name = 'spec_for_{fullname}'.format(**locals())
|
| 89 |
+
method = getattr(self, method_name, lambda: None)
|
| 90 |
+
return method()
|
| 91 |
+
|
| 92 |
+
def spec_for_distutils(self):
|
| 93 |
+
if self.is_cpython():
|
| 94 |
+
return None
|
| 95 |
+
|
| 96 |
+
import importlib
|
| 97 |
+
import importlib.abc
|
| 98 |
+
import importlib.util
|
| 99 |
+
|
| 100 |
+
try:
|
| 101 |
+
mod = importlib.import_module('setuptools._distutils')
|
| 102 |
+
except Exception:
|
| 103 |
+
# There are a couple of cases where setuptools._distutils
|
| 104 |
+
# may not be present:
|
| 105 |
+
# - An older Setuptools without a local distutils is
|
| 106 |
+
# taking precedence. Ref #2957.
|
| 107 |
+
# - Path manipulation during sitecustomize removes
|
| 108 |
+
# setuptools from the path but only after the hook
|
| 109 |
+
# has been loaded. Ref #2980.
|
| 110 |
+
# In either case, fall back to stdlib behavior.
|
| 111 |
+
return None
|
| 112 |
+
|
| 113 |
+
class DistutilsLoader(importlib.abc.Loader):
|
| 114 |
+
def create_module(self, spec):
|
| 115 |
+
mod.__name__ = 'distutils'
|
| 116 |
+
return mod
|
| 117 |
+
|
| 118 |
+
def exec_module(self, module):
|
| 119 |
+
pass
|
| 120 |
+
|
| 121 |
+
return importlib.util.spec_from_loader(
|
| 122 |
+
'distutils', DistutilsLoader(), origin=mod.__file__
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
@staticmethod
|
| 126 |
+
def is_cpython():
|
| 127 |
+
"""
|
| 128 |
+
Suppress supplying distutils for CPython (build and tests).
|
| 129 |
+
Ref #2965 and #3007.
|
| 130 |
+
"""
|
| 131 |
+
return os.path.isfile('pybuilddir.txt')
|
| 132 |
+
|
| 133 |
+
def spec_for_pip(self):
|
| 134 |
+
"""
|
| 135 |
+
Ensure stdlib distutils when running under pip.
|
| 136 |
+
See pypa/pip#8761 for rationale.
|
| 137 |
+
"""
|
| 138 |
+
if sys.version_info >= (3, 12) or self.pip_imported_during_build():
|
| 139 |
+
return
|
| 140 |
+
clear_distutils()
|
| 141 |
+
self.spec_for_distutils = lambda: None
|
| 142 |
+
|
| 143 |
+
@classmethod
|
| 144 |
+
def pip_imported_during_build(cls):
|
| 145 |
+
"""
|
| 146 |
+
Detect if pip is being imported in a build script. Ref #2355.
|
| 147 |
+
"""
|
| 148 |
+
import traceback
|
| 149 |
+
|
| 150 |
+
return any(
|
| 151 |
+
cls.frame_file_is_setup(frame) for frame, line in traceback.walk_stack(None)
|
| 152 |
+
)
|
| 153 |
+
|
| 154 |
+
@staticmethod
|
| 155 |
+
def frame_file_is_setup(frame):
|
| 156 |
+
"""
|
| 157 |
+
Return True if the indicated frame suggests a setup.py file.
|
| 158 |
+
"""
|
| 159 |
+
# some frames may not have __file__ (#2940)
|
| 160 |
+
return frame.f_globals.get('__file__', '').endswith('setup.py')
|
| 161 |
+
|
| 162 |
+
def spec_for_sensitive_tests(self):
|
| 163 |
+
"""
|
| 164 |
+
Ensure stdlib distutils when running select tests under CPython.
|
| 165 |
+
|
| 166 |
+
python/cpython#91169
|
| 167 |
+
"""
|
| 168 |
+
clear_distutils()
|
| 169 |
+
self.spec_for_distutils = lambda: None
|
| 170 |
+
|
| 171 |
+
sensitive_tests = (
|
| 172 |
+
[
|
| 173 |
+
'test.test_distutils',
|
| 174 |
+
'test.test_peg_generator',
|
| 175 |
+
'test.test_importlib',
|
| 176 |
+
]
|
| 177 |
+
if sys.version_info < (3, 10)
|
| 178 |
+
else [
|
| 179 |
+
'test.test_distutils',
|
| 180 |
+
]
|
| 181 |
+
)
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
for name in DistutilsMetaFinder.sensitive_tests:
|
| 185 |
+
setattr(
|
| 186 |
+
DistutilsMetaFinder,
|
| 187 |
+
f'spec_for_{name}',
|
| 188 |
+
DistutilsMetaFinder.spec_for_sensitive_tests,
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
DISTUTILS_FINDER = DistutilsMetaFinder()
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
def add_shim():
|
| 196 |
+
DISTUTILS_FINDER in sys.meta_path or insert_shim()
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
class shim:
|
| 200 |
+
def __enter__(self):
|
| 201 |
+
insert_shim()
|
| 202 |
+
|
| 203 |
+
def __exit__(self, exc, value, tb):
|
| 204 |
+
_remove_shim()
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
def insert_shim():
|
| 208 |
+
sys.meta_path.insert(0, DISTUTILS_FINDER)
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
def _remove_shim():
|
| 212 |
+
try:
|
| 213 |
+
sys.meta_path.remove(DISTUTILS_FINDER)
|
| 214 |
+
except ValueError:
|
| 215 |
+
pass
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
if sys.version_info < (3, 12):
|
| 219 |
+
# DistutilsMetaFinder can only be disabled in Python < 3.12 (PEP 632)
|
| 220 |
+
remove_shim = _remove_shim
|
pgsql/pgAdmin 4/python/Lib/site-packages/_distutils_hack/override.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__import__('_distutils_hack').do_override()
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
This version of the GNU Lesser General Public License incorporates
|
| 10 |
+
the terms and conditions of version 3 of the GNU General Public
|
| 11 |
+
License, supplemented by the additional permissions listed below.
|
| 12 |
+
|
| 13 |
+
0. Additional Definitions.
|
| 14 |
+
|
| 15 |
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
| 16 |
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
| 17 |
+
General Public License.
|
| 18 |
+
|
| 19 |
+
"The Library" refers to a covered work governed by this License,
|
| 20 |
+
other than an Application or a Combined Work as defined below.
|
| 21 |
+
|
| 22 |
+
An "Application" is any work that makes use of an interface provided
|
| 23 |
+
by the Library, but which is not otherwise based on the Library.
|
| 24 |
+
Defining a subclass of a class defined by the Library is deemed a mode
|
| 25 |
+
of using an interface provided by the Library.
|
| 26 |
+
|
| 27 |
+
A "Combined Work" is a work produced by combining or linking an
|
| 28 |
+
Application with the Library. The particular version of the Library
|
| 29 |
+
with which the Combined Work was made is also called the "Linked
|
| 30 |
+
Version".
|
| 31 |
+
|
| 32 |
+
The "Minimal Corresponding Source" for a Combined Work means the
|
| 33 |
+
Corresponding Source for the Combined Work, excluding any source code
|
| 34 |
+
for portions of the Combined Work that, considered in isolation, are
|
| 35 |
+
based on the Application, and not on the Linked Version.
|
| 36 |
+
|
| 37 |
+
The "Corresponding Application Code" for a Combined Work means the
|
| 38 |
+
object code and/or source code for the Application, including any data
|
| 39 |
+
and utility programs needed for reproducing the Combined Work from the
|
| 40 |
+
Application, but excluding the System Libraries of the Combined Work.
|
| 41 |
+
|
| 42 |
+
1. Exception to Section 3 of the GNU GPL.
|
| 43 |
+
|
| 44 |
+
You may convey a covered work under sections 3 and 4 of this License
|
| 45 |
+
without being bound by section 3 of the GNU GPL.
|
| 46 |
+
|
| 47 |
+
2. Conveying Modified Versions.
|
| 48 |
+
|
| 49 |
+
If you modify a copy of the Library, and, in your modifications, a
|
| 50 |
+
facility refers to a function or data to be supplied by an Application
|
| 51 |
+
that uses the facility (other than as an argument passed when the
|
| 52 |
+
facility is invoked), then you may convey a copy of the modified
|
| 53 |
+
version:
|
| 54 |
+
|
| 55 |
+
a) under this License, provided that you make a good faith effort to
|
| 56 |
+
ensure that, in the event an Application does not supply the
|
| 57 |
+
function or data, the facility still operates, and performs
|
| 58 |
+
whatever part of its purpose remains meaningful, or
|
| 59 |
+
|
| 60 |
+
b) under the GNU GPL, with none of the additional permissions of
|
| 61 |
+
this License applicable to that copy.
|
| 62 |
+
|
| 63 |
+
3. Object Code Incorporating Material from Library Header Files.
|
| 64 |
+
|
| 65 |
+
The object code form of an Application may incorporate material from
|
| 66 |
+
a header file that is part of the Library. You may convey such object
|
| 67 |
+
code under terms of your choice, provided that, if the incorporated
|
| 68 |
+
material is not limited to numerical parameters, data structure
|
| 69 |
+
layouts and accessors, or small macros, inline functions and templates
|
| 70 |
+
(ten or fewer lines in length), you do both of the following:
|
| 71 |
+
|
| 72 |
+
a) Give prominent notice with each copy of the object code that the
|
| 73 |
+
Library is used in it and that the Library and its use are
|
| 74 |
+
covered by this License.
|
| 75 |
+
|
| 76 |
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
| 77 |
+
document.
|
| 78 |
+
|
| 79 |
+
4. Combined Works.
|
| 80 |
+
|
| 81 |
+
You may convey a Combined Work under terms of your choice that,
|
| 82 |
+
taken together, effectively do not restrict modification of the
|
| 83 |
+
portions of the Library contained in the Combined Work and reverse
|
| 84 |
+
engineering for debugging such modifications, if you also do each of
|
| 85 |
+
the following:
|
| 86 |
+
|
| 87 |
+
a) Give prominent notice with each copy of the Combined Work that
|
| 88 |
+
the Library is used in it and that the Library and its use are
|
| 89 |
+
covered by this License.
|
| 90 |
+
|
| 91 |
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
| 92 |
+
document.
|
| 93 |
+
|
| 94 |
+
c) For a Combined Work that displays copyright notices during
|
| 95 |
+
execution, include the copyright notice for the Library among
|
| 96 |
+
these notices, as well as a reference directing the user to the
|
| 97 |
+
copies of the GNU GPL and this license document.
|
| 98 |
+
|
| 99 |
+
d) Do one of the following:
|
| 100 |
+
|
| 101 |
+
0) Convey the Minimal Corresponding Source under the terms of this
|
| 102 |
+
License, and the Corresponding Application Code in a form
|
| 103 |
+
suitable for, and under terms that permit, the user to
|
| 104 |
+
recombine or relink the Application with a modified version of
|
| 105 |
+
the Linked Version to produce a modified Combined Work, in the
|
| 106 |
+
manner specified by section 6 of the GNU GPL for conveying
|
| 107 |
+
Corresponding Source.
|
| 108 |
+
|
| 109 |
+
1) Use a suitable shared library mechanism for linking with the
|
| 110 |
+
Library. A suitable mechanism is one that (a) uses at run time
|
| 111 |
+
a copy of the Library already present on the user's computer
|
| 112 |
+
system, and (b) will operate properly with a modified version
|
| 113 |
+
of the Library that is interface-compatible with the Linked
|
| 114 |
+
Version.
|
| 115 |
+
|
| 116 |
+
e) Provide Installation Information, but only if you would otherwise
|
| 117 |
+
be required to provide such information under section 6 of the
|
| 118 |
+
GNU GPL, and only to the extent that such information is
|
| 119 |
+
necessary to install and execute a modified version of the
|
| 120 |
+
Combined Work produced by recombining or relinking the
|
| 121 |
+
Application with a modified version of the Linked Version. (If
|
| 122 |
+
you use option 4d0, the Installation Information must accompany
|
| 123 |
+
the Minimal Corresponding Source and Corresponding Application
|
| 124 |
+
Code. If you use option 4d1, you must provide the Installation
|
| 125 |
+
Information in the manner specified by section 6 of the GNU GPL
|
| 126 |
+
for conveying Corresponding Source.)
|
| 127 |
+
|
| 128 |
+
5. Combined Libraries.
|
| 129 |
+
|
| 130 |
+
You may place library facilities that are a work based on the
|
| 131 |
+
Library side by side in a single library together with other library
|
| 132 |
+
facilities that are not Applications and are not covered by this
|
| 133 |
+
License, and convey such a combined library under terms of your
|
| 134 |
+
choice, if you do both of the following:
|
| 135 |
+
|
| 136 |
+
a) Accompany the combined library with a copy of the same work based
|
| 137 |
+
on the Library, uncombined with any other library facilities,
|
| 138 |
+
conveyed under the terms of this License.
|
| 139 |
+
|
| 140 |
+
b) Give prominent notice with the combined library that part of it
|
| 141 |
+
is a work based on the Library, and explaining where to find the
|
| 142 |
+
accompanying uncombined form of the same work.
|
| 143 |
+
|
| 144 |
+
6. Revised Versions of the GNU Lesser General Public License.
|
| 145 |
+
|
| 146 |
+
The Free Software Foundation may publish revised and/or new versions
|
| 147 |
+
of the GNU Lesser General Public License from time to time. Such new
|
| 148 |
+
versions will be similar in spirit to the present version, but may
|
| 149 |
+
differ in detail to address new problems or concerns.
|
| 150 |
+
|
| 151 |
+
Each version is given a distinguishing version number. If the
|
| 152 |
+
Library as you received it specifies that a certain numbered version
|
| 153 |
+
of the GNU Lesser General Public License "or any later version"
|
| 154 |
+
applies to it, you have the option of following the terms and
|
| 155 |
+
conditions either of that published version or of any later version
|
| 156 |
+
published by the Free Software Foundation. If the Library as you
|
| 157 |
+
received it does not specify a version number of the GNU Lesser
|
| 158 |
+
General Public License, you may choose any version of the GNU Lesser
|
| 159 |
+
General Public License ever published by the Free Software Foundation.
|
| 160 |
+
|
| 161 |
+
If the Library as you received it specifies that a proxy can decide
|
| 162 |
+
whether future versions of the GNU Lesser General Public License shall
|
| 163 |
+
apply, that proxy's public statement of acceptance of any version is
|
| 164 |
+
permanent authorization for you to choose that version for the
|
| 165 |
+
Library.
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/METADATA
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: psycopg
|
| 3 |
+
Version: 3.1.12
|
| 4 |
+
Summary: PostgreSQL database adapter for Python
|
| 5 |
+
Home-page: https://psycopg.org/psycopg3/
|
| 6 |
+
Author: Daniele Varrazzo
|
| 7 |
+
Author-email: daniele.varrazzo@gmail.com
|
| 8 |
+
License: GNU Lesser General Public License v3 (LGPLv3)
|
| 9 |
+
Project-URL: Homepage, https://psycopg.org/
|
| 10 |
+
Project-URL: Documentation, https://psycopg.org/psycopg3/docs/
|
| 11 |
+
Project-URL: Changes, https://psycopg.org/psycopg3/docs/news.html
|
| 12 |
+
Project-URL: Code, https://github.com/psycopg/psycopg
|
| 13 |
+
Project-URL: Issue Tracker, https://github.com/psycopg/psycopg/issues
|
| 14 |
+
Project-URL: Download, https://pypi.org/project/psycopg/
|
| 15 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 16 |
+
Classifier: Intended Audience :: Developers
|
| 17 |
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
| 18 |
+
Classifier: Operating System :: MacOS :: MacOS X
|
| 19 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 20 |
+
Classifier: Operating System :: POSIX
|
| 21 |
+
Classifier: Programming Language :: Python :: 3
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 27 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 28 |
+
Classifier: Topic :: Database
|
| 29 |
+
Classifier: Topic :: Database :: Front-Ends
|
| 30 |
+
Classifier: Topic :: Software Development
|
| 31 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 32 |
+
Requires-Python: >=3.7
|
| 33 |
+
Description-Content-Type: text/x-rst
|
| 34 |
+
License-File: LICENSE.txt
|
| 35 |
+
Requires-Dist: typing-extensions >=4.1
|
| 36 |
+
Requires-Dist: backports.zoneinfo >=0.2.0 ; python_version < "3.9"
|
| 37 |
+
Requires-Dist: tzdata ; sys_platform == "win32"
|
| 38 |
+
Provides-Extra: binary
|
| 39 |
+
Requires-Dist: psycopg-binary ==3.1.12 ; extra == 'binary'
|
| 40 |
+
Provides-Extra: c
|
| 41 |
+
Requires-Dist: psycopg-c ==3.1.12 ; extra == 'c'
|
| 42 |
+
Provides-Extra: dev
|
| 43 |
+
Requires-Dist: black >=23.1.0 ; extra == 'dev'
|
| 44 |
+
Requires-Dist: dnspython >=2.1 ; extra == 'dev'
|
| 45 |
+
Requires-Dist: flake8 >=4.0 ; extra == 'dev'
|
| 46 |
+
Requires-Dist: mypy >=1.4.1 ; extra == 'dev'
|
| 47 |
+
Requires-Dist: types-setuptools >=57.4 ; extra == 'dev'
|
| 48 |
+
Requires-Dist: wheel >=0.37 ; extra == 'dev'
|
| 49 |
+
Provides-Extra: docs
|
| 50 |
+
Requires-Dist: Sphinx >=5.0 ; extra == 'docs'
|
| 51 |
+
Requires-Dist: furo ==2022.6.21 ; extra == 'docs'
|
| 52 |
+
Requires-Dist: sphinx-autobuild >=2021.3.14 ; extra == 'docs'
|
| 53 |
+
Requires-Dist: sphinx-autodoc-typehints >=1.12 ; extra == 'docs'
|
| 54 |
+
Provides-Extra: pool
|
| 55 |
+
Requires-Dist: psycopg-pool ; extra == 'pool'
|
| 56 |
+
Provides-Extra: test
|
| 57 |
+
Requires-Dist: anyio <4.0,>=3.6.2 ; extra == 'test'
|
| 58 |
+
Requires-Dist: mypy >=1.4.1 ; extra == 'test'
|
| 59 |
+
Requires-Dist: pproxy >=2.7 ; extra == 'test'
|
| 60 |
+
Requires-Dist: pytest >=6.2.5 ; extra == 'test'
|
| 61 |
+
Requires-Dist: pytest-cov >=3.0 ; extra == 'test'
|
| 62 |
+
Requires-Dist: pytest-randomly >=3.5 ; extra == 'test'
|
| 63 |
+
|
| 64 |
+
Psycopg 3: PostgreSQL database adapter for Python
|
| 65 |
+
=================================================
|
| 66 |
+
|
| 67 |
+
Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.
|
| 68 |
+
|
| 69 |
+
This distribution contains the pure Python package ``psycopg``.
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
Installation
|
| 73 |
+
------------
|
| 74 |
+
|
| 75 |
+
In short, run the following::
|
| 76 |
+
|
| 77 |
+
pip install --upgrade pip # to upgrade pip
|
| 78 |
+
pip install "psycopg[binary,pool]" # to install package and dependencies
|
| 79 |
+
|
| 80 |
+
If something goes wrong, and for more information about installation, please
|
| 81 |
+
check out the `Installation documentation`__.
|
| 82 |
+
|
| 83 |
+
.. __: https://www.psycopg.org/psycopg3/docs/basic/install.html#
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
Hacking
|
| 87 |
+
-------
|
| 88 |
+
|
| 89 |
+
For development information check out `the project readme`__.
|
| 90 |
+
|
| 91 |
+
.. __: https://github.com/psycopg/psycopg#readme
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
Copyright (C) 2020 The Psycopg Team
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/RECORD
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
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0cC-SQc,3599
|
| 4 |
+
psycopg-3.1.12.dist-info/RECORD,,
|
| 5 |
+
psycopg-3.1.12.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
psycopg-3.1.12.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
| 7 |
+
psycopg-3.1.12.dist-info/top_level.txt,sha256=npthKx2_OEoahttYqdsIPlRUgjS_bQBmfpDCVxQcPGo,8
|
| 8 |
+
psycopg/__init__.py,sha256=IALSmAJ3hedCpA_mesbu-Df0jtdSj87uqkerLNmxpvA,3055
|
| 9 |
+
psycopg/__pycache__/__init__.cpython-311.pyc,,
|
| 10 |
+
psycopg/__pycache__/_adapters_map.cpython-311.pyc,,
|
| 11 |
+
psycopg/__pycache__/_cmodule.cpython-311.pyc,,
|
| 12 |
+
psycopg/__pycache__/_column.cpython-311.pyc,,
|
| 13 |
+
psycopg/__pycache__/_compat.cpython-311.pyc,,
|
| 14 |
+
psycopg/__pycache__/_dns.cpython-311.pyc,,
|
| 15 |
+
psycopg/__pycache__/_encodings.cpython-311.pyc,,
|
| 16 |
+
psycopg/__pycache__/_enums.cpython-311.pyc,,
|
| 17 |
+
psycopg/__pycache__/_pipeline.cpython-311.pyc,,
|
| 18 |
+
psycopg/__pycache__/_preparing.cpython-311.pyc,,
|
| 19 |
+
psycopg/__pycache__/_queries.cpython-311.pyc,,
|
| 20 |
+
psycopg/__pycache__/_struct.cpython-311.pyc,,
|
| 21 |
+
psycopg/__pycache__/_tpc.cpython-311.pyc,,
|
| 22 |
+
psycopg/__pycache__/_transform.cpython-311.pyc,,
|
| 23 |
+
psycopg/__pycache__/_typeinfo.cpython-311.pyc,,
|
| 24 |
+
psycopg/__pycache__/_tz.cpython-311.pyc,,
|
| 25 |
+
psycopg/__pycache__/_wrappers.cpython-311.pyc,,
|
| 26 |
+
psycopg/__pycache__/abc.cpython-311.pyc,,
|
| 27 |
+
psycopg/__pycache__/adapt.cpython-311.pyc,,
|
| 28 |
+
psycopg/__pycache__/client_cursor.cpython-311.pyc,,
|
| 29 |
+
psycopg/__pycache__/connection.cpython-311.pyc,,
|
| 30 |
+
psycopg/__pycache__/connection_async.cpython-311.pyc,,
|
| 31 |
+
psycopg/__pycache__/conninfo.cpython-311.pyc,,
|
| 32 |
+
psycopg/__pycache__/copy.cpython-311.pyc,,
|
| 33 |
+
psycopg/__pycache__/cursor.cpython-311.pyc,,
|
| 34 |
+
psycopg/__pycache__/cursor_async.cpython-311.pyc,,
|
| 35 |
+
psycopg/__pycache__/dbapi20.cpython-311.pyc,,
|
| 36 |
+
psycopg/__pycache__/errors.cpython-311.pyc,,
|
| 37 |
+
psycopg/__pycache__/generators.cpython-311.pyc,,
|
| 38 |
+
psycopg/__pycache__/postgres.cpython-311.pyc,,
|
| 39 |
+
psycopg/__pycache__/rows.cpython-311.pyc,,
|
| 40 |
+
psycopg/__pycache__/server_cursor.cpython-311.pyc,,
|
| 41 |
+
psycopg/__pycache__/sql.cpython-311.pyc,,
|
| 42 |
+
psycopg/__pycache__/transaction.cpython-311.pyc,,
|
| 43 |
+
psycopg/__pycache__/version.cpython-311.pyc,,
|
| 44 |
+
psycopg/__pycache__/waiting.cpython-311.pyc,,
|
| 45 |
+
psycopg/_adapters_map.py,sha256=PTWGZk1lQo4ajvU93NV-5SSQ6pza8L1vjcukjEdKeCQ,10739
|
| 46 |
+
psycopg/_cmodule.py,sha256=q6CxV-8shy72bscUFaeltbREcA8lUJ6IEFjuf4X8HfU,786
|
| 47 |
+
psycopg/_column.py,sha256=TF_XEIpltbGMyXtLV2I1fL9Kgzi8KmQVOxWDedmb_nY,3803
|
| 48 |
+
psycopg/_compat.py,sha256=7bA8L_rzgUZQ01_lJAs7kGj3ElgWFQtnbc4lKwUq2Lg,1763
|
| 49 |
+
psycopg/_dns.py,sha256=tMxJCt1r-E-sSZjR1Yur66CaaCdUnaI4DHwSLES5Pzs,7316
|
| 50 |
+
psycopg/_encodings.py,sha256=GTzriHVX0j1eDcR0gpeKp5zJaZkVe0I3a1vTiyVewXY,4518
|
| 51 |
+
psycopg/_enums.py,sha256=GXJG0OqgQRaUOisysI3iWEvtGko8xrFJwAmnbehci-0,1678
|
| 52 |
+
psycopg/_pipeline.py,sha256=qf7Hnf9oBSzUfdkmKtaellHbGjyaSK8aR5qFiPg-a4M,10525
|
| 53 |
+
psycopg/_preparing.py,sha256=vHtIFcFkz4PINKNNevMb4uaaUXfy36e_23MY0Be3uxE,6203
|
| 54 |
+
psycopg/_queries.py,sha256=_yLbHBymZK2D9lFR1Ox0Cj5ZllOiiH3e3-a18HReRUU,13240
|
| 55 |
+
psycopg/_struct.py,sha256=jgJpHymLt899gaIPDlTUBkx3T6yTKBCr92DXR23loNY,2014
|
| 56 |
+
psycopg/_tpc.py,sha256=3cWUSpUg0RgI_PEXCKmsr-ubHIKcqfsWX6MxOtKhUns,3583
|
| 57 |
+
psycopg/_transform.py,sha256=7CqDv_MKvFC_RbbwINdNj25io5apuDu2TbqWXjDAVnw,11575
|
| 58 |
+
psycopg/_typeinfo.py,sha256=PN_3o68sFGsk605wbQcy6Q1B1KzHT58ZFzqZmAAYTSw,14726
|
| 59 |
+
psycopg/_tz.py,sha256=2O-tdDIVg1ckvbZ2W5gWX7O2O-RkotGEtCggn-NIT8U,1200
|
| 60 |
+
psycopg/_wrappers.py,sha256=wKZt_ar8QuRgEKC6tuwamYXCwB1P7IZQsmgYdVOlAhU,3126
|
| 61 |
+
psycopg/abc.py,sha256=kQ62n9TnSfZZjYrZN71CMNk9oRBIKKcWXIl-tLIInfk,7725
|
| 62 |
+
psycopg/adapt.py,sha256=hnWdPy1ylx8gLMTBq99vevqmOhOyQJcDPnKuQ3SV3Vk,5307
|
| 63 |
+
psycopg/client_cursor.py,sha256=F0yIS7YMDegIEtSIvzTxJ0naR6k00PWnevsxRcPoOcU,2815
|
| 64 |
+
psycopg/connection.py,sha256=R_Zdmk6D8DIqujzT1y0vIk0t-U33Hp_bQd6qDxsu9QM,34386
|
| 65 |
+
psycopg/connection_async.py,sha256=6Fj0bf-RWXfKXuhgCUv1pDyD-UgRJc1kleK0sUUtv1E,14172
|
| 66 |
+
psycopg/conninfo.py,sha256=wbul7hMsnk38e1WBOEZ2LyYbcBXLQOyT9fAqABxiVeU,11906
|
| 67 |
+
psycopg/copy.py,sha256=CGBMcAIeh7AlwD8R2dr6um-_OF9cVbLIHzWiFPfO-ag,29828
|
| 68 |
+
psycopg/crdb/__init__.py,sha256=kyfsUIGuFvQTpLuXJcQ6gMpOB5WXeWtBa2wQjaqE3-g,396
|
| 69 |
+
psycopg/crdb/__pycache__/__init__.cpython-311.pyc,,
|
| 70 |
+
psycopg/crdb/__pycache__/_types.cpython-311.pyc,,
|
| 71 |
+
psycopg/crdb/__pycache__/connection.cpython-311.pyc,,
|
| 72 |
+
psycopg/crdb/_types.py,sha256=ELUBFTS3UD_P2cIR68IVRZQ3Gv2CzJQvdbqt2LMB5Z4,5891
|
| 73 |
+
psycopg/crdb/connection.py,sha256=qxXG1DqIro6ezbxyifOE55ZwKdWFMrtJyK05LNaIGSo,5394
|
| 74 |
+
psycopg/cursor.py,sha256=zQRYZGzaFmV9FuD1Eo0t8WznKy7T_QSBocAODT8LBQE,31437
|
| 75 |
+
psycopg/cursor_async.py,sha256=n_nAcycsL3xM0gqmfeerV9Wl5rnd9VnAHr2yXFPGq9I,8017
|
| 76 |
+
psycopg/dbapi20.py,sha256=-kzMT8Rn9-U2IMctFAEjVNlWFDvAHH_Q13B3k6T6TEo,3175
|
| 77 |
+
psycopg/errors.py,sha256=HdFMiNN-1TQwv_lg5s-s9beYAmZ7czxa0iSJGWMEngw,45226
|
| 78 |
+
psycopg/generators.py,sha256=JkfSSQXoWAFBnnHKTFH9k0eoPQtl6ET_8ZSyK6j_zbA,9948
|
| 79 |
+
psycopg/postgres.py,sha256=FpWMrMHSrmUpzmItstDD35Kks5yLskRY4XVoKGzKCAg,4986
|
| 80 |
+
psycopg/pq/__init__.py,sha256=1zGPgm9Zf31MfBaX7jz-t_F8YA1lRJNQx1rDJ1cnGAI,3880
|
| 81 |
+
psycopg/pq/__pycache__/__init__.cpython-311.pyc,,
|
| 82 |
+
psycopg/pq/__pycache__/_debug.cpython-311.pyc,,
|
| 83 |
+
psycopg/pq/__pycache__/_enums.cpython-311.pyc,,
|
| 84 |
+
psycopg/pq/__pycache__/_pq_ctypes.cpython-311.pyc,,
|
| 85 |
+
psycopg/pq/__pycache__/abc.cpython-311.pyc,,
|
| 86 |
+
psycopg/pq/__pycache__/misc.cpython-311.pyc,,
|
| 87 |
+
psycopg/pq/__pycache__/pq_ctypes.cpython-311.pyc,,
|
| 88 |
+
psycopg/pq/_debug.py,sha256=jfIsSITc43a1AlNdaOd0r7UhbV6wc2ed1zBJ8n3Y4BA,3051
|
| 89 |
+
psycopg/pq/_enums.py,sha256=a5crxkDrP6NMBcdYuGnoL-QExEg-qqe0QtNc9SFXt1U,5660
|
| 90 |
+
psycopg/pq/_pq_ctypes.py,sha256=tr9BeMMEOnjCC8t4uZIxlyZJc-zKgztQ63hvGs0FcT4,20061
|
| 91 |
+
psycopg/pq/abc.py,sha256=PGhs5_MOfYhyo23r8PLZxozK9bVH2ACe8c8TnewYPmw,7767
|
| 92 |
+
psycopg/pq/misc.py,sha256=1VCWIvzebWNG1Ej7KJI5NpWsPFJReaJRGoM1VODpMJ0,3957
|
| 93 |
+
psycopg/pq/pq_ctypes.py,sha256=oU085qsovMe453T-QM848j_ODetxeLagNpcTDpoL8RI,35791
|
| 94 |
+
psycopg/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 95 |
+
psycopg/rows.py,sha256=jMWlUMqVehBB_PWkn_o2rnvwJrz2xQz2BIyq-hqoYyM,7318
|
| 96 |
+
psycopg/server_cursor.py,sha256=fkOaZ_sTKmqVm1R190rKu1IcC3DcE7VI0Er0rsx4l68,15006
|
| 97 |
+
psycopg/sql.py,sha256=1VlZ5esUXJYTU-h796FfnHJCnsiYPDcvrzjJfC_qlxo,15925
|
| 98 |
+
psycopg/transaction.py,sha256=oX9XpQuxirjnKZuYV4U9_H9fm5RoJE97SWJxS6oV8Cw,9458
|
| 99 |
+
psycopg/types/__init__.py,sha256=JPAkV4EfkXwdsr76_U1DsQV19c8aQNSB6kgud4bhXeM,181
|
| 100 |
+
psycopg/types/__pycache__/__init__.cpython-311.pyc,,
|
| 101 |
+
psycopg/types/__pycache__/array.cpython-311.pyc,,
|
| 102 |
+
psycopg/types/__pycache__/bool.cpython-311.pyc,,
|
| 103 |
+
psycopg/types/__pycache__/composite.cpython-311.pyc,,
|
| 104 |
+
psycopg/types/__pycache__/datetime.cpython-311.pyc,,
|
| 105 |
+
psycopg/types/__pycache__/enum.cpython-311.pyc,,
|
| 106 |
+
psycopg/types/__pycache__/hstore.cpython-311.pyc,,
|
| 107 |
+
psycopg/types/__pycache__/json.cpython-311.pyc,,
|
| 108 |
+
psycopg/types/__pycache__/multirange.cpython-311.pyc,,
|
| 109 |
+
psycopg/types/__pycache__/net.cpython-311.pyc,,
|
| 110 |
+
psycopg/types/__pycache__/none.cpython-311.pyc,,
|
| 111 |
+
psycopg/types/__pycache__/numeric.cpython-311.pyc,,
|
| 112 |
+
psycopg/types/__pycache__/range.cpython-311.pyc,,
|
| 113 |
+
psycopg/types/__pycache__/shapely.cpython-311.pyc,,
|
| 114 |
+
psycopg/types/__pycache__/string.cpython-311.pyc,,
|
| 115 |
+
psycopg/types/__pycache__/uuid.cpython-311.pyc,,
|
| 116 |
+
psycopg/types/array.py,sha256=0vt0wg9D4P2xGRBllNWX6fndYvqr8PXag3l7n6oaQB0,15281
|
| 117 |
+
psycopg/types/bool.py,sha256=yLbDw8HCl26j7MFB3xlkaTdSK0pBrk2NKe5NuY4lc_w,1137
|
| 118 |
+
psycopg/types/composite.py,sha256=WY0Dq1iWN7BVOsOylTuZDvF9kwe5qbbKsaNX5EkBlAE,10419
|
| 119 |
+
psycopg/types/datetime.py,sha256=yoViTWpRkkdBImVebjwSjFufHLu9BBV_YIAuHRINzZ8,24788
|
| 120 |
+
psycopg/types/enum.py,sha256=NycuVchMGFiFJUX6dNpP86HM128hZ5zMbiRKNtghWGA,6295
|
| 121 |
+
psycopg/types/hstore.py,sha256=JzBWyNibHiMK-P8Ab-F0hzqOpICrqrGNTIkhiEQbxMY,4103
|
| 122 |
+
psycopg/types/json.py,sha256=FJ6MJkYuJ-VzLeJ2MhGxKJt_7kS-qSbsYlicXMpNQQ0,7404
|
| 123 |
+
psycopg/types/multirange.py,sha256=SfR4a6Abhx6f1pN2E2T3HTmjubqct0kLRKoC0ayaK7s,16689
|
| 124 |
+
psycopg/types/net.py,sha256=JIU0Odz8yJ_lbGanYoQ-kSrSF5k0lHYNn12wwn4uVho,6941
|
| 125 |
+
psycopg/types/none.py,sha256=4b96Aw0WSW6Jpo_HMIvKUkivAxkxvHJzvzy-Q6Uf-60,613
|
| 126 |
+
psycopg/types/numeric.py,sha256=RpeY0CfipDcR4t15sc3ZbytK90lFCLCJEOIhicMkpuk,13703
|
| 127 |
+
psycopg/types/range.py,sha256=9_033Zst39mbG5-pB0ZNCGh12CZcX4Melyy4JJahkkA,20777
|
| 128 |
+
psycopg/types/shapely.py,sha256=aWzPUJr2FL6eATd-KcHslvWmXo6idxb3_G-sZ92ngDk,2443
|
| 129 |
+
psycopg/types/string.py,sha256=hWqmXSkX1da7Bg7JSuu-5f4ea6Ho3Aklz8lO89rfGzE,7662
|
| 130 |
+
psycopg/types/uuid.py,sha256=5xqkVcZ22jX7a2oU9PXz_71y6VKpO5EYj8AITiSQNBE,1616
|
| 131 |
+
psycopg/version.py,sha256=a9jFaoEVxlYNfqfR-EAM4p0_vQBx1RQzjU5nrEpIVs4,376
|
| 132 |
+
psycopg/waiting.py,sha256=Rh5MEz8VNgCD4l60zUOxG-dDBFw2QSez1ftyKKaS6pg,12110
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/REQUESTED
ADDED
|
File without changes
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.41.2)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg-3.1.12.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
psycopg
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/__init__.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
psycopg -- PostgreSQL database adapter for Python
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import logging
|
| 8 |
+
|
| 9 |
+
from . import pq # noqa: F401 import early to stabilize side effects
|
| 10 |
+
from . import types
|
| 11 |
+
from . import postgres
|
| 12 |
+
from ._tpc import Xid
|
| 13 |
+
from .copy import Copy, AsyncCopy
|
| 14 |
+
from ._enums import IsolationLevel
|
| 15 |
+
from .cursor import Cursor
|
| 16 |
+
from .errors import Warning, Error, InterfaceError, DatabaseError
|
| 17 |
+
from .errors import DataError, OperationalError, IntegrityError
|
| 18 |
+
from .errors import InternalError, ProgrammingError, NotSupportedError
|
| 19 |
+
from ._column import Column
|
| 20 |
+
from .conninfo import ConnectionInfo
|
| 21 |
+
from ._pipeline import Pipeline, AsyncPipeline
|
| 22 |
+
from .connection import BaseConnection, Connection, Notify
|
| 23 |
+
from .transaction import Rollback, Transaction, AsyncTransaction
|
| 24 |
+
from .cursor_async import AsyncCursor
|
| 25 |
+
from .server_cursor import AsyncServerCursor, ServerCursor
|
| 26 |
+
from .client_cursor import AsyncClientCursor, ClientCursor
|
| 27 |
+
from .connection_async import AsyncConnection
|
| 28 |
+
|
| 29 |
+
from . import dbapi20
|
| 30 |
+
from .dbapi20 import BINARY, DATETIME, NUMBER, ROWID, STRING
|
| 31 |
+
from .dbapi20 import Binary, Date, DateFromTicks, Time, TimeFromTicks
|
| 32 |
+
from .dbapi20 import Timestamp, TimestampFromTicks
|
| 33 |
+
|
| 34 |
+
from .version import __version__ as __version__ # noqa: F401
|
| 35 |
+
|
| 36 |
+
# Set the logger to a quiet default, can be enabled if needed
|
| 37 |
+
logger = logging.getLogger("psycopg")
|
| 38 |
+
if logger.level == logging.NOTSET:
|
| 39 |
+
logger.setLevel(logging.WARNING)
|
| 40 |
+
|
| 41 |
+
# DBAPI compliance
|
| 42 |
+
connect = Connection.connect
|
| 43 |
+
apilevel = "2.0"
|
| 44 |
+
threadsafety = 2
|
| 45 |
+
paramstyle = "pyformat"
|
| 46 |
+
|
| 47 |
+
# register default adapters for PostgreSQL
|
| 48 |
+
adapters = postgres.adapters # exposed by the package
|
| 49 |
+
postgres.register_default_adapters(adapters)
|
| 50 |
+
|
| 51 |
+
# After the default ones, because these can deal with the bytea oid better
|
| 52 |
+
dbapi20.register_dbapi20_adapters(adapters)
|
| 53 |
+
|
| 54 |
+
# Must come after all the types have been registered
|
| 55 |
+
types.array.register_all_arrays(adapters)
|
| 56 |
+
|
| 57 |
+
# Note: defining the exported methods helps both Sphynx in documenting that
|
| 58 |
+
# this is the canonical place to obtain them and should be used by MyPy too,
|
| 59 |
+
# so that function signatures are consistent with the documentation.
|
| 60 |
+
__all__ = [
|
| 61 |
+
"AsyncClientCursor",
|
| 62 |
+
"AsyncConnection",
|
| 63 |
+
"AsyncCopy",
|
| 64 |
+
"AsyncCursor",
|
| 65 |
+
"AsyncPipeline",
|
| 66 |
+
"AsyncServerCursor",
|
| 67 |
+
"AsyncTransaction",
|
| 68 |
+
"BaseConnection",
|
| 69 |
+
"ClientCursor",
|
| 70 |
+
"Column",
|
| 71 |
+
"Connection",
|
| 72 |
+
"ConnectionInfo",
|
| 73 |
+
"Copy",
|
| 74 |
+
"Cursor",
|
| 75 |
+
"IsolationLevel",
|
| 76 |
+
"Notify",
|
| 77 |
+
"Pipeline",
|
| 78 |
+
"Rollback",
|
| 79 |
+
"ServerCursor",
|
| 80 |
+
"Transaction",
|
| 81 |
+
"Xid",
|
| 82 |
+
# DBAPI exports
|
| 83 |
+
"connect",
|
| 84 |
+
"apilevel",
|
| 85 |
+
"threadsafety",
|
| 86 |
+
"paramstyle",
|
| 87 |
+
"Warning",
|
| 88 |
+
"Error",
|
| 89 |
+
"InterfaceError",
|
| 90 |
+
"DatabaseError",
|
| 91 |
+
"DataError",
|
| 92 |
+
"OperationalError",
|
| 93 |
+
"IntegrityError",
|
| 94 |
+
"InternalError",
|
| 95 |
+
"ProgrammingError",
|
| 96 |
+
"NotSupportedError",
|
| 97 |
+
# DBAPI type constructors and singletons
|
| 98 |
+
"Binary",
|
| 99 |
+
"Date",
|
| 100 |
+
"DateFromTicks",
|
| 101 |
+
"Time",
|
| 102 |
+
"TimeFromTicks",
|
| 103 |
+
"Timestamp",
|
| 104 |
+
"TimestampFromTicks",
|
| 105 |
+
"BINARY",
|
| 106 |
+
"DATETIME",
|
| 107 |
+
"NUMBER",
|
| 108 |
+
"ROWID",
|
| 109 |
+
"STRING",
|
| 110 |
+
]
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_adapters_map.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Mapping from types/oids to Dumpers/Loaders
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
from typing import Any, Dict, List, Optional, Type, TypeVar, Union
|
| 8 |
+
from typing import cast, TYPE_CHECKING
|
| 9 |
+
|
| 10 |
+
from . import pq
|
| 11 |
+
from . import errors as e
|
| 12 |
+
from .abc import Dumper, Loader
|
| 13 |
+
from ._enums import PyFormat as PyFormat
|
| 14 |
+
from ._cmodule import _psycopg
|
| 15 |
+
from ._typeinfo import TypesRegistry
|
| 16 |
+
|
| 17 |
+
if TYPE_CHECKING:
|
| 18 |
+
from .connection import BaseConnection
|
| 19 |
+
|
| 20 |
+
RV = TypeVar("RV")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class AdaptersMap:
|
| 24 |
+
r"""
|
| 25 |
+
Establish how types should be converted between Python and PostgreSQL in
|
| 26 |
+
an `~psycopg.abc.AdaptContext`.
|
| 27 |
+
|
| 28 |
+
`!AdaptersMap` maps Python types to `~psycopg.adapt.Dumper` classes to
|
| 29 |
+
define how Python types are converted to PostgreSQL, and maps OIDs to
|
| 30 |
+
`~psycopg.adapt.Loader` classes to establish how query results are
|
| 31 |
+
converted to Python.
|
| 32 |
+
|
| 33 |
+
Every `!AdaptContext` object has an underlying `!AdaptersMap` defining how
|
| 34 |
+
types are converted in that context, exposed as the
|
| 35 |
+
`~psycopg.abc.AdaptContext.adapters` attribute: changing such map allows
|
| 36 |
+
to customise adaptation in a context without changing separated contexts.
|
| 37 |
+
|
| 38 |
+
When a context is created from another context (for instance when a
|
| 39 |
+
`~psycopg.Cursor` is created from a `~psycopg.Connection`), the parent's
|
| 40 |
+
`!adapters` are used as template for the child's `!adapters`, so that every
|
| 41 |
+
cursor created from the same connection use the connection's types
|
| 42 |
+
configuration, but separate connections have independent mappings.
|
| 43 |
+
|
| 44 |
+
Once created, `!AdaptersMap` are independent. This means that objects
|
| 45 |
+
already created are not affected if a wider scope (e.g. the global one) is
|
| 46 |
+
changed.
|
| 47 |
+
|
| 48 |
+
The connections adapters are initialised using a global `!AdptersMap`
|
| 49 |
+
template, exposed as `psycopg.adapters`: changing such mapping allows to
|
| 50 |
+
customise the type mapping for every connections created afterwards.
|
| 51 |
+
|
| 52 |
+
The object can start empty or copy from another object of the same class.
|
| 53 |
+
Copies are copy-on-write: if the maps are updated make a copy. This way
|
| 54 |
+
extending e.g. global map by a connection or a connection map from a cursor
|
| 55 |
+
is cheap: a copy is only made on customisation.
|
| 56 |
+
"""
|
| 57 |
+
|
| 58 |
+
__module__ = "psycopg.adapt"
|
| 59 |
+
|
| 60 |
+
types: TypesRegistry
|
| 61 |
+
|
| 62 |
+
_dumpers: Dict[PyFormat, Dict[Union[type, str], Type[Dumper]]]
|
| 63 |
+
_dumpers_by_oid: List[Dict[int, Type[Dumper]]]
|
| 64 |
+
_loaders: List[Dict[int, Type[Loader]]]
|
| 65 |
+
|
| 66 |
+
# Record if a dumper or loader has an optimised version.
|
| 67 |
+
_optimised: Dict[type, type] = {}
|
| 68 |
+
|
| 69 |
+
def __init__(
|
| 70 |
+
self,
|
| 71 |
+
template: Optional["AdaptersMap"] = None,
|
| 72 |
+
types: Optional[TypesRegistry] = None,
|
| 73 |
+
):
|
| 74 |
+
if template:
|
| 75 |
+
self._dumpers = template._dumpers.copy()
|
| 76 |
+
self._own_dumpers = _dumpers_shared.copy()
|
| 77 |
+
template._own_dumpers = _dumpers_shared.copy()
|
| 78 |
+
|
| 79 |
+
self._dumpers_by_oid = template._dumpers_by_oid[:]
|
| 80 |
+
self._own_dumpers_by_oid = [False, False]
|
| 81 |
+
template._own_dumpers_by_oid = [False, False]
|
| 82 |
+
|
| 83 |
+
self._loaders = template._loaders[:]
|
| 84 |
+
self._own_loaders = [False, False]
|
| 85 |
+
template._own_loaders = [False, False]
|
| 86 |
+
|
| 87 |
+
self.types = TypesRegistry(template.types)
|
| 88 |
+
|
| 89 |
+
else:
|
| 90 |
+
self._dumpers = {fmt: {} for fmt in PyFormat}
|
| 91 |
+
self._own_dumpers = _dumpers_owned.copy()
|
| 92 |
+
|
| 93 |
+
self._dumpers_by_oid = [{}, {}]
|
| 94 |
+
self._own_dumpers_by_oid = [True, True]
|
| 95 |
+
|
| 96 |
+
self._loaders = [{}, {}]
|
| 97 |
+
self._own_loaders = [True, True]
|
| 98 |
+
|
| 99 |
+
self.types = types or TypesRegistry()
|
| 100 |
+
|
| 101 |
+
# implement the AdaptContext protocol too
|
| 102 |
+
@property
|
| 103 |
+
def adapters(self) -> "AdaptersMap":
|
| 104 |
+
return self
|
| 105 |
+
|
| 106 |
+
@property
|
| 107 |
+
def connection(self) -> Optional["BaseConnection[Any]"]:
|
| 108 |
+
return None
|
| 109 |
+
|
| 110 |
+
def register_dumper(
|
| 111 |
+
self, cls: Union[type, str, None], dumper: Type[Dumper]
|
| 112 |
+
) -> None:
|
| 113 |
+
"""
|
| 114 |
+
Configure the context to use `!dumper` to convert objects of type `!cls`.
|
| 115 |
+
|
| 116 |
+
If two dumpers with different `~Dumper.format` are registered for the
|
| 117 |
+
same type, the last one registered will be chosen when the query
|
| 118 |
+
doesn't specify a format (i.e. when the value is used with a ``%s``
|
| 119 |
+
"`~PyFormat.AUTO`" placeholder).
|
| 120 |
+
|
| 121 |
+
:param cls: The type to manage.
|
| 122 |
+
:param dumper: The dumper to register for `!cls`.
|
| 123 |
+
|
| 124 |
+
If `!cls` is specified as string it will be lazy-loaded, so that it
|
| 125 |
+
will be possible to register it without importing it before. In this
|
| 126 |
+
case it should be the fully qualified name of the object (e.g.
|
| 127 |
+
``"uuid.UUID"``).
|
| 128 |
+
|
| 129 |
+
If `!cls` is None, only use the dumper when looking up using
|
| 130 |
+
`get_dumper_by_oid()`, which happens when we know the Postgres type to
|
| 131 |
+
adapt to, but not the Python type that will be adapted (e.g. in COPY
|
| 132 |
+
after using `~psycopg.Copy.set_types()`).
|
| 133 |
+
|
| 134 |
+
"""
|
| 135 |
+
if not (cls is None or isinstance(cls, (str, type))):
|
| 136 |
+
raise TypeError(
|
| 137 |
+
f"dumpers should be registered on classes, got {cls} instead"
|
| 138 |
+
)
|
| 139 |
+
|
| 140 |
+
if _psycopg:
|
| 141 |
+
dumper = self._get_optimised(dumper)
|
| 142 |
+
|
| 143 |
+
# Register the dumper both as its format and as auto
|
| 144 |
+
# so that the last dumper registered is used in auto (%s) format
|
| 145 |
+
if cls:
|
| 146 |
+
for fmt in (PyFormat.from_pq(dumper.format), PyFormat.AUTO):
|
| 147 |
+
if not self._own_dumpers[fmt]:
|
| 148 |
+
self._dumpers[fmt] = self._dumpers[fmt].copy()
|
| 149 |
+
self._own_dumpers[fmt] = True
|
| 150 |
+
|
| 151 |
+
self._dumpers[fmt][cls] = dumper
|
| 152 |
+
|
| 153 |
+
# Register the dumper by oid, if the oid of the dumper is fixed
|
| 154 |
+
if dumper.oid:
|
| 155 |
+
if not self._own_dumpers_by_oid[dumper.format]:
|
| 156 |
+
self._dumpers_by_oid[dumper.format] = self._dumpers_by_oid[
|
| 157 |
+
dumper.format
|
| 158 |
+
].copy()
|
| 159 |
+
self._own_dumpers_by_oid[dumper.format] = True
|
| 160 |
+
|
| 161 |
+
self._dumpers_by_oid[dumper.format][dumper.oid] = dumper
|
| 162 |
+
|
| 163 |
+
def register_loader(self, oid: Union[int, str], loader: Type["Loader"]) -> None:
|
| 164 |
+
"""
|
| 165 |
+
Configure the context to use `!loader` to convert data of oid `!oid`.
|
| 166 |
+
|
| 167 |
+
:param oid: The PostgreSQL OID or type name to manage.
|
| 168 |
+
:param loader: The loar to register for `!oid`.
|
| 169 |
+
|
| 170 |
+
If `oid` is specified as string, it refers to a type name, which is
|
| 171 |
+
looked up in the `types` registry. `
|
| 172 |
+
|
| 173 |
+
"""
|
| 174 |
+
if isinstance(oid, str):
|
| 175 |
+
oid = self.types[oid].oid
|
| 176 |
+
if not isinstance(oid, int):
|
| 177 |
+
raise TypeError(f"loaders should be registered on oid, got {oid} instead")
|
| 178 |
+
|
| 179 |
+
if _psycopg:
|
| 180 |
+
loader = self._get_optimised(loader)
|
| 181 |
+
|
| 182 |
+
fmt = loader.format
|
| 183 |
+
if not self._own_loaders[fmt]:
|
| 184 |
+
self._loaders[fmt] = self._loaders[fmt].copy()
|
| 185 |
+
self._own_loaders[fmt] = True
|
| 186 |
+
|
| 187 |
+
self._loaders[fmt][oid] = loader
|
| 188 |
+
|
| 189 |
+
def get_dumper(self, cls: type, format: PyFormat) -> Type["Dumper"]:
|
| 190 |
+
"""
|
| 191 |
+
Return the dumper class for the given type and format.
|
| 192 |
+
|
| 193 |
+
Raise `~psycopg.ProgrammingError` if a class is not available.
|
| 194 |
+
|
| 195 |
+
:param cls: The class to adapt.
|
| 196 |
+
:param format: The format to dump to. If `~psycopg.adapt.PyFormat.AUTO`,
|
| 197 |
+
use the last one of the dumpers registered on `!cls`.
|
| 198 |
+
"""
|
| 199 |
+
try:
|
| 200 |
+
# Fast path: the class has a known dumper.
|
| 201 |
+
return self._dumpers[format][cls]
|
| 202 |
+
except KeyError:
|
| 203 |
+
if format not in self._dumpers:
|
| 204 |
+
raise ValueError(f"bad dumper format: {format}")
|
| 205 |
+
|
| 206 |
+
# If the KeyError was caused by cls missing from dmap, let's
|
| 207 |
+
# look for different cases.
|
| 208 |
+
dmap = self._dumpers[format]
|
| 209 |
+
|
| 210 |
+
# Look for the right class, including looking at superclasses
|
| 211 |
+
for scls in cls.__mro__:
|
| 212 |
+
if scls in dmap:
|
| 213 |
+
return dmap[scls]
|
| 214 |
+
|
| 215 |
+
# If the adapter is not found, look for its name as a string
|
| 216 |
+
fqn = scls.__module__ + "." + scls.__qualname__
|
| 217 |
+
if fqn in dmap:
|
| 218 |
+
# Replace the class name with the class itself
|
| 219 |
+
d = dmap[scls] = dmap.pop(fqn)
|
| 220 |
+
return d
|
| 221 |
+
|
| 222 |
+
format = PyFormat(format)
|
| 223 |
+
raise e.ProgrammingError(
|
| 224 |
+
f"cannot adapt type {cls.__name__!r} using placeholder '%{format.value}'"
|
| 225 |
+
f" (format: {format.name})"
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
def get_dumper_by_oid(self, oid: int, format: pq.Format) -> Type["Dumper"]:
|
| 229 |
+
"""
|
| 230 |
+
Return the dumper class for the given oid and format.
|
| 231 |
+
|
| 232 |
+
Raise `~psycopg.ProgrammingError` if a class is not available.
|
| 233 |
+
|
| 234 |
+
:param oid: The oid of the type to dump to.
|
| 235 |
+
:param format: The format to dump to.
|
| 236 |
+
"""
|
| 237 |
+
try:
|
| 238 |
+
dmap = self._dumpers_by_oid[format]
|
| 239 |
+
except KeyError:
|
| 240 |
+
raise ValueError(f"bad dumper format: {format}")
|
| 241 |
+
|
| 242 |
+
try:
|
| 243 |
+
return dmap[oid]
|
| 244 |
+
except KeyError:
|
| 245 |
+
info = self.types.get(oid)
|
| 246 |
+
if info:
|
| 247 |
+
msg = (
|
| 248 |
+
f"cannot find a dumper for type {info.name} (oid {oid})"
|
| 249 |
+
f" format {pq.Format(format).name}"
|
| 250 |
+
)
|
| 251 |
+
else:
|
| 252 |
+
msg = (
|
| 253 |
+
f"cannot find a dumper for unknown type with oid {oid}"
|
| 254 |
+
f" format {pq.Format(format).name}"
|
| 255 |
+
)
|
| 256 |
+
raise e.ProgrammingError(msg)
|
| 257 |
+
|
| 258 |
+
def get_loader(self, oid: int, format: pq.Format) -> Optional[Type["Loader"]]:
|
| 259 |
+
"""
|
| 260 |
+
Return the loader class for the given oid and format.
|
| 261 |
+
|
| 262 |
+
Return `!None` if not found.
|
| 263 |
+
|
| 264 |
+
:param oid: The oid of the type to load.
|
| 265 |
+
:param format: The format to load from.
|
| 266 |
+
"""
|
| 267 |
+
return self._loaders[format].get(oid)
|
| 268 |
+
|
| 269 |
+
@classmethod
|
| 270 |
+
def _get_optimised(self, cls: Type[RV]) -> Type[RV]:
|
| 271 |
+
"""Return the optimised version of a Dumper or Loader class.
|
| 272 |
+
|
| 273 |
+
Return the input class itself if there is no optimised version.
|
| 274 |
+
"""
|
| 275 |
+
try:
|
| 276 |
+
return self._optimised[cls]
|
| 277 |
+
except KeyError:
|
| 278 |
+
pass
|
| 279 |
+
|
| 280 |
+
# Check if the class comes from psycopg.types and there is a class
|
| 281 |
+
# with the same name in psycopg_c._psycopg.
|
| 282 |
+
from psycopg import types
|
| 283 |
+
|
| 284 |
+
if cls.__module__.startswith(types.__name__):
|
| 285 |
+
new = cast(Type[RV], getattr(_psycopg, cls.__name__, None))
|
| 286 |
+
if new:
|
| 287 |
+
self._optimised[cls] = new
|
| 288 |
+
return new
|
| 289 |
+
|
| 290 |
+
self._optimised[cls] = cls
|
| 291 |
+
return cls
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
# Micro-optimization: copying these objects is faster than creating new dicts
|
| 295 |
+
_dumpers_owned = dict.fromkeys(PyFormat, True)
|
| 296 |
+
_dumpers_shared = dict.fromkeys(PyFormat, False)
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_cmodule.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Simplify access to the _psycopg module
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2021 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
from typing import Optional
|
| 8 |
+
|
| 9 |
+
from . import pq
|
| 10 |
+
|
| 11 |
+
__version__: Optional[str] = None
|
| 12 |
+
|
| 13 |
+
# Note: "c" must the first attempt so that mypy associates the variable the
|
| 14 |
+
# right module interface. It will not result Optional, but hey.
|
| 15 |
+
if pq.__impl__ == "c":
|
| 16 |
+
from psycopg_c import _psycopg as _psycopg
|
| 17 |
+
from psycopg_c import __version__ as __version__ # noqa: F401
|
| 18 |
+
elif pq.__impl__ == "binary":
|
| 19 |
+
from psycopg_binary import _psycopg as _psycopg # type: ignore
|
| 20 |
+
from psycopg_binary import __version__ as __version__ # type: ignore # noqa: F401
|
| 21 |
+
elif pq.__impl__ == "python":
|
| 22 |
+
_psycopg = None # type: ignore
|
| 23 |
+
else:
|
| 24 |
+
raise ImportError(f"can't find _psycopg optimised module in {pq.__impl__!r}")
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_column.py
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
The Column object in Cursor.description
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
from typing import Any, NamedTuple, Optional, Sequence, TYPE_CHECKING
|
| 8 |
+
from operator import attrgetter
|
| 9 |
+
|
| 10 |
+
if TYPE_CHECKING:
|
| 11 |
+
from .cursor import BaseCursor
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ColumnData(NamedTuple):
|
| 15 |
+
ftype: int
|
| 16 |
+
fmod: int
|
| 17 |
+
fsize: int
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class Column(Sequence[Any]):
|
| 21 |
+
__module__ = "psycopg"
|
| 22 |
+
|
| 23 |
+
def __init__(self, cursor: "BaseCursor[Any, Any]", index: int):
|
| 24 |
+
res = cursor.pgresult
|
| 25 |
+
assert res
|
| 26 |
+
|
| 27 |
+
fname = res.fname(index)
|
| 28 |
+
if fname:
|
| 29 |
+
self._name = fname.decode(cursor._encoding)
|
| 30 |
+
else:
|
| 31 |
+
# COPY_OUT results have columns but no name
|
| 32 |
+
self._name = f"column_{index + 1}"
|
| 33 |
+
|
| 34 |
+
self._data = ColumnData(
|
| 35 |
+
ftype=res.ftype(index),
|
| 36 |
+
fmod=res.fmod(index),
|
| 37 |
+
fsize=res.fsize(index),
|
| 38 |
+
)
|
| 39 |
+
self._type = cursor.adapters.types.get(self._data.ftype)
|
| 40 |
+
|
| 41 |
+
_attrs = tuple(
|
| 42 |
+
attrgetter(attr)
|
| 43 |
+
for attr in """
|
| 44 |
+
name type_code display_size internal_size precision scale null_ok
|
| 45 |
+
""".split()
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
def __repr__(self) -> str:
|
| 49 |
+
return (
|
| 50 |
+
f"<Column {self.name!r},"
|
| 51 |
+
f" type: {self._type_display()} (oid: {self.type_code})>"
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
def __len__(self) -> int:
|
| 55 |
+
return 7
|
| 56 |
+
|
| 57 |
+
def _type_display(self) -> str:
|
| 58 |
+
parts = []
|
| 59 |
+
parts.append(self._type.name if self._type else str(self.type_code))
|
| 60 |
+
|
| 61 |
+
mod1 = self.precision
|
| 62 |
+
if mod1 is None:
|
| 63 |
+
mod1 = self.display_size
|
| 64 |
+
if mod1:
|
| 65 |
+
parts.append(f"({mod1}")
|
| 66 |
+
if self.scale:
|
| 67 |
+
parts.append(f", {self.scale}")
|
| 68 |
+
parts.append(")")
|
| 69 |
+
|
| 70 |
+
if self._type and self.type_code == self._type.array_oid:
|
| 71 |
+
parts.append("[]")
|
| 72 |
+
|
| 73 |
+
return "".join(parts)
|
| 74 |
+
|
| 75 |
+
def __getitem__(self, index: Any) -> Any:
|
| 76 |
+
if isinstance(index, slice):
|
| 77 |
+
return tuple(getter(self) for getter in self._attrs[index])
|
| 78 |
+
else:
|
| 79 |
+
return self._attrs[index](self)
|
| 80 |
+
|
| 81 |
+
@property
|
| 82 |
+
def name(self) -> str:
|
| 83 |
+
"""The name of the column."""
|
| 84 |
+
return self._name
|
| 85 |
+
|
| 86 |
+
@property
|
| 87 |
+
def type_code(self) -> int:
|
| 88 |
+
"""The numeric OID of the column."""
|
| 89 |
+
return self._data.ftype
|
| 90 |
+
|
| 91 |
+
@property
|
| 92 |
+
def display_size(self) -> Optional[int]:
|
| 93 |
+
"""The field size, for :sql:`varchar(n)`, None otherwise."""
|
| 94 |
+
if not self._type:
|
| 95 |
+
return None
|
| 96 |
+
|
| 97 |
+
if self._type.name in ("varchar", "char"):
|
| 98 |
+
fmod = self._data.fmod
|
| 99 |
+
if fmod >= 0:
|
| 100 |
+
return fmod - 4
|
| 101 |
+
|
| 102 |
+
return None
|
| 103 |
+
|
| 104 |
+
@property
|
| 105 |
+
def internal_size(self) -> Optional[int]:
|
| 106 |
+
"""The internal field size for fixed-size types, None otherwise."""
|
| 107 |
+
fsize = self._data.fsize
|
| 108 |
+
return fsize if fsize >= 0 else None
|
| 109 |
+
|
| 110 |
+
@property
|
| 111 |
+
def precision(self) -> Optional[int]:
|
| 112 |
+
"""The number of digits for fixed precision types."""
|
| 113 |
+
if not self._type:
|
| 114 |
+
return None
|
| 115 |
+
|
| 116 |
+
dttypes = ("time", "timetz", "timestamp", "timestamptz", "interval")
|
| 117 |
+
if self._type.name == "numeric":
|
| 118 |
+
fmod = self._data.fmod
|
| 119 |
+
if fmod >= 0:
|
| 120 |
+
return fmod >> 16
|
| 121 |
+
|
| 122 |
+
elif self._type.name in dttypes:
|
| 123 |
+
fmod = self._data.fmod
|
| 124 |
+
if fmod >= 0:
|
| 125 |
+
return fmod & 0xFFFF
|
| 126 |
+
|
| 127 |
+
return None
|
| 128 |
+
|
| 129 |
+
@property
|
| 130 |
+
def scale(self) -> Optional[int]:
|
| 131 |
+
"""The number of digits after the decimal point if available."""
|
| 132 |
+
if self._type and self._type.name == "numeric":
|
| 133 |
+
fmod = self._data.fmod - 4
|
| 134 |
+
if fmod >= 0:
|
| 135 |
+
return fmod & 0xFFFF
|
| 136 |
+
|
| 137 |
+
return None
|
| 138 |
+
|
| 139 |
+
@property
|
| 140 |
+
def null_ok(self) -> Optional[bool]:
|
| 141 |
+
"""Always `!None`"""
|
| 142 |
+
return None
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_compat.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
compatibility functions for different Python versions
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2021 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import sys
|
| 8 |
+
import asyncio
|
| 9 |
+
from typing import Any, Awaitable, Generator, Optional, Sequence, Union, TypeVar
|
| 10 |
+
|
| 11 |
+
# NOTE: TypeAlias cannot be exported by this module, as pyright special-cases it.
|
| 12 |
+
# For this raisin it must be imported directly from typing_extension where used.
|
| 13 |
+
# See https://github.com/microsoft/pyright/issues/4197
|
| 14 |
+
from typing_extensions import TypeAlias
|
| 15 |
+
|
| 16 |
+
if sys.version_info >= (3, 8):
|
| 17 |
+
from typing import Protocol
|
| 18 |
+
else:
|
| 19 |
+
from typing_extensions import Protocol
|
| 20 |
+
|
| 21 |
+
T = TypeVar("T")
|
| 22 |
+
FutureT: TypeAlias = Union["asyncio.Future[T]", Generator[Any, None, T], Awaitable[T]]
|
| 23 |
+
|
| 24 |
+
if sys.version_info >= (3, 8):
|
| 25 |
+
create_task = asyncio.create_task
|
| 26 |
+
from math import prod
|
| 27 |
+
|
| 28 |
+
else:
|
| 29 |
+
|
| 30 |
+
def create_task(
|
| 31 |
+
coro: FutureT[T], name: Optional[str] = None
|
| 32 |
+
) -> "asyncio.Future[T]":
|
| 33 |
+
return asyncio.create_task(coro)
|
| 34 |
+
|
| 35 |
+
from functools import reduce
|
| 36 |
+
|
| 37 |
+
def prod(seq: Sequence[int]) -> int:
|
| 38 |
+
return reduce(int.__mul__, seq, 1)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
if sys.version_info >= (3, 9):
|
| 42 |
+
from zoneinfo import ZoneInfo
|
| 43 |
+
from functools import cache
|
| 44 |
+
from collections import Counter, deque as Deque
|
| 45 |
+
else:
|
| 46 |
+
from typing import Counter, Deque
|
| 47 |
+
from functools import lru_cache
|
| 48 |
+
from backports.zoneinfo import ZoneInfo
|
| 49 |
+
|
| 50 |
+
cache = lru_cache(maxsize=None)
|
| 51 |
+
|
| 52 |
+
if sys.version_info >= (3, 10):
|
| 53 |
+
from typing import TypeGuard
|
| 54 |
+
else:
|
| 55 |
+
from typing_extensions import TypeGuard
|
| 56 |
+
|
| 57 |
+
if sys.version_info >= (3, 11):
|
| 58 |
+
from typing import LiteralString
|
| 59 |
+
else:
|
| 60 |
+
from typing_extensions import LiteralString
|
| 61 |
+
|
| 62 |
+
__all__ = [
|
| 63 |
+
"Counter",
|
| 64 |
+
"Deque",
|
| 65 |
+
"LiteralString",
|
| 66 |
+
"Protocol",
|
| 67 |
+
"TypeGuard",
|
| 68 |
+
"ZoneInfo",
|
| 69 |
+
"cache",
|
| 70 |
+
"create_task",
|
| 71 |
+
"prod",
|
| 72 |
+
]
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_dns.py
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# type: ignore # dnspython is currently optional and mypy fails if missing
|
| 2 |
+
"""
|
| 3 |
+
DNS query support
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
# Copyright (C) 2021 The Psycopg Team
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
import re
|
| 10 |
+
import warnings
|
| 11 |
+
from random import randint
|
| 12 |
+
from typing import Any, DefaultDict, Dict, List, NamedTuple, Optional, Sequence
|
| 13 |
+
from typing import TYPE_CHECKING
|
| 14 |
+
from collections import defaultdict
|
| 15 |
+
|
| 16 |
+
try:
|
| 17 |
+
from dns.resolver import Resolver, Cache
|
| 18 |
+
from dns.asyncresolver import Resolver as AsyncResolver
|
| 19 |
+
from dns.exception import DNSException
|
| 20 |
+
except ImportError:
|
| 21 |
+
raise ImportError(
|
| 22 |
+
"the module psycopg._dns requires the package 'dnspython' installed"
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
from . import errors as e
|
| 26 |
+
from .conninfo import resolve_hostaddr_async as resolve_hostaddr_async_
|
| 27 |
+
|
| 28 |
+
if TYPE_CHECKING:
|
| 29 |
+
from dns.rdtypes.IN.SRV import SRV
|
| 30 |
+
|
| 31 |
+
resolver = Resolver()
|
| 32 |
+
resolver.cache = Cache()
|
| 33 |
+
|
| 34 |
+
async_resolver = AsyncResolver()
|
| 35 |
+
async_resolver.cache = Cache()
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
async def resolve_hostaddr_async(params: Dict[str, Any]) -> Dict[str, Any]:
|
| 39 |
+
"""
|
| 40 |
+
Perform async DNS lookup of the hosts and return a new params dict.
|
| 41 |
+
|
| 42 |
+
.. deprecated:: 3.1
|
| 43 |
+
The use of this function is not necessary anymore, because
|
| 44 |
+
`psycopg.AsyncConnection.connect()` performs non-blocking name
|
| 45 |
+
resolution automatically.
|
| 46 |
+
"""
|
| 47 |
+
warnings.warn(
|
| 48 |
+
"from psycopg 3.1, resolve_hostaddr_async() is not needed anymore",
|
| 49 |
+
DeprecationWarning,
|
| 50 |
+
)
|
| 51 |
+
return await resolve_hostaddr_async_(params)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def resolve_srv(params: Dict[str, Any]) -> Dict[str, Any]:
|
| 55 |
+
"""Apply SRV DNS lookup as defined in :RFC:`2782`."""
|
| 56 |
+
return Rfc2782Resolver().resolve(params)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
async def resolve_srv_async(params: Dict[str, Any]) -> Dict[str, Any]:
|
| 60 |
+
"""Async equivalent of `resolve_srv()`."""
|
| 61 |
+
return await Rfc2782Resolver().resolve_async(params)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
class HostPort(NamedTuple):
|
| 65 |
+
host: str
|
| 66 |
+
port: str
|
| 67 |
+
totry: bool = False
|
| 68 |
+
target: Optional[str] = None
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class Rfc2782Resolver:
|
| 72 |
+
"""Implement SRV RR Resolution as per RFC 2782
|
| 73 |
+
|
| 74 |
+
The class is organised to minimise code duplication between the sync and
|
| 75 |
+
the async paths.
|
| 76 |
+
"""
|
| 77 |
+
|
| 78 |
+
re_srv_rr = re.compile(r"^(?P<service>_[^\.]+)\.(?P<proto>_[^\.]+)\.(?P<target>.+)")
|
| 79 |
+
|
| 80 |
+
def resolve(self, params: Dict[str, Any]) -> Dict[str, Any]:
|
| 81 |
+
"""Update the parameters host and port after SRV lookup."""
|
| 82 |
+
attempts = self._get_attempts(params)
|
| 83 |
+
if not attempts:
|
| 84 |
+
return params
|
| 85 |
+
|
| 86 |
+
hps = []
|
| 87 |
+
for hp in attempts:
|
| 88 |
+
if hp.totry:
|
| 89 |
+
hps.extend(self._resolve_srv(hp))
|
| 90 |
+
else:
|
| 91 |
+
hps.append(hp)
|
| 92 |
+
|
| 93 |
+
return self._return_params(params, hps)
|
| 94 |
+
|
| 95 |
+
async def resolve_async(self, params: Dict[str, Any]) -> Dict[str, Any]:
|
| 96 |
+
"""Update the parameters host and port after SRV lookup."""
|
| 97 |
+
attempts = self._get_attempts(params)
|
| 98 |
+
if not attempts:
|
| 99 |
+
return params
|
| 100 |
+
|
| 101 |
+
hps = []
|
| 102 |
+
for hp in attempts:
|
| 103 |
+
if hp.totry:
|
| 104 |
+
hps.extend(await self._resolve_srv_async(hp))
|
| 105 |
+
else:
|
| 106 |
+
hps.append(hp)
|
| 107 |
+
|
| 108 |
+
return self._return_params(params, hps)
|
| 109 |
+
|
| 110 |
+
def _get_attempts(self, params: Dict[str, Any]) -> List[HostPort]:
|
| 111 |
+
"""
|
| 112 |
+
Return the list of host, and for each host if SRV lookup must be tried.
|
| 113 |
+
|
| 114 |
+
Return an empty list if no lookup is requested.
|
| 115 |
+
"""
|
| 116 |
+
# If hostaddr is defined don't do any resolution.
|
| 117 |
+
if params.get("hostaddr", os.environ.get("PGHOSTADDR", "")):
|
| 118 |
+
return []
|
| 119 |
+
|
| 120 |
+
host_arg: str = params.get("host", os.environ.get("PGHOST", ""))
|
| 121 |
+
hosts_in = host_arg.split(",")
|
| 122 |
+
port_arg: str = str(params.get("port", os.environ.get("PGPORT", "")))
|
| 123 |
+
ports_in = port_arg.split(",")
|
| 124 |
+
|
| 125 |
+
if len(ports_in) == 1:
|
| 126 |
+
# If only one port is specified, it applies to all the hosts.
|
| 127 |
+
ports_in *= len(hosts_in)
|
| 128 |
+
if len(ports_in) != len(hosts_in):
|
| 129 |
+
# ProgrammingError would have been more appropriate, but this is
|
| 130 |
+
# what the raise if the libpq fails connect in the same case.
|
| 131 |
+
raise e.OperationalError(
|
| 132 |
+
f"cannot match {len(hosts_in)} hosts with {len(ports_in)} port numbers"
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
out = []
|
| 136 |
+
srv_found = False
|
| 137 |
+
for host, port in zip(hosts_in, ports_in):
|
| 138 |
+
m = self.re_srv_rr.match(host)
|
| 139 |
+
if m or port.lower() == "srv":
|
| 140 |
+
srv_found = True
|
| 141 |
+
target = m.group("target") if m else None
|
| 142 |
+
hp = HostPort(host=host, port=port, totry=True, target=target)
|
| 143 |
+
else:
|
| 144 |
+
hp = HostPort(host=host, port=port)
|
| 145 |
+
out.append(hp)
|
| 146 |
+
|
| 147 |
+
return out if srv_found else []
|
| 148 |
+
|
| 149 |
+
def _resolve_srv(self, hp: HostPort) -> List[HostPort]:
|
| 150 |
+
try:
|
| 151 |
+
ans = resolver.resolve(hp.host, "SRV")
|
| 152 |
+
except DNSException:
|
| 153 |
+
ans = ()
|
| 154 |
+
return self._get_solved_entries(hp, ans)
|
| 155 |
+
|
| 156 |
+
async def _resolve_srv_async(self, hp: HostPort) -> List[HostPort]:
|
| 157 |
+
try:
|
| 158 |
+
ans = await async_resolver.resolve(hp.host, "SRV")
|
| 159 |
+
except DNSException:
|
| 160 |
+
ans = ()
|
| 161 |
+
return self._get_solved_entries(hp, ans)
|
| 162 |
+
|
| 163 |
+
def _get_solved_entries(
|
| 164 |
+
self, hp: HostPort, entries: "Sequence[SRV]"
|
| 165 |
+
) -> List[HostPort]:
|
| 166 |
+
if not entries:
|
| 167 |
+
# No SRV entry found. Delegate the libpq a QNAME=target lookup
|
| 168 |
+
if hp.target and hp.port.lower() != "srv":
|
| 169 |
+
return [HostPort(host=hp.target, port=hp.port)]
|
| 170 |
+
else:
|
| 171 |
+
return []
|
| 172 |
+
|
| 173 |
+
# If there is precisely one SRV RR, and its Target is "." (the root
|
| 174 |
+
# domain), abort.
|
| 175 |
+
if len(entries) == 1 and str(entries[0].target) == ".":
|
| 176 |
+
return []
|
| 177 |
+
|
| 178 |
+
return [
|
| 179 |
+
HostPort(host=str(entry.target).rstrip("."), port=str(entry.port))
|
| 180 |
+
for entry in self.sort_rfc2782(entries)
|
| 181 |
+
]
|
| 182 |
+
|
| 183 |
+
def _return_params(
|
| 184 |
+
self, params: Dict[str, Any], hps: List[HostPort]
|
| 185 |
+
) -> Dict[str, Any]:
|
| 186 |
+
if not hps:
|
| 187 |
+
# Nothing found, we ended up with an empty list
|
| 188 |
+
raise e.OperationalError("no host found after SRV RR lookup")
|
| 189 |
+
|
| 190 |
+
out = params.copy()
|
| 191 |
+
out["host"] = ",".join(hp.host for hp in hps)
|
| 192 |
+
out["port"] = ",".join(str(hp.port) for hp in hps)
|
| 193 |
+
return out
|
| 194 |
+
|
| 195 |
+
def sort_rfc2782(self, ans: "Sequence[SRV]") -> "List[SRV]":
|
| 196 |
+
"""
|
| 197 |
+
Implement the priority/weight ordering defined in RFC 2782.
|
| 198 |
+
"""
|
| 199 |
+
# Divide the entries by priority:
|
| 200 |
+
priorities: DefaultDict[int, "List[SRV]"] = defaultdict(list)
|
| 201 |
+
out: "List[SRV]" = []
|
| 202 |
+
for entry in ans:
|
| 203 |
+
priorities[entry.priority].append(entry)
|
| 204 |
+
|
| 205 |
+
for pri, entries in sorted(priorities.items()):
|
| 206 |
+
if len(entries) == 1:
|
| 207 |
+
out.append(entries[0])
|
| 208 |
+
continue
|
| 209 |
+
|
| 210 |
+
entries.sort(key=lambda ent: ent.weight)
|
| 211 |
+
total_weight = sum(ent.weight for ent in entries)
|
| 212 |
+
while entries:
|
| 213 |
+
r = randint(0, total_weight)
|
| 214 |
+
csum = 0
|
| 215 |
+
for i, ent in enumerate(entries):
|
| 216 |
+
csum += ent.weight
|
| 217 |
+
if csum >= r:
|
| 218 |
+
break
|
| 219 |
+
out.append(ent)
|
| 220 |
+
total_weight -= ent.weight
|
| 221 |
+
del entries[i]
|
| 222 |
+
|
| 223 |
+
return out
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_encodings.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 6 |
+
|
| 7 |
+
import re
|
| 8 |
+
import string
|
| 9 |
+
import codecs
|
| 10 |
+
from typing import Any, Dict, Optional, TYPE_CHECKING
|
| 11 |
+
|
| 12 |
+
from .pq._enums import ConnStatus
|
| 13 |
+
from .errors import NotSupportedError
|
| 14 |
+
from ._compat import cache
|
| 15 |
+
|
| 16 |
+
if TYPE_CHECKING:
|
| 17 |
+
from .pq.abc import PGconn
|
| 18 |
+
from .connection import BaseConnection
|
| 19 |
+
|
| 20 |
+
OK = ConnStatus.OK
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
_py_codecs = {
|
| 24 |
+
"BIG5": "big5",
|
| 25 |
+
"EUC_CN": "gb2312",
|
| 26 |
+
"EUC_JIS_2004": "euc_jis_2004",
|
| 27 |
+
"EUC_JP": "euc_jp",
|
| 28 |
+
"EUC_KR": "euc_kr",
|
| 29 |
+
# "EUC_TW": not available in Python
|
| 30 |
+
"GB18030": "gb18030",
|
| 31 |
+
"GBK": "gbk",
|
| 32 |
+
"ISO_8859_5": "iso8859-5",
|
| 33 |
+
"ISO_8859_6": "iso8859-6",
|
| 34 |
+
"ISO_8859_7": "iso8859-7",
|
| 35 |
+
"ISO_8859_8": "iso8859-8",
|
| 36 |
+
"JOHAB": "johab",
|
| 37 |
+
"KOI8R": "koi8-r",
|
| 38 |
+
"KOI8U": "koi8-u",
|
| 39 |
+
"LATIN1": "iso8859-1",
|
| 40 |
+
"LATIN10": "iso8859-16",
|
| 41 |
+
"LATIN2": "iso8859-2",
|
| 42 |
+
"LATIN3": "iso8859-3",
|
| 43 |
+
"LATIN4": "iso8859-4",
|
| 44 |
+
"LATIN5": "iso8859-9",
|
| 45 |
+
"LATIN6": "iso8859-10",
|
| 46 |
+
"LATIN7": "iso8859-13",
|
| 47 |
+
"LATIN8": "iso8859-14",
|
| 48 |
+
"LATIN9": "iso8859-15",
|
| 49 |
+
# "MULE_INTERNAL": not available in Python
|
| 50 |
+
"SHIFT_JIS_2004": "shift_jis_2004",
|
| 51 |
+
"SJIS": "shift_jis",
|
| 52 |
+
# this actually means no encoding, see PostgreSQL docs
|
| 53 |
+
# it is special-cased by the text loader.
|
| 54 |
+
"SQL_ASCII": "ascii",
|
| 55 |
+
"UHC": "cp949",
|
| 56 |
+
"UTF8": "utf-8",
|
| 57 |
+
"WIN1250": "cp1250",
|
| 58 |
+
"WIN1251": "cp1251",
|
| 59 |
+
"WIN1252": "cp1252",
|
| 60 |
+
"WIN1253": "cp1253",
|
| 61 |
+
"WIN1254": "cp1254",
|
| 62 |
+
"WIN1255": "cp1255",
|
| 63 |
+
"WIN1256": "cp1256",
|
| 64 |
+
"WIN1257": "cp1257",
|
| 65 |
+
"WIN1258": "cp1258",
|
| 66 |
+
"WIN866": "cp866",
|
| 67 |
+
"WIN874": "cp874",
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
py_codecs: Dict[bytes, str] = {}
|
| 71 |
+
py_codecs.update((k.encode(), v) for k, v in _py_codecs.items())
|
| 72 |
+
|
| 73 |
+
# Add an alias without underscore, for lenient lookups
|
| 74 |
+
py_codecs.update(
|
| 75 |
+
(k.replace("_", "").encode(), v) for k, v in _py_codecs.items() if "_" in k
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
pg_codecs = {v: k.encode() for k, v in _py_codecs.items()}
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def conn_encoding(conn: "Optional[BaseConnection[Any]]") -> str:
|
| 82 |
+
"""
|
| 83 |
+
Return the Python encoding name of a psycopg connection.
|
| 84 |
+
|
| 85 |
+
Default to utf8 if the connection has no encoding info.
|
| 86 |
+
"""
|
| 87 |
+
if not conn or conn.closed:
|
| 88 |
+
return "utf-8"
|
| 89 |
+
|
| 90 |
+
pgenc = conn.pgconn.parameter_status(b"client_encoding") or b"UTF8"
|
| 91 |
+
return pg2pyenc(pgenc)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def pgconn_encoding(pgconn: "PGconn") -> str:
|
| 95 |
+
"""
|
| 96 |
+
Return the Python encoding name of a libpq connection.
|
| 97 |
+
|
| 98 |
+
Default to utf8 if the connection has no encoding info.
|
| 99 |
+
"""
|
| 100 |
+
if pgconn.status != OK:
|
| 101 |
+
return "utf-8"
|
| 102 |
+
|
| 103 |
+
pgenc = pgconn.parameter_status(b"client_encoding") or b"UTF8"
|
| 104 |
+
return pg2pyenc(pgenc)
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def conninfo_encoding(conninfo: str) -> str:
|
| 108 |
+
"""
|
| 109 |
+
Return the Python encoding name passed in a conninfo string. Default to utf8.
|
| 110 |
+
|
| 111 |
+
Because the input is likely to come from the user and not normalised by the
|
| 112 |
+
server, be somewhat lenient (non-case-sensitive lookup, ignore noise chars).
|
| 113 |
+
"""
|
| 114 |
+
from .conninfo import conninfo_to_dict
|
| 115 |
+
|
| 116 |
+
params = conninfo_to_dict(conninfo)
|
| 117 |
+
pgenc = params.get("client_encoding")
|
| 118 |
+
if pgenc:
|
| 119 |
+
try:
|
| 120 |
+
return pg2pyenc(pgenc.encode())
|
| 121 |
+
except NotSupportedError:
|
| 122 |
+
pass
|
| 123 |
+
|
| 124 |
+
return "utf-8"
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
@cache
|
| 128 |
+
def py2pgenc(name: str) -> bytes:
|
| 129 |
+
"""Convert a Python encoding name to PostgreSQL encoding name.
|
| 130 |
+
|
| 131 |
+
Raise LookupError if the Python encoding is unknown.
|
| 132 |
+
"""
|
| 133 |
+
return pg_codecs[codecs.lookup(name).name]
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
@cache
|
| 137 |
+
def pg2pyenc(name: bytes) -> str:
|
| 138 |
+
"""Convert a PostgreSQL encoding name to Python encoding name.
|
| 139 |
+
|
| 140 |
+
Raise NotSupportedError if the PostgreSQL encoding is not supported by
|
| 141 |
+
Python.
|
| 142 |
+
"""
|
| 143 |
+
try:
|
| 144 |
+
return py_codecs[name.replace(b"-", b"").replace(b"_", b"").upper()]
|
| 145 |
+
except KeyError:
|
| 146 |
+
sname = name.decode("utf8", "replace")
|
| 147 |
+
raise NotSupportedError(f"codec not available in Python: {sname!r}")
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def _as_python_identifier(s: str, prefix: str = "f") -> str:
|
| 151 |
+
"""
|
| 152 |
+
Reduce a string to a valid Python identifier.
|
| 153 |
+
|
| 154 |
+
Replace all non-valid chars with '_' and prefix the value with `!prefix` if
|
| 155 |
+
the first letter is an '_'.
|
| 156 |
+
"""
|
| 157 |
+
if not s.isidentifier():
|
| 158 |
+
if s[0] in "1234567890":
|
| 159 |
+
s = prefix + s
|
| 160 |
+
if not s.isidentifier():
|
| 161 |
+
s = _re_clean.sub("_", s)
|
| 162 |
+
# namedtuple fields cannot start with underscore. So...
|
| 163 |
+
if s[0] == "_":
|
| 164 |
+
s = prefix + s
|
| 165 |
+
return s
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
_re_clean = re.compile(
|
| 169 |
+
f"[^{string.ascii_lowercase}{string.ascii_uppercase}{string.digits}_]"
|
| 170 |
+
)
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_enums.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Enum values for psycopg
|
| 3 |
+
|
| 4 |
+
These values are defined by us and are not necessarily dependent on
|
| 5 |
+
libpq-defined enums.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 9 |
+
|
| 10 |
+
from enum import Enum, IntEnum
|
| 11 |
+
from selectors import EVENT_READ, EVENT_WRITE
|
| 12 |
+
|
| 13 |
+
from . import pq
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class Wait(IntEnum):
|
| 17 |
+
R = EVENT_READ
|
| 18 |
+
W = EVENT_WRITE
|
| 19 |
+
RW = EVENT_READ | EVENT_WRITE
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class Ready(IntEnum):
|
| 23 |
+
R = EVENT_READ
|
| 24 |
+
W = EVENT_WRITE
|
| 25 |
+
RW = EVENT_READ | EVENT_WRITE
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class PyFormat(str, Enum):
|
| 29 |
+
"""
|
| 30 |
+
Enum representing the format wanted for a query argument.
|
| 31 |
+
|
| 32 |
+
The value `AUTO` allows psycopg to choose the best format for a certain
|
| 33 |
+
parameter.
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
__module__ = "psycopg.adapt"
|
| 37 |
+
|
| 38 |
+
AUTO = "s"
|
| 39 |
+
"""Automatically chosen (``%s`` placeholder)."""
|
| 40 |
+
TEXT = "t"
|
| 41 |
+
"""Text parameter (``%t`` placeholder)."""
|
| 42 |
+
BINARY = "b"
|
| 43 |
+
"""Binary parameter (``%b`` placeholder)."""
|
| 44 |
+
|
| 45 |
+
@classmethod
|
| 46 |
+
def from_pq(cls, fmt: pq.Format) -> "PyFormat":
|
| 47 |
+
return _pg2py[fmt]
|
| 48 |
+
|
| 49 |
+
@classmethod
|
| 50 |
+
def as_pq(cls, fmt: "PyFormat") -> pq.Format:
|
| 51 |
+
return _py2pg[fmt]
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
class IsolationLevel(IntEnum):
|
| 55 |
+
"""
|
| 56 |
+
Enum representing the isolation level for a transaction.
|
| 57 |
+
"""
|
| 58 |
+
|
| 59 |
+
__module__ = "psycopg"
|
| 60 |
+
|
| 61 |
+
READ_UNCOMMITTED = 1
|
| 62 |
+
""":sql:`READ UNCOMMITTED` isolation level."""
|
| 63 |
+
READ_COMMITTED = 2
|
| 64 |
+
""":sql:`READ COMMITTED` isolation level."""
|
| 65 |
+
REPEATABLE_READ = 3
|
| 66 |
+
""":sql:`REPEATABLE READ` isolation level."""
|
| 67 |
+
SERIALIZABLE = 4
|
| 68 |
+
""":sql:`SERIALIZABLE` isolation level."""
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
_py2pg = {
|
| 72 |
+
PyFormat.TEXT: pq.Format.TEXT,
|
| 73 |
+
PyFormat.BINARY: pq.Format.BINARY,
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
_pg2py = {
|
| 77 |
+
pq.Format.TEXT: PyFormat.TEXT,
|
| 78 |
+
pq.Format.BINARY: PyFormat.BINARY,
|
| 79 |
+
}
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_pipeline.py
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
commands pipeline management
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2021 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import logging
|
| 8 |
+
from types import TracebackType
|
| 9 |
+
from typing import Any, List, Optional, Union, Tuple, Type, TypeVar, TYPE_CHECKING
|
| 10 |
+
from typing_extensions import TypeAlias
|
| 11 |
+
|
| 12 |
+
from . import pq
|
| 13 |
+
from . import errors as e
|
| 14 |
+
from .abc import PipelineCommand, PQGen
|
| 15 |
+
from ._compat import Deque
|
| 16 |
+
from .pq.misc import connection_summary
|
| 17 |
+
from ._encodings import pgconn_encoding
|
| 18 |
+
from ._preparing import Key, Prepare
|
| 19 |
+
from .generators import pipeline_communicate, fetch_many, send
|
| 20 |
+
|
| 21 |
+
if TYPE_CHECKING:
|
| 22 |
+
from .pq.abc import PGresult
|
| 23 |
+
from .cursor import BaseCursor
|
| 24 |
+
from .connection import BaseConnection, Connection
|
| 25 |
+
from .connection_async import AsyncConnection
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
PendingResult: TypeAlias = Union[
|
| 29 |
+
None, Tuple["BaseCursor[Any, Any]", Optional[Tuple[Key, Prepare, bytes]]]
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
FATAL_ERROR = pq.ExecStatus.FATAL_ERROR
|
| 33 |
+
PIPELINE_ABORTED = pq.ExecStatus.PIPELINE_ABORTED
|
| 34 |
+
BAD = pq.ConnStatus.BAD
|
| 35 |
+
|
| 36 |
+
ACTIVE = pq.TransactionStatus.ACTIVE
|
| 37 |
+
|
| 38 |
+
logger = logging.getLogger("psycopg")
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
class BasePipeline:
|
| 42 |
+
command_queue: Deque[PipelineCommand]
|
| 43 |
+
result_queue: Deque[PendingResult]
|
| 44 |
+
_is_supported: Optional[bool] = None
|
| 45 |
+
|
| 46 |
+
def __init__(self, conn: "BaseConnection[Any]") -> None:
|
| 47 |
+
self._conn = conn
|
| 48 |
+
self.pgconn = conn.pgconn
|
| 49 |
+
self.command_queue = Deque[PipelineCommand]()
|
| 50 |
+
self.result_queue = Deque[PendingResult]()
|
| 51 |
+
self.level = 0
|
| 52 |
+
|
| 53 |
+
def __repr__(self) -> str:
|
| 54 |
+
cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
|
| 55 |
+
info = connection_summary(self._conn.pgconn)
|
| 56 |
+
return f"<{cls} {info} at 0x{id(self):x}>"
|
| 57 |
+
|
| 58 |
+
@property
|
| 59 |
+
def status(self) -> pq.PipelineStatus:
|
| 60 |
+
return pq.PipelineStatus(self.pgconn.pipeline_status)
|
| 61 |
+
|
| 62 |
+
@classmethod
|
| 63 |
+
def is_supported(cls) -> bool:
|
| 64 |
+
"""Return `!True` if the psycopg libpq wrapper supports pipeline mode."""
|
| 65 |
+
if BasePipeline._is_supported is None:
|
| 66 |
+
BasePipeline._is_supported = not cls._not_supported_reason()
|
| 67 |
+
return BasePipeline._is_supported
|
| 68 |
+
|
| 69 |
+
@classmethod
|
| 70 |
+
def _not_supported_reason(cls) -> str:
|
| 71 |
+
"""Return the reason why the pipeline mode is not supported.
|
| 72 |
+
|
| 73 |
+
Return an empty string if pipeline mode is supported.
|
| 74 |
+
"""
|
| 75 |
+
# Support only depends on the libpq functions available in the pq
|
| 76 |
+
# wrapper, not on the database version.
|
| 77 |
+
if pq.version() < 140000:
|
| 78 |
+
return (
|
| 79 |
+
f"libpq too old {pq.version()};"
|
| 80 |
+
" v14 or greater required for pipeline mode"
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
+
if pq.__build_version__ < 140000:
|
| 84 |
+
return (
|
| 85 |
+
f"libpq too old: module built for {pq.__build_version__};"
|
| 86 |
+
" v14 or greater required for pipeline mode"
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
return ""
|
| 90 |
+
|
| 91 |
+
def _enter_gen(self) -> PQGen[None]:
|
| 92 |
+
if not self.is_supported():
|
| 93 |
+
raise e.NotSupportedError(
|
| 94 |
+
f"pipeline mode not supported: {self._not_supported_reason()}"
|
| 95 |
+
)
|
| 96 |
+
if self.level == 0:
|
| 97 |
+
self.pgconn.enter_pipeline_mode()
|
| 98 |
+
elif self.command_queue or self.pgconn.transaction_status == ACTIVE:
|
| 99 |
+
# Nested pipeline case.
|
| 100 |
+
# Transaction might be ACTIVE when the pipeline uses an "implicit
|
| 101 |
+
# transaction", typically in autocommit mode. But when entering a
|
| 102 |
+
# Psycopg transaction(), we expect the IDLE state. By sync()-ing,
|
| 103 |
+
# we make sure all previous commands are completed and the
|
| 104 |
+
# transaction gets back to IDLE.
|
| 105 |
+
yield from self._sync_gen()
|
| 106 |
+
self.level += 1
|
| 107 |
+
|
| 108 |
+
def _exit(self, exc: Optional[BaseException]) -> None:
|
| 109 |
+
self.level -= 1
|
| 110 |
+
if self.level == 0 and self.pgconn.status != BAD:
|
| 111 |
+
try:
|
| 112 |
+
self.pgconn.exit_pipeline_mode()
|
| 113 |
+
except e.OperationalError as exc2:
|
| 114 |
+
# Notice that this error might be pretty irrecoverable. It
|
| 115 |
+
# happens on COPY, for instance: even if sync succeeds, exiting
|
| 116 |
+
# fails with "cannot exit pipeline mode with uncollected results"
|
| 117 |
+
if exc:
|
| 118 |
+
logger.warning("error ignored exiting %r: %s", self, exc2)
|
| 119 |
+
else:
|
| 120 |
+
raise exc2.with_traceback(None)
|
| 121 |
+
|
| 122 |
+
def _sync_gen(self) -> PQGen[None]:
|
| 123 |
+
self._enqueue_sync()
|
| 124 |
+
yield from self._communicate_gen()
|
| 125 |
+
yield from self._fetch_gen(flush=False)
|
| 126 |
+
|
| 127 |
+
def _exit_gen(self) -> PQGen[None]:
|
| 128 |
+
"""
|
| 129 |
+
Exit current pipeline by sending a Sync and fetch back all remaining results.
|
| 130 |
+
"""
|
| 131 |
+
try:
|
| 132 |
+
self._enqueue_sync()
|
| 133 |
+
yield from self._communicate_gen()
|
| 134 |
+
finally:
|
| 135 |
+
# No need to force flush since we emitted a sync just before.
|
| 136 |
+
yield from self._fetch_gen(flush=False)
|
| 137 |
+
|
| 138 |
+
def _communicate_gen(self) -> PQGen[None]:
|
| 139 |
+
"""Communicate with pipeline to send commands and possibly fetch
|
| 140 |
+
results, which are then processed.
|
| 141 |
+
"""
|
| 142 |
+
fetched = yield from pipeline_communicate(self.pgconn, self.command_queue)
|
| 143 |
+
exception = None
|
| 144 |
+
for results in fetched:
|
| 145 |
+
queued = self.result_queue.popleft()
|
| 146 |
+
try:
|
| 147 |
+
self._process_results(queued, results)
|
| 148 |
+
except e.Error as exc:
|
| 149 |
+
if exception is None:
|
| 150 |
+
exception = exc
|
| 151 |
+
if exception is not None:
|
| 152 |
+
raise exception
|
| 153 |
+
|
| 154 |
+
def _fetch_gen(self, *, flush: bool) -> PQGen[None]:
|
| 155 |
+
"""Fetch available results from the connection and process them with
|
| 156 |
+
pipeline queued items.
|
| 157 |
+
|
| 158 |
+
If 'flush' is True, a PQsendFlushRequest() is issued in order to make
|
| 159 |
+
sure results can be fetched. Otherwise, the caller may emit a
|
| 160 |
+
PQpipelineSync() call to ensure the output buffer gets flushed before
|
| 161 |
+
fetching.
|
| 162 |
+
"""
|
| 163 |
+
if not self.result_queue:
|
| 164 |
+
return
|
| 165 |
+
|
| 166 |
+
if flush:
|
| 167 |
+
self.pgconn.send_flush_request()
|
| 168 |
+
yield from send(self.pgconn)
|
| 169 |
+
|
| 170 |
+
exception = None
|
| 171 |
+
while self.result_queue:
|
| 172 |
+
results = yield from fetch_many(self.pgconn)
|
| 173 |
+
if not results:
|
| 174 |
+
# No more results to fetch, but there may still be pending
|
| 175 |
+
# commands.
|
| 176 |
+
break
|
| 177 |
+
queued = self.result_queue.popleft()
|
| 178 |
+
try:
|
| 179 |
+
self._process_results(queued, results)
|
| 180 |
+
except e.Error as exc:
|
| 181 |
+
if exception is None:
|
| 182 |
+
exception = exc
|
| 183 |
+
if exception is not None:
|
| 184 |
+
raise exception
|
| 185 |
+
|
| 186 |
+
def _process_results(
|
| 187 |
+
self, queued: PendingResult, results: List["PGresult"]
|
| 188 |
+
) -> None:
|
| 189 |
+
"""Process a results set fetched from the current pipeline.
|
| 190 |
+
|
| 191 |
+
This matches 'results' with its respective element in the pipeline
|
| 192 |
+
queue. For commands (None value in the pipeline queue), results are
|
| 193 |
+
checked directly. For prepare statement creation requests, update the
|
| 194 |
+
cache. Otherwise, results are attached to their respective cursor.
|
| 195 |
+
"""
|
| 196 |
+
if queued is None:
|
| 197 |
+
(result,) = results
|
| 198 |
+
if result.status == FATAL_ERROR:
|
| 199 |
+
raise e.error_from_result(result, encoding=pgconn_encoding(self.pgconn))
|
| 200 |
+
elif result.status == PIPELINE_ABORTED:
|
| 201 |
+
raise e.PipelineAborted("pipeline aborted")
|
| 202 |
+
else:
|
| 203 |
+
cursor, prepinfo = queued
|
| 204 |
+
if prepinfo:
|
| 205 |
+
key, prep, name = prepinfo
|
| 206 |
+
# Update the prepare state of the query.
|
| 207 |
+
cursor._conn._prepared.validate(key, prep, name, results)
|
| 208 |
+
cursor._set_results_from_pipeline(results)
|
| 209 |
+
|
| 210 |
+
def _enqueue_sync(self) -> None:
|
| 211 |
+
"""Enqueue a PQpipelineSync() command."""
|
| 212 |
+
self.command_queue.append(self.pgconn.pipeline_sync)
|
| 213 |
+
self.result_queue.append(None)
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
class Pipeline(BasePipeline):
|
| 217 |
+
"""Handler for connection in pipeline mode."""
|
| 218 |
+
|
| 219 |
+
__module__ = "psycopg"
|
| 220 |
+
_conn: "Connection[Any]"
|
| 221 |
+
_Self = TypeVar("_Self", bound="Pipeline")
|
| 222 |
+
|
| 223 |
+
def __init__(self, conn: "Connection[Any]") -> None:
|
| 224 |
+
super().__init__(conn)
|
| 225 |
+
|
| 226 |
+
def sync(self) -> None:
|
| 227 |
+
"""Sync the pipeline, send any pending command and receive and process
|
| 228 |
+
all available results.
|
| 229 |
+
"""
|
| 230 |
+
try:
|
| 231 |
+
with self._conn.lock:
|
| 232 |
+
self._conn.wait(self._sync_gen())
|
| 233 |
+
except e._NO_TRACEBACK as ex:
|
| 234 |
+
raise ex.with_traceback(None)
|
| 235 |
+
|
| 236 |
+
def __enter__(self: _Self) -> _Self:
|
| 237 |
+
with self._conn.lock:
|
| 238 |
+
self._conn.wait(self._enter_gen())
|
| 239 |
+
return self
|
| 240 |
+
|
| 241 |
+
def __exit__(
|
| 242 |
+
self,
|
| 243 |
+
exc_type: Optional[Type[BaseException]],
|
| 244 |
+
exc_val: Optional[BaseException],
|
| 245 |
+
exc_tb: Optional[TracebackType],
|
| 246 |
+
) -> None:
|
| 247 |
+
try:
|
| 248 |
+
with self._conn.lock:
|
| 249 |
+
self._conn.wait(self._exit_gen())
|
| 250 |
+
except Exception as exc2:
|
| 251 |
+
# Don't clobber an exception raised in the block with this one
|
| 252 |
+
if exc_val:
|
| 253 |
+
logger.warning("error ignored terminating %r: %s", self, exc2)
|
| 254 |
+
else:
|
| 255 |
+
raise exc2.with_traceback(None)
|
| 256 |
+
finally:
|
| 257 |
+
self._exit(exc_val)
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
class AsyncPipeline(BasePipeline):
|
| 261 |
+
"""Handler for async connection in pipeline mode."""
|
| 262 |
+
|
| 263 |
+
__module__ = "psycopg"
|
| 264 |
+
_conn: "AsyncConnection[Any]"
|
| 265 |
+
_Self = TypeVar("_Self", bound="AsyncPipeline")
|
| 266 |
+
|
| 267 |
+
def __init__(self, conn: "AsyncConnection[Any]") -> None:
|
| 268 |
+
super().__init__(conn)
|
| 269 |
+
|
| 270 |
+
async def sync(self) -> None:
|
| 271 |
+
try:
|
| 272 |
+
async with self._conn.lock:
|
| 273 |
+
await self._conn.wait(self._sync_gen())
|
| 274 |
+
except e._NO_TRACEBACK as ex:
|
| 275 |
+
raise ex.with_traceback(None)
|
| 276 |
+
|
| 277 |
+
async def __aenter__(self: _Self) -> _Self:
|
| 278 |
+
async with self._conn.lock:
|
| 279 |
+
await self._conn.wait(self._enter_gen())
|
| 280 |
+
return self
|
| 281 |
+
|
| 282 |
+
async def __aexit__(
|
| 283 |
+
self,
|
| 284 |
+
exc_type: Optional[Type[BaseException]],
|
| 285 |
+
exc_val: Optional[BaseException],
|
| 286 |
+
exc_tb: Optional[TracebackType],
|
| 287 |
+
) -> None:
|
| 288 |
+
try:
|
| 289 |
+
async with self._conn.lock:
|
| 290 |
+
await self._conn.wait(self._exit_gen())
|
| 291 |
+
except Exception as exc2:
|
| 292 |
+
# Don't clobber an exception raised in the block with this one
|
| 293 |
+
if exc_val:
|
| 294 |
+
logger.warning("error ignored terminating %r: %s", self, exc2)
|
| 295 |
+
else:
|
| 296 |
+
raise exc2.with_traceback(None)
|
| 297 |
+
finally:
|
| 298 |
+
self._exit(exc_val)
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_preparing.py
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Support for prepared statements
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
from enum import IntEnum, auto
|
| 8 |
+
from typing import Iterator, Optional, Sequence, Tuple, TYPE_CHECKING
|
| 9 |
+
from collections import OrderedDict
|
| 10 |
+
from typing_extensions import TypeAlias
|
| 11 |
+
|
| 12 |
+
from . import pq
|
| 13 |
+
from ._compat import Deque
|
| 14 |
+
from ._queries import PostgresQuery
|
| 15 |
+
|
| 16 |
+
if TYPE_CHECKING:
|
| 17 |
+
from .pq.abc import PGresult
|
| 18 |
+
|
| 19 |
+
Key: TypeAlias = Tuple[bytes, Tuple[int, ...]]
|
| 20 |
+
|
| 21 |
+
COMMAND_OK = pq.ExecStatus.COMMAND_OK
|
| 22 |
+
TUPLES_OK = pq.ExecStatus.TUPLES_OK
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class Prepare(IntEnum):
|
| 26 |
+
NO = auto()
|
| 27 |
+
YES = auto()
|
| 28 |
+
SHOULD = auto()
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
class PrepareManager:
|
| 32 |
+
# Number of times a query is executed before it is prepared.
|
| 33 |
+
prepare_threshold: Optional[int] = 5
|
| 34 |
+
|
| 35 |
+
# Maximum number of prepared statements on the connection.
|
| 36 |
+
prepared_max: int = 100
|
| 37 |
+
|
| 38 |
+
def __init__(self) -> None:
|
| 39 |
+
# Map (query, types) to the number of times the query was seen.
|
| 40 |
+
self._counts: OrderedDict[Key, int] = OrderedDict()
|
| 41 |
+
|
| 42 |
+
# Map (query, types) to the name of the statement if prepared.
|
| 43 |
+
self._names: OrderedDict[Key, bytes] = OrderedDict()
|
| 44 |
+
|
| 45 |
+
# Counter to generate prepared statements names
|
| 46 |
+
self._prepared_idx = 0
|
| 47 |
+
|
| 48 |
+
self._maint_commands = Deque[bytes]()
|
| 49 |
+
|
| 50 |
+
@staticmethod
|
| 51 |
+
def key(query: PostgresQuery) -> Key:
|
| 52 |
+
return (query.query, query.types)
|
| 53 |
+
|
| 54 |
+
def get(
|
| 55 |
+
self, query: PostgresQuery, prepare: Optional[bool] = None
|
| 56 |
+
) -> Tuple[Prepare, bytes]:
|
| 57 |
+
"""
|
| 58 |
+
Check if a query is prepared, tell back whether to prepare it.
|
| 59 |
+
"""
|
| 60 |
+
if prepare is False or self.prepare_threshold is None:
|
| 61 |
+
# The user doesn't want this query to be prepared
|
| 62 |
+
return Prepare.NO, b""
|
| 63 |
+
|
| 64 |
+
key = self.key(query)
|
| 65 |
+
name = self._names.get(key)
|
| 66 |
+
if name:
|
| 67 |
+
# The query was already prepared in this session
|
| 68 |
+
return Prepare.YES, name
|
| 69 |
+
|
| 70 |
+
count = self._counts.get(key, 0)
|
| 71 |
+
if count >= self.prepare_threshold or prepare:
|
| 72 |
+
# The query has been executed enough times and needs to be prepared
|
| 73 |
+
name = f"_pg3_{self._prepared_idx}".encode()
|
| 74 |
+
self._prepared_idx += 1
|
| 75 |
+
return Prepare.SHOULD, name
|
| 76 |
+
else:
|
| 77 |
+
# The query is not to be prepared yet
|
| 78 |
+
return Prepare.NO, b""
|
| 79 |
+
|
| 80 |
+
def _should_discard(self, prep: Prepare, results: Sequence["PGresult"]) -> bool:
|
| 81 |
+
"""Check if we need to discard our entire state: it should happen on
|
| 82 |
+
rollback or on dropping objects, because the same object may get
|
| 83 |
+
recreated and postgres would fail internal lookups.
|
| 84 |
+
"""
|
| 85 |
+
if self._names or prep == Prepare.SHOULD:
|
| 86 |
+
for result in results:
|
| 87 |
+
if result.status != COMMAND_OK:
|
| 88 |
+
continue
|
| 89 |
+
cmdstat = result.command_status
|
| 90 |
+
if cmdstat and (cmdstat.startswith(b"DROP ") or cmdstat == b"ROLLBACK"):
|
| 91 |
+
return self.clear()
|
| 92 |
+
return False
|
| 93 |
+
|
| 94 |
+
@staticmethod
|
| 95 |
+
def _check_results(results: Sequence["PGresult"]) -> bool:
|
| 96 |
+
"""Return False if 'results' are invalid for prepared statement cache."""
|
| 97 |
+
if len(results) != 1:
|
| 98 |
+
# We cannot prepare a multiple statement
|
| 99 |
+
return False
|
| 100 |
+
|
| 101 |
+
status = results[0].status
|
| 102 |
+
if COMMAND_OK != status != TUPLES_OK:
|
| 103 |
+
# We don't prepare failed queries or other weird results
|
| 104 |
+
return False
|
| 105 |
+
|
| 106 |
+
return True
|
| 107 |
+
|
| 108 |
+
def _rotate(self) -> None:
|
| 109 |
+
"""Evict an old value from the cache.
|
| 110 |
+
|
| 111 |
+
If it was prepared, deallocate it. Do it only once: if the cache was
|
| 112 |
+
resized, deallocate gradually.
|
| 113 |
+
"""
|
| 114 |
+
if len(self._counts) > self.prepared_max:
|
| 115 |
+
self._counts.popitem(last=False)
|
| 116 |
+
|
| 117 |
+
if len(self._names) > self.prepared_max:
|
| 118 |
+
name = self._names.popitem(last=False)[1]
|
| 119 |
+
self._maint_commands.append(b"DEALLOCATE " + name)
|
| 120 |
+
|
| 121 |
+
def maybe_add_to_cache(
|
| 122 |
+
self, query: PostgresQuery, prep: Prepare, name: bytes
|
| 123 |
+
) -> Optional[Key]:
|
| 124 |
+
"""Handle 'query' for possible addition to the cache.
|
| 125 |
+
|
| 126 |
+
If a new entry has been added, return its key. Return None otherwise
|
| 127 |
+
(meaning the query is already in cache or cache is not enabled).
|
| 128 |
+
"""
|
| 129 |
+
# don't do anything if prepared statements are disabled
|
| 130 |
+
if self.prepare_threshold is None:
|
| 131 |
+
return None
|
| 132 |
+
|
| 133 |
+
key = self.key(query)
|
| 134 |
+
if key in self._counts:
|
| 135 |
+
if prep is Prepare.SHOULD:
|
| 136 |
+
del self._counts[key]
|
| 137 |
+
self._names[key] = name
|
| 138 |
+
else:
|
| 139 |
+
self._counts[key] += 1
|
| 140 |
+
self._counts.move_to_end(key)
|
| 141 |
+
return None
|
| 142 |
+
|
| 143 |
+
elif key in self._names:
|
| 144 |
+
self._names.move_to_end(key)
|
| 145 |
+
return None
|
| 146 |
+
|
| 147 |
+
else:
|
| 148 |
+
if prep is Prepare.SHOULD:
|
| 149 |
+
self._names[key] = name
|
| 150 |
+
else:
|
| 151 |
+
self._counts[key] = 1
|
| 152 |
+
return key
|
| 153 |
+
|
| 154 |
+
def validate(
|
| 155 |
+
self,
|
| 156 |
+
key: Key,
|
| 157 |
+
prep: Prepare,
|
| 158 |
+
name: bytes,
|
| 159 |
+
results: Sequence["PGresult"],
|
| 160 |
+
) -> None:
|
| 161 |
+
"""Validate cached entry with 'key' by checking query 'results'.
|
| 162 |
+
|
| 163 |
+
Possibly record a command to perform maintenance on database side.
|
| 164 |
+
"""
|
| 165 |
+
if self._should_discard(prep, results):
|
| 166 |
+
return
|
| 167 |
+
|
| 168 |
+
if not self._check_results(results):
|
| 169 |
+
self._names.pop(key, None)
|
| 170 |
+
self._counts.pop(key, None)
|
| 171 |
+
else:
|
| 172 |
+
self._rotate()
|
| 173 |
+
|
| 174 |
+
def clear(self) -> bool:
|
| 175 |
+
"""Clear the cache of the maintenance commands.
|
| 176 |
+
|
| 177 |
+
Clear the internal state and prepare a command to clear the state of
|
| 178 |
+
the server.
|
| 179 |
+
"""
|
| 180 |
+
self._counts.clear()
|
| 181 |
+
if self._names:
|
| 182 |
+
self._names.clear()
|
| 183 |
+
self._maint_commands.clear()
|
| 184 |
+
self._maint_commands.append(b"DEALLOCATE ALL")
|
| 185 |
+
return True
|
| 186 |
+
else:
|
| 187 |
+
return False
|
| 188 |
+
|
| 189 |
+
def get_maintenance_commands(self) -> Iterator[bytes]:
|
| 190 |
+
"""
|
| 191 |
+
Iterate over the commands needed to align the server state to our state
|
| 192 |
+
"""
|
| 193 |
+
while self._maint_commands:
|
| 194 |
+
yield self._maint_commands.popleft()
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_queries.py
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Utility module to manipulate queries
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import re
|
| 8 |
+
from typing import Any, Callable, Dict, List, Mapping, Match, NamedTuple, Optional
|
| 9 |
+
from typing import Sequence, Tuple, Union, TYPE_CHECKING
|
| 10 |
+
from functools import lru_cache
|
| 11 |
+
from typing_extensions import TypeAlias
|
| 12 |
+
|
| 13 |
+
from . import pq
|
| 14 |
+
from . import errors as e
|
| 15 |
+
from .sql import Composable
|
| 16 |
+
from .abc import Buffer, Query, Params
|
| 17 |
+
from ._enums import PyFormat
|
| 18 |
+
from ._encodings import conn_encoding
|
| 19 |
+
|
| 20 |
+
if TYPE_CHECKING:
|
| 21 |
+
from .abc import Transformer
|
| 22 |
+
|
| 23 |
+
MAX_CACHED_STATEMENT_LENGTH = 4096
|
| 24 |
+
MAX_CACHED_STATEMENT_PARAMS = 50
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class QueryPart(NamedTuple):
|
| 28 |
+
pre: bytes
|
| 29 |
+
item: Union[int, str]
|
| 30 |
+
format: PyFormat
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class PostgresQuery:
|
| 34 |
+
"""
|
| 35 |
+
Helper to convert a Python query and parameters into Postgres format.
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
__slots__ = """
|
| 39 |
+
query params types formats
|
| 40 |
+
_tx _want_formats _parts _encoding _order
|
| 41 |
+
""".split()
|
| 42 |
+
|
| 43 |
+
def __init__(self, transformer: "Transformer"):
|
| 44 |
+
self._tx = transformer
|
| 45 |
+
|
| 46 |
+
self.params: Optional[Sequence[Optional[Buffer]]] = None
|
| 47 |
+
# these are tuples so they can be used as keys e.g. in prepared stmts
|
| 48 |
+
self.types: Tuple[int, ...] = ()
|
| 49 |
+
|
| 50 |
+
# The format requested by the user and the ones to really pass Postgres
|
| 51 |
+
self._want_formats: Optional[List[PyFormat]] = None
|
| 52 |
+
self.formats: Optional[Sequence[pq.Format]] = None
|
| 53 |
+
|
| 54 |
+
self._encoding = conn_encoding(transformer.connection)
|
| 55 |
+
self._parts: List[QueryPart]
|
| 56 |
+
self.query = b""
|
| 57 |
+
self._order: Optional[List[str]] = None
|
| 58 |
+
|
| 59 |
+
def convert(self, query: Query, vars: Optional[Params]) -> None:
|
| 60 |
+
"""
|
| 61 |
+
Set up the query and parameters to convert.
|
| 62 |
+
|
| 63 |
+
The results of this function can be obtained accessing the object
|
| 64 |
+
attributes (`query`, `params`, `types`, `formats`).
|
| 65 |
+
"""
|
| 66 |
+
if isinstance(query, str):
|
| 67 |
+
bquery = query.encode(self._encoding)
|
| 68 |
+
elif isinstance(query, Composable):
|
| 69 |
+
bquery = query.as_bytes(self._tx)
|
| 70 |
+
else:
|
| 71 |
+
bquery = query
|
| 72 |
+
|
| 73 |
+
if vars is not None:
|
| 74 |
+
# Avoid caching queries extremely long or with a huge number of
|
| 75 |
+
# parameters. They are usually generated by ORMs and have poor
|
| 76 |
+
# cacheablility (e.g. INSERT ... VALUES (...), (...) with varying
|
| 77 |
+
# numbers of tuples.
|
| 78 |
+
# see https://github.com/psycopg/psycopg/discussions/628
|
| 79 |
+
if (
|
| 80 |
+
len(bquery) <= MAX_CACHED_STATEMENT_LENGTH
|
| 81 |
+
and len(vars) <= MAX_CACHED_STATEMENT_PARAMS
|
| 82 |
+
):
|
| 83 |
+
f: _Query2Pg = _query2pg
|
| 84 |
+
else:
|
| 85 |
+
f = _query2pg_nocache
|
| 86 |
+
|
| 87 |
+
(self.query, self._want_formats, self._order, self._parts) = f(
|
| 88 |
+
bquery, self._encoding
|
| 89 |
+
)
|
| 90 |
+
else:
|
| 91 |
+
self.query = bquery
|
| 92 |
+
self._want_formats = self._order = None
|
| 93 |
+
|
| 94 |
+
self.dump(vars)
|
| 95 |
+
|
| 96 |
+
def dump(self, vars: Optional[Params]) -> None:
|
| 97 |
+
"""
|
| 98 |
+
Process a new set of variables on the query processed by `convert()`.
|
| 99 |
+
|
| 100 |
+
This method updates `params` and `types`.
|
| 101 |
+
"""
|
| 102 |
+
if vars is not None:
|
| 103 |
+
params = _validate_and_reorder_params(self._parts, vars, self._order)
|
| 104 |
+
assert self._want_formats is not None
|
| 105 |
+
self.params = self._tx.dump_sequence(params, self._want_formats)
|
| 106 |
+
self.types = self._tx.types or ()
|
| 107 |
+
self.formats = self._tx.formats
|
| 108 |
+
else:
|
| 109 |
+
self.params = None
|
| 110 |
+
self.types = ()
|
| 111 |
+
self.formats = None
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
# The type of the _query2pg() and _query2pg_nocache() methods
|
| 115 |
+
_Query2Pg: TypeAlias = Callable[
|
| 116 |
+
[bytes, str], Tuple[bytes, List[PyFormat], Optional[List[str]], List[QueryPart]]
|
| 117 |
+
]
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def _query2pg_nocache(
|
| 121 |
+
query: bytes, encoding: str
|
| 122 |
+
) -> Tuple[bytes, List[PyFormat], Optional[List[str]], List[QueryPart]]:
|
| 123 |
+
"""
|
| 124 |
+
Convert Python query and params into something Postgres understands.
|
| 125 |
+
|
| 126 |
+
- Convert Python placeholders (``%s``, ``%(name)s``) into Postgres
|
| 127 |
+
format (``$1``, ``$2``)
|
| 128 |
+
- placeholders can be %s, %t, or %b (auto, text or binary)
|
| 129 |
+
- return ``query`` (bytes), ``formats`` (list of formats) ``order``
|
| 130 |
+
(sequence of names used in the query, in the position they appear)
|
| 131 |
+
``parts`` (splits of queries and placeholders).
|
| 132 |
+
"""
|
| 133 |
+
parts = _split_query(query, encoding)
|
| 134 |
+
order: Optional[List[str]] = None
|
| 135 |
+
chunks: List[bytes] = []
|
| 136 |
+
formats = []
|
| 137 |
+
|
| 138 |
+
if isinstance(parts[0].item, int):
|
| 139 |
+
for part in parts[:-1]:
|
| 140 |
+
assert isinstance(part.item, int)
|
| 141 |
+
chunks.append(part.pre)
|
| 142 |
+
chunks.append(b"$%d" % (part.item + 1))
|
| 143 |
+
formats.append(part.format)
|
| 144 |
+
|
| 145 |
+
elif isinstance(parts[0].item, str):
|
| 146 |
+
seen: Dict[str, Tuple[bytes, PyFormat]] = {}
|
| 147 |
+
order = []
|
| 148 |
+
for part in parts[:-1]:
|
| 149 |
+
assert isinstance(part.item, str)
|
| 150 |
+
chunks.append(part.pre)
|
| 151 |
+
if part.item not in seen:
|
| 152 |
+
ph = b"$%d" % (len(seen) + 1)
|
| 153 |
+
seen[part.item] = (ph, part.format)
|
| 154 |
+
order.append(part.item)
|
| 155 |
+
chunks.append(ph)
|
| 156 |
+
formats.append(part.format)
|
| 157 |
+
else:
|
| 158 |
+
if seen[part.item][1] != part.format:
|
| 159 |
+
raise e.ProgrammingError(
|
| 160 |
+
f"placeholder '{part.item}' cannot have different formats"
|
| 161 |
+
)
|
| 162 |
+
chunks.append(seen[part.item][0])
|
| 163 |
+
|
| 164 |
+
# last part
|
| 165 |
+
chunks.append(parts[-1].pre)
|
| 166 |
+
|
| 167 |
+
return b"".join(chunks), formats, order, parts
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
# Note: the cache size is 128 items, but someone has reported throwing ~12k
|
| 171 |
+
# queries (of type `INSERT ... VALUES (...), (...)` with a varying amount of
|
| 172 |
+
# records), and the resulting cache size is >100Mb. So, we will avoid to cache
|
| 173 |
+
# large queries or queries with a large number of params. See
|
| 174 |
+
# https://github.com/sqlalchemy/sqlalchemy/discussions/10270
|
| 175 |
+
_query2pg = lru_cache()(_query2pg_nocache)
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
class PostgresClientQuery(PostgresQuery):
|
| 179 |
+
"""
|
| 180 |
+
PostgresQuery subclass merging query and arguments client-side.
|
| 181 |
+
"""
|
| 182 |
+
|
| 183 |
+
__slots__ = ("template",)
|
| 184 |
+
|
| 185 |
+
def convert(self, query: Query, vars: Optional[Params]) -> None:
|
| 186 |
+
"""
|
| 187 |
+
Set up the query and parameters to convert.
|
| 188 |
+
|
| 189 |
+
The results of this function can be obtained accessing the object
|
| 190 |
+
attributes (`query`, `params`, `types`, `formats`).
|
| 191 |
+
"""
|
| 192 |
+
if isinstance(query, str):
|
| 193 |
+
bquery = query.encode(self._encoding)
|
| 194 |
+
elif isinstance(query, Composable):
|
| 195 |
+
bquery = query.as_bytes(self._tx)
|
| 196 |
+
else:
|
| 197 |
+
bquery = query
|
| 198 |
+
|
| 199 |
+
if vars is not None:
|
| 200 |
+
if (
|
| 201 |
+
len(bquery) <= MAX_CACHED_STATEMENT_LENGTH
|
| 202 |
+
and len(vars) <= MAX_CACHED_STATEMENT_PARAMS
|
| 203 |
+
):
|
| 204 |
+
f: _Query2PgClient = _query2pg_client
|
| 205 |
+
else:
|
| 206 |
+
f = _query2pg_client_nocache
|
| 207 |
+
|
| 208 |
+
(self.template, self._order, self._parts) = f(bquery, self._encoding)
|
| 209 |
+
else:
|
| 210 |
+
self.query = bquery
|
| 211 |
+
self._order = None
|
| 212 |
+
|
| 213 |
+
self.dump(vars)
|
| 214 |
+
|
| 215 |
+
def dump(self, vars: Optional[Params]) -> None:
|
| 216 |
+
"""
|
| 217 |
+
Process a new set of variables on the query processed by `convert()`.
|
| 218 |
+
|
| 219 |
+
This method updates `params` and `types`.
|
| 220 |
+
"""
|
| 221 |
+
if vars is not None:
|
| 222 |
+
params = _validate_and_reorder_params(self._parts, vars, self._order)
|
| 223 |
+
self.params = tuple(
|
| 224 |
+
self._tx.as_literal(p) if p is not None else b"NULL" for p in params
|
| 225 |
+
)
|
| 226 |
+
self.query = self.template % self.params
|
| 227 |
+
else:
|
| 228 |
+
self.params = None
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
_Query2PgClient: TypeAlias = Callable[
|
| 232 |
+
[bytes, str], Tuple[bytes, Optional[List[str]], List[QueryPart]]
|
| 233 |
+
]
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def _query2pg_client_nocache(
|
| 237 |
+
query: bytes, encoding: str
|
| 238 |
+
) -> Tuple[bytes, Optional[List[str]], List[QueryPart]]:
|
| 239 |
+
"""
|
| 240 |
+
Convert Python query and params into a template to perform client-side binding
|
| 241 |
+
"""
|
| 242 |
+
parts = _split_query(query, encoding, collapse_double_percent=False)
|
| 243 |
+
order: Optional[List[str]] = None
|
| 244 |
+
chunks: List[bytes] = []
|
| 245 |
+
|
| 246 |
+
if isinstance(parts[0].item, int):
|
| 247 |
+
for part in parts[:-1]:
|
| 248 |
+
assert isinstance(part.item, int)
|
| 249 |
+
chunks.append(part.pre)
|
| 250 |
+
chunks.append(b"%s")
|
| 251 |
+
|
| 252 |
+
elif isinstance(parts[0].item, str):
|
| 253 |
+
seen: Dict[str, Tuple[bytes, PyFormat]] = {}
|
| 254 |
+
order = []
|
| 255 |
+
for part in parts[:-1]:
|
| 256 |
+
assert isinstance(part.item, str)
|
| 257 |
+
chunks.append(part.pre)
|
| 258 |
+
if part.item not in seen:
|
| 259 |
+
ph = b"%s"
|
| 260 |
+
seen[part.item] = (ph, part.format)
|
| 261 |
+
order.append(part.item)
|
| 262 |
+
chunks.append(ph)
|
| 263 |
+
else:
|
| 264 |
+
chunks.append(seen[part.item][0])
|
| 265 |
+
order.append(part.item)
|
| 266 |
+
|
| 267 |
+
# last part
|
| 268 |
+
chunks.append(parts[-1].pre)
|
| 269 |
+
|
| 270 |
+
return b"".join(chunks), order, parts
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
_query2pg_client = lru_cache()(_query2pg_client_nocache)
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
def _validate_and_reorder_params(
|
| 277 |
+
parts: List[QueryPart], vars: Params, order: Optional[List[str]]
|
| 278 |
+
) -> Sequence[Any]:
|
| 279 |
+
"""
|
| 280 |
+
Verify the compatibility between a query and a set of params.
|
| 281 |
+
"""
|
| 282 |
+
# Try concrete types, then abstract types
|
| 283 |
+
t = type(vars)
|
| 284 |
+
if t is list or t is tuple:
|
| 285 |
+
sequence = True
|
| 286 |
+
elif t is dict:
|
| 287 |
+
sequence = False
|
| 288 |
+
elif isinstance(vars, Sequence) and not isinstance(vars, (bytes, str)):
|
| 289 |
+
sequence = True
|
| 290 |
+
elif isinstance(vars, Mapping):
|
| 291 |
+
sequence = False
|
| 292 |
+
else:
|
| 293 |
+
raise TypeError(
|
| 294 |
+
"query parameters should be a sequence or a mapping,"
|
| 295 |
+
f" got {type(vars).__name__}"
|
| 296 |
+
)
|
| 297 |
+
|
| 298 |
+
if sequence:
|
| 299 |
+
if len(vars) != len(parts) - 1:
|
| 300 |
+
raise e.ProgrammingError(
|
| 301 |
+
f"the query has {len(parts) - 1} placeholders but"
|
| 302 |
+
f" {len(vars)} parameters were passed"
|
| 303 |
+
)
|
| 304 |
+
if vars and not isinstance(parts[0].item, int):
|
| 305 |
+
raise TypeError("named placeholders require a mapping of parameters")
|
| 306 |
+
return vars # type: ignore[return-value]
|
| 307 |
+
|
| 308 |
+
else:
|
| 309 |
+
if vars and len(parts) > 1 and not isinstance(parts[0][1], str):
|
| 310 |
+
raise TypeError(
|
| 311 |
+
"positional placeholders (%s) require a sequence of parameters"
|
| 312 |
+
)
|
| 313 |
+
try:
|
| 314 |
+
return [vars[item] for item in order or ()] # type: ignore[call-overload]
|
| 315 |
+
except KeyError:
|
| 316 |
+
raise e.ProgrammingError(
|
| 317 |
+
"query parameter missing:"
|
| 318 |
+
f" {', '.join(sorted(i for i in order or () if i not in vars))}"
|
| 319 |
+
)
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
_re_placeholder = re.compile(
|
| 323 |
+
rb"""(?x)
|
| 324 |
+
% # a literal %
|
| 325 |
+
(?:
|
| 326 |
+
(?:
|
| 327 |
+
\( ([^)]+) \) # or a name in (braces)
|
| 328 |
+
. # followed by a format
|
| 329 |
+
)
|
| 330 |
+
|
|
| 331 |
+
(?:.) # or any char, really
|
| 332 |
+
)
|
| 333 |
+
"""
|
| 334 |
+
)
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
def _split_query(
|
| 338 |
+
query: bytes, encoding: str = "ascii", collapse_double_percent: bool = True
|
| 339 |
+
) -> List[QueryPart]:
|
| 340 |
+
parts: List[Tuple[bytes, Optional[Match[bytes]]]] = []
|
| 341 |
+
cur = 0
|
| 342 |
+
|
| 343 |
+
# pairs [(fragment, match], with the last match None
|
| 344 |
+
m = None
|
| 345 |
+
for m in _re_placeholder.finditer(query):
|
| 346 |
+
pre = query[cur : m.span(0)[0]]
|
| 347 |
+
parts.append((pre, m))
|
| 348 |
+
cur = m.span(0)[1]
|
| 349 |
+
if m:
|
| 350 |
+
parts.append((query[cur:], None))
|
| 351 |
+
else:
|
| 352 |
+
parts.append((query, None))
|
| 353 |
+
|
| 354 |
+
rv = []
|
| 355 |
+
|
| 356 |
+
# drop the "%%", validate
|
| 357 |
+
i = 0
|
| 358 |
+
phtype = None
|
| 359 |
+
while i < len(parts):
|
| 360 |
+
pre, m = parts[i]
|
| 361 |
+
if m is None:
|
| 362 |
+
# last part
|
| 363 |
+
rv.append(QueryPart(pre, 0, PyFormat.AUTO))
|
| 364 |
+
break
|
| 365 |
+
|
| 366 |
+
ph = m.group(0)
|
| 367 |
+
if ph == b"%%":
|
| 368 |
+
# unescape '%%' to '%' if necessary, then merge the parts
|
| 369 |
+
if collapse_double_percent:
|
| 370 |
+
ph = b"%"
|
| 371 |
+
pre1, m1 = parts[i + 1]
|
| 372 |
+
parts[i + 1] = (pre + ph + pre1, m1)
|
| 373 |
+
del parts[i]
|
| 374 |
+
continue
|
| 375 |
+
|
| 376 |
+
if ph == b"%(":
|
| 377 |
+
raise e.ProgrammingError(
|
| 378 |
+
"incomplete placeholder:"
|
| 379 |
+
f" '{query[m.span(0)[0]:].split()[0].decode(encoding)}'"
|
| 380 |
+
)
|
| 381 |
+
elif ph == b"% ":
|
| 382 |
+
# explicit messasge for a typical error
|
| 383 |
+
raise e.ProgrammingError(
|
| 384 |
+
"incomplete placeholder: '%'; if you want to use '%' as an"
|
| 385 |
+
" operator you can double it up, i.e. use '%%'"
|
| 386 |
+
)
|
| 387 |
+
elif ph[-1:] not in b"sbt":
|
| 388 |
+
raise e.ProgrammingError(
|
| 389 |
+
"only '%s', '%b', '%t' are allowed as placeholders, got"
|
| 390 |
+
f" '{m.group(0).decode(encoding)}'"
|
| 391 |
+
)
|
| 392 |
+
|
| 393 |
+
# Index or name
|
| 394 |
+
item: Union[int, str]
|
| 395 |
+
item = m.group(1).decode(encoding) if m.group(1) else i
|
| 396 |
+
|
| 397 |
+
if not phtype:
|
| 398 |
+
phtype = type(item)
|
| 399 |
+
elif phtype is not type(item):
|
| 400 |
+
raise e.ProgrammingError(
|
| 401 |
+
"positional and named placeholders cannot be mixed"
|
| 402 |
+
)
|
| 403 |
+
|
| 404 |
+
format = _ph_to_fmt[ph[-1:]]
|
| 405 |
+
rv.append(QueryPart(pre, item, format))
|
| 406 |
+
i += 1
|
| 407 |
+
|
| 408 |
+
return rv
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
_ph_to_fmt = {
|
| 412 |
+
b"s": PyFormat.AUTO,
|
| 413 |
+
b"t": PyFormat.TEXT,
|
| 414 |
+
b"b": PyFormat.BINARY,
|
| 415 |
+
}
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_struct.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Utility functions to deal with binary structs.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import struct
|
| 8 |
+
from typing import Callable, cast, Optional, Tuple
|
| 9 |
+
from typing_extensions import TypeAlias
|
| 10 |
+
|
| 11 |
+
from .abc import Buffer
|
| 12 |
+
from . import errors as e
|
| 13 |
+
from ._compat import Protocol
|
| 14 |
+
|
| 15 |
+
PackInt: TypeAlias = Callable[[int], bytes]
|
| 16 |
+
UnpackInt: TypeAlias = Callable[[Buffer], Tuple[int]]
|
| 17 |
+
PackFloat: TypeAlias = Callable[[float], bytes]
|
| 18 |
+
UnpackFloat: TypeAlias = Callable[[Buffer], Tuple[float]]
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class UnpackLen(Protocol):
|
| 22 |
+
def __call__(self, data: Buffer, start: Optional[int]) -> Tuple[int]:
|
| 23 |
+
...
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
pack_int2 = cast(PackInt, struct.Struct("!h").pack)
|
| 27 |
+
pack_uint2 = cast(PackInt, struct.Struct("!H").pack)
|
| 28 |
+
pack_int4 = cast(PackInt, struct.Struct("!i").pack)
|
| 29 |
+
pack_uint4 = cast(PackInt, struct.Struct("!I").pack)
|
| 30 |
+
pack_int8 = cast(PackInt, struct.Struct("!q").pack)
|
| 31 |
+
pack_float4 = cast(PackFloat, struct.Struct("!f").pack)
|
| 32 |
+
pack_float8 = cast(PackFloat, struct.Struct("!d").pack)
|
| 33 |
+
|
| 34 |
+
unpack_int2 = cast(UnpackInt, struct.Struct("!h").unpack)
|
| 35 |
+
unpack_uint2 = cast(UnpackInt, struct.Struct("!H").unpack)
|
| 36 |
+
unpack_int4 = cast(UnpackInt, struct.Struct("!i").unpack)
|
| 37 |
+
unpack_uint4 = cast(UnpackInt, struct.Struct("!I").unpack)
|
| 38 |
+
unpack_int8 = cast(UnpackInt, struct.Struct("!q").unpack)
|
| 39 |
+
unpack_float4 = cast(UnpackFloat, struct.Struct("!f").unpack)
|
| 40 |
+
unpack_float8 = cast(UnpackFloat, struct.Struct("!d").unpack)
|
| 41 |
+
|
| 42 |
+
_struct_len = struct.Struct("!i")
|
| 43 |
+
pack_len = cast(Callable[[int], bytes], _struct_len.pack)
|
| 44 |
+
unpack_len = cast(UnpackLen, _struct_len.unpack_from)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def pack_float4_bug_304(x: float) -> bytes:
|
| 48 |
+
raise e.InterfaceError(
|
| 49 |
+
"cannot dump Float4: Python affected by bug #304. Note that the psycopg-c"
|
| 50 |
+
" and psycopg-binary packages are not affected by this issue."
|
| 51 |
+
" See https://github.com/psycopg/psycopg/issues/304"
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
# If issue #304 is detected, raise an error instead of dumping wrong data.
|
| 56 |
+
if struct.Struct("!f").pack(1.0) != bytes.fromhex("3f800000"):
|
| 57 |
+
pack_float4 = pack_float4_bug_304
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_tpc.py
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
psycopg two-phase commit support
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2021 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import re
|
| 8 |
+
import datetime as dt
|
| 9 |
+
from base64 import b64encode, b64decode
|
| 10 |
+
from typing import Optional, Union
|
| 11 |
+
from dataclasses import dataclass, replace
|
| 12 |
+
|
| 13 |
+
_re_xid = re.compile(r"^(\d+)_([^_]*)_([^_]*)$")
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
@dataclass(frozen=True)
|
| 17 |
+
class Xid:
|
| 18 |
+
"""A two-phase commit transaction identifier.
|
| 19 |
+
|
| 20 |
+
The object can also be unpacked as a 3-item tuple (`format_id`, `gtrid`,
|
| 21 |
+
`bqual`).
|
| 22 |
+
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
format_id: Optional[int]
|
| 26 |
+
gtrid: str
|
| 27 |
+
bqual: Optional[str]
|
| 28 |
+
prepared: Optional[dt.datetime] = None
|
| 29 |
+
owner: Optional[str] = None
|
| 30 |
+
database: Optional[str] = None
|
| 31 |
+
|
| 32 |
+
@classmethod
|
| 33 |
+
def from_string(cls, s: str) -> "Xid":
|
| 34 |
+
"""Try to parse an XA triple from the string.
|
| 35 |
+
|
| 36 |
+
This may fail for several reasons. In such case return an unparsed Xid.
|
| 37 |
+
"""
|
| 38 |
+
try:
|
| 39 |
+
return cls._parse_string(s)
|
| 40 |
+
except Exception:
|
| 41 |
+
return Xid(None, s, None)
|
| 42 |
+
|
| 43 |
+
def __str__(self) -> str:
|
| 44 |
+
return self._as_tid()
|
| 45 |
+
|
| 46 |
+
def __len__(self) -> int:
|
| 47 |
+
return 3
|
| 48 |
+
|
| 49 |
+
def __getitem__(self, index: int) -> Union[int, str, None]:
|
| 50 |
+
return (self.format_id, self.gtrid, self.bqual)[index]
|
| 51 |
+
|
| 52 |
+
@classmethod
|
| 53 |
+
def _parse_string(cls, s: str) -> "Xid":
|
| 54 |
+
m = _re_xid.match(s)
|
| 55 |
+
if not m:
|
| 56 |
+
raise ValueError("bad Xid format")
|
| 57 |
+
|
| 58 |
+
format_id = int(m.group(1))
|
| 59 |
+
gtrid = b64decode(m.group(2)).decode()
|
| 60 |
+
bqual = b64decode(m.group(3)).decode()
|
| 61 |
+
return cls.from_parts(format_id, gtrid, bqual)
|
| 62 |
+
|
| 63 |
+
@classmethod
|
| 64 |
+
def from_parts(
|
| 65 |
+
cls, format_id: Optional[int], gtrid: str, bqual: Optional[str]
|
| 66 |
+
) -> "Xid":
|
| 67 |
+
if format_id is not None:
|
| 68 |
+
if bqual is None:
|
| 69 |
+
raise TypeError("if format_id is specified, bqual must be too")
|
| 70 |
+
if not 0 <= format_id < 0x80000000:
|
| 71 |
+
raise ValueError("format_id must be a non-negative 32-bit integer")
|
| 72 |
+
if len(bqual) > 64:
|
| 73 |
+
raise ValueError("bqual must be not longer than 64 chars")
|
| 74 |
+
if len(gtrid) > 64:
|
| 75 |
+
raise ValueError("gtrid must be not longer than 64 chars")
|
| 76 |
+
|
| 77 |
+
elif bqual is None:
|
| 78 |
+
raise TypeError("if format_id is None, bqual must be None too")
|
| 79 |
+
|
| 80 |
+
return Xid(format_id, gtrid, bqual)
|
| 81 |
+
|
| 82 |
+
def _as_tid(self) -> str:
|
| 83 |
+
"""
|
| 84 |
+
Return the PostgreSQL transaction_id for this XA xid.
|
| 85 |
+
|
| 86 |
+
PostgreSQL wants just a string, while the DBAPI supports the XA
|
| 87 |
+
standard and thus a triple. We use the same conversion algorithm
|
| 88 |
+
implemented by JDBC in order to allow some form of interoperation.
|
| 89 |
+
|
| 90 |
+
see also: the pgjdbc implementation
|
| 91 |
+
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/
|
| 92 |
+
postgresql/xa/RecoveredXid.java?rev=1.2
|
| 93 |
+
"""
|
| 94 |
+
if self.format_id is None or self.bqual is None:
|
| 95 |
+
# Unparsed xid: return the gtrid.
|
| 96 |
+
return self.gtrid
|
| 97 |
+
|
| 98 |
+
# XA xid: mash together the components.
|
| 99 |
+
egtrid = b64encode(self.gtrid.encode()).decode()
|
| 100 |
+
ebqual = b64encode(self.bqual.encode()).decode()
|
| 101 |
+
|
| 102 |
+
return f"{self.format_id}_{egtrid}_{ebqual}"
|
| 103 |
+
|
| 104 |
+
@classmethod
|
| 105 |
+
def _get_recover_query(cls) -> str:
|
| 106 |
+
return "SELECT gid, prepared, owner, database FROM pg_prepared_xacts"
|
| 107 |
+
|
| 108 |
+
@classmethod
|
| 109 |
+
def _from_record(
|
| 110 |
+
cls, gid: str, prepared: dt.datetime, owner: str, database: str
|
| 111 |
+
) -> "Xid":
|
| 112 |
+
xid = Xid.from_string(gid)
|
| 113 |
+
return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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Helper object to transform values between Python and PostgreSQL
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
from typing import Any, Dict, List, Optional, Sequence, Tuple
|
| 8 |
+
from typing import DefaultDict, TYPE_CHECKING
|
| 9 |
+
from collections import defaultdict
|
| 10 |
+
from typing_extensions import TypeAlias
|
| 11 |
+
|
| 12 |
+
from . import pq
|
| 13 |
+
from . import postgres
|
| 14 |
+
from . import errors as e
|
| 15 |
+
from .abc import Buffer, LoadFunc, AdaptContext, PyFormat, DumperKey, NoneType
|
| 16 |
+
from .rows import Row, RowMaker
|
| 17 |
+
from .postgres import INVALID_OID, TEXT_OID
|
| 18 |
+
from ._encodings import pgconn_encoding
|
| 19 |
+
|
| 20 |
+
if TYPE_CHECKING:
|
| 21 |
+
from .abc import Dumper, Loader
|
| 22 |
+
from .adapt import AdaptersMap
|
| 23 |
+
from .pq.abc import PGresult
|
| 24 |
+
from .connection import BaseConnection
|
| 25 |
+
|
| 26 |
+
DumperCache: TypeAlias = Dict[DumperKey, "Dumper"]
|
| 27 |
+
OidDumperCache: TypeAlias = Dict[int, "Dumper"]
|
| 28 |
+
LoaderCache: TypeAlias = Dict[int, "Loader"]
|
| 29 |
+
|
| 30 |
+
TEXT = pq.Format.TEXT
|
| 31 |
+
PY_TEXT = PyFormat.TEXT
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
class Transformer(AdaptContext):
|
| 35 |
+
"""
|
| 36 |
+
An object that can adapt efficiently between Python and PostgreSQL.
|
| 37 |
+
|
| 38 |
+
The life cycle of the object is the query, so it is assumed that attributes
|
| 39 |
+
such as the server version or the connection encoding will not change. The
|
| 40 |
+
object have its state so adapting several values of the same type can be
|
| 41 |
+
optimised.
|
| 42 |
+
|
| 43 |
+
"""
|
| 44 |
+
|
| 45 |
+
__module__ = "psycopg.adapt"
|
| 46 |
+
|
| 47 |
+
__slots__ = """
|
| 48 |
+
types formats
|
| 49 |
+
_conn _adapters _pgresult _dumpers _loaders _encoding _none_oid
|
| 50 |
+
_oid_dumpers _oid_types _row_dumpers _row_loaders
|
| 51 |
+
""".split()
|
| 52 |
+
|
| 53 |
+
types: Optional[Tuple[int, ...]]
|
| 54 |
+
formats: Optional[List[pq.Format]]
|
| 55 |
+
|
| 56 |
+
_adapters: "AdaptersMap"
|
| 57 |
+
_pgresult: Optional["PGresult"]
|
| 58 |
+
_none_oid: int
|
| 59 |
+
|
| 60 |
+
def __init__(self, context: Optional[AdaptContext] = None):
|
| 61 |
+
self._pgresult = self.types = self.formats = None
|
| 62 |
+
|
| 63 |
+
# WARNING: don't store context, or you'll create a loop with the Cursor
|
| 64 |
+
if context:
|
| 65 |
+
self._adapters = context.adapters
|
| 66 |
+
self._conn = context.connection
|
| 67 |
+
else:
|
| 68 |
+
self._adapters = postgres.adapters
|
| 69 |
+
self._conn = None
|
| 70 |
+
|
| 71 |
+
# mapping fmt, class -> Dumper instance
|
| 72 |
+
self._dumpers: DefaultDict[PyFormat, DumperCache]
|
| 73 |
+
self._dumpers = defaultdict(dict)
|
| 74 |
+
|
| 75 |
+
# mapping fmt, oid -> Dumper instance
|
| 76 |
+
# Not often used, so create it only if needed.
|
| 77 |
+
self._oid_dumpers: Optional[Tuple[OidDumperCache, OidDumperCache]]
|
| 78 |
+
self._oid_dumpers = None
|
| 79 |
+
|
| 80 |
+
# mapping fmt, oid -> Loader instance
|
| 81 |
+
self._loaders: Tuple[LoaderCache, LoaderCache] = ({}, {})
|
| 82 |
+
|
| 83 |
+
self._row_dumpers: Optional[List["Dumper"]] = None
|
| 84 |
+
|
| 85 |
+
# sequence of load functions from value to python
|
| 86 |
+
# the length of the result columns
|
| 87 |
+
self._row_loaders: List[LoadFunc] = []
|
| 88 |
+
|
| 89 |
+
# mapping oid -> type sql representation
|
| 90 |
+
self._oid_types: Dict[int, bytes] = {}
|
| 91 |
+
|
| 92 |
+
self._encoding = ""
|
| 93 |
+
|
| 94 |
+
@classmethod
|
| 95 |
+
def from_context(cls, context: Optional[AdaptContext]) -> "Transformer":
|
| 96 |
+
"""
|
| 97 |
+
Return a Transformer from an AdaptContext.
|
| 98 |
+
|
| 99 |
+
If the context is a Transformer instance, just return it.
|
| 100 |
+
"""
|
| 101 |
+
if isinstance(context, Transformer):
|
| 102 |
+
return context
|
| 103 |
+
else:
|
| 104 |
+
return cls(context)
|
| 105 |
+
|
| 106 |
+
@property
|
| 107 |
+
def connection(self) -> Optional["BaseConnection[Any]"]:
|
| 108 |
+
return self._conn
|
| 109 |
+
|
| 110 |
+
@property
|
| 111 |
+
def encoding(self) -> str:
|
| 112 |
+
if not self._encoding:
|
| 113 |
+
conn = self.connection
|
| 114 |
+
self._encoding = pgconn_encoding(conn.pgconn) if conn else "utf-8"
|
| 115 |
+
return self._encoding
|
| 116 |
+
|
| 117 |
+
@property
|
| 118 |
+
def adapters(self) -> "AdaptersMap":
|
| 119 |
+
return self._adapters
|
| 120 |
+
|
| 121 |
+
@property
|
| 122 |
+
def pgresult(self) -> Optional["PGresult"]:
|
| 123 |
+
return self._pgresult
|
| 124 |
+
|
| 125 |
+
def set_pgresult(
|
| 126 |
+
self,
|
| 127 |
+
result: Optional["PGresult"],
|
| 128 |
+
*,
|
| 129 |
+
set_loaders: bool = True,
|
| 130 |
+
format: Optional[pq.Format] = None,
|
| 131 |
+
) -> None:
|
| 132 |
+
self._pgresult = result
|
| 133 |
+
|
| 134 |
+
if not result:
|
| 135 |
+
self._nfields = self._ntuples = 0
|
| 136 |
+
if set_loaders:
|
| 137 |
+
self._row_loaders = []
|
| 138 |
+
return
|
| 139 |
+
|
| 140 |
+
self._ntuples = result.ntuples
|
| 141 |
+
nf = self._nfields = result.nfields
|
| 142 |
+
|
| 143 |
+
if not set_loaders:
|
| 144 |
+
return
|
| 145 |
+
|
| 146 |
+
if not nf:
|
| 147 |
+
self._row_loaders = []
|
| 148 |
+
return
|
| 149 |
+
|
| 150 |
+
fmt: pq.Format
|
| 151 |
+
fmt = result.fformat(0) if format is None else format # type: ignore
|
| 152 |
+
self._row_loaders = [
|
| 153 |
+
self.get_loader(result.ftype(i), fmt).load for i in range(nf)
|
| 154 |
+
]
|
| 155 |
+
|
| 156 |
+
def set_dumper_types(self, types: Sequence[int], format: pq.Format) -> None:
|
| 157 |
+
self._row_dumpers = [self.get_dumper_by_oid(oid, format) for oid in types]
|
| 158 |
+
self.types = tuple(types)
|
| 159 |
+
self.formats = [format] * len(types)
|
| 160 |
+
|
| 161 |
+
def set_loader_types(self, types: Sequence[int], format: pq.Format) -> None:
|
| 162 |
+
self._row_loaders = [self.get_loader(oid, format).load for oid in types]
|
| 163 |
+
|
| 164 |
+
def dump_sequence(
|
| 165 |
+
self, params: Sequence[Any], formats: Sequence[PyFormat]
|
| 166 |
+
) -> Sequence[Optional[Buffer]]:
|
| 167 |
+
nparams = len(params)
|
| 168 |
+
out: List[Optional[Buffer]] = [None] * nparams
|
| 169 |
+
|
| 170 |
+
# If we have dumpers, it means set_dumper_types had been called, in
|
| 171 |
+
# which case self.types and self.formats are set to sequences of the
|
| 172 |
+
# right size.
|
| 173 |
+
if self._row_dumpers:
|
| 174 |
+
for i in range(nparams):
|
| 175 |
+
param = params[i]
|
| 176 |
+
if param is not None:
|
| 177 |
+
out[i] = self._row_dumpers[i].dump(param)
|
| 178 |
+
return out
|
| 179 |
+
|
| 180 |
+
types = [self._get_none_oid()] * nparams
|
| 181 |
+
pqformats = [TEXT] * nparams
|
| 182 |
+
|
| 183 |
+
for i in range(nparams):
|
| 184 |
+
param = params[i]
|
| 185 |
+
if param is None:
|
| 186 |
+
continue
|
| 187 |
+
dumper = self.get_dumper(param, formats[i])
|
| 188 |
+
out[i] = dumper.dump(param)
|
| 189 |
+
types[i] = dumper.oid
|
| 190 |
+
pqformats[i] = dumper.format
|
| 191 |
+
|
| 192 |
+
self.types = tuple(types)
|
| 193 |
+
self.formats = pqformats
|
| 194 |
+
|
| 195 |
+
return out
|
| 196 |
+
|
| 197 |
+
def as_literal(self, obj: Any) -> bytes:
|
| 198 |
+
dumper = self.get_dumper(obj, PY_TEXT)
|
| 199 |
+
rv = dumper.quote(obj)
|
| 200 |
+
# If the result is quoted, and the oid not unknown or text,
|
| 201 |
+
# add an explicit type cast.
|
| 202 |
+
# Check the last char because the first one might be 'E'.
|
| 203 |
+
oid = dumper.oid
|
| 204 |
+
if oid and rv and rv[-1] == b"'"[0] and oid != TEXT_OID:
|
| 205 |
+
try:
|
| 206 |
+
type_sql = self._oid_types[oid]
|
| 207 |
+
except KeyError:
|
| 208 |
+
ti = self.adapters.types.get(oid)
|
| 209 |
+
if ti:
|
| 210 |
+
if oid < 8192:
|
| 211 |
+
# builtin: prefer "timestamptz" to "timestamp with time zone"
|
| 212 |
+
type_sql = ti.name.encode(self.encoding)
|
| 213 |
+
else:
|
| 214 |
+
type_sql = ti.regtype.encode(self.encoding)
|
| 215 |
+
if oid == ti.array_oid:
|
| 216 |
+
type_sql += b"[]"
|
| 217 |
+
else:
|
| 218 |
+
type_sql = b""
|
| 219 |
+
self._oid_types[oid] = type_sql
|
| 220 |
+
|
| 221 |
+
if type_sql:
|
| 222 |
+
rv = b"%s::%s" % (rv, type_sql)
|
| 223 |
+
|
| 224 |
+
if not isinstance(rv, bytes):
|
| 225 |
+
rv = bytes(rv)
|
| 226 |
+
return rv
|
| 227 |
+
|
| 228 |
+
def get_dumper(self, obj: Any, format: PyFormat) -> "Dumper":
|
| 229 |
+
"""
|
| 230 |
+
Return a Dumper instance to dump `!obj`.
|
| 231 |
+
"""
|
| 232 |
+
# Normally, the type of the object dictates how to dump it
|
| 233 |
+
key = type(obj)
|
| 234 |
+
|
| 235 |
+
# Reuse an existing Dumper class for objects of the same type
|
| 236 |
+
cache = self._dumpers[format]
|
| 237 |
+
try:
|
| 238 |
+
dumper = cache[key]
|
| 239 |
+
except KeyError:
|
| 240 |
+
# If it's the first time we see this type, look for a dumper
|
| 241 |
+
# configured for it.
|
| 242 |
+
try:
|
| 243 |
+
dcls = self.adapters.get_dumper(key, format)
|
| 244 |
+
except e.ProgrammingError as ex:
|
| 245 |
+
raise ex from None
|
| 246 |
+
else:
|
| 247 |
+
cache[key] = dumper = dcls(key, self)
|
| 248 |
+
|
| 249 |
+
# Check if the dumper requires an upgrade to handle this specific value
|
| 250 |
+
key1 = dumper.get_key(obj, format)
|
| 251 |
+
if key1 is key:
|
| 252 |
+
return dumper
|
| 253 |
+
|
| 254 |
+
# If it does, ask the dumper to create its own upgraded version
|
| 255 |
+
try:
|
| 256 |
+
return cache[key1]
|
| 257 |
+
except KeyError:
|
| 258 |
+
dumper = cache[key1] = dumper.upgrade(obj, format)
|
| 259 |
+
return dumper
|
| 260 |
+
|
| 261 |
+
def _get_none_oid(self) -> int:
|
| 262 |
+
try:
|
| 263 |
+
return self._none_oid
|
| 264 |
+
except AttributeError:
|
| 265 |
+
pass
|
| 266 |
+
|
| 267 |
+
try:
|
| 268 |
+
rv = self._none_oid = self._adapters.get_dumper(NoneType, PY_TEXT).oid
|
| 269 |
+
except KeyError:
|
| 270 |
+
raise e.InterfaceError("None dumper not found")
|
| 271 |
+
|
| 272 |
+
return rv
|
| 273 |
+
|
| 274 |
+
def get_dumper_by_oid(self, oid: int, format: pq.Format) -> "Dumper":
|
| 275 |
+
"""
|
| 276 |
+
Return a Dumper to dump an object to the type with given oid.
|
| 277 |
+
"""
|
| 278 |
+
if not self._oid_dumpers:
|
| 279 |
+
self._oid_dumpers = ({}, {})
|
| 280 |
+
|
| 281 |
+
# Reuse an existing Dumper class for objects of the same type
|
| 282 |
+
cache = self._oid_dumpers[format]
|
| 283 |
+
try:
|
| 284 |
+
return cache[oid]
|
| 285 |
+
except KeyError:
|
| 286 |
+
# If it's the first time we see this type, look for a dumper
|
| 287 |
+
# configured for it.
|
| 288 |
+
dcls = self.adapters.get_dumper_by_oid(oid, format)
|
| 289 |
+
cache[oid] = dumper = dcls(NoneType, self)
|
| 290 |
+
|
| 291 |
+
return dumper
|
| 292 |
+
|
| 293 |
+
def load_rows(self, row0: int, row1: int, make_row: RowMaker[Row]) -> List[Row]:
|
| 294 |
+
res = self._pgresult
|
| 295 |
+
if not res:
|
| 296 |
+
raise e.InterfaceError("result not set")
|
| 297 |
+
|
| 298 |
+
if not (0 <= row0 <= self._ntuples and 0 <= row1 <= self._ntuples):
|
| 299 |
+
raise e.InterfaceError(
|
| 300 |
+
f"rows must be included between 0 and {self._ntuples}"
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
records = []
|
| 304 |
+
for row in range(row0, row1):
|
| 305 |
+
record: List[Any] = [None] * self._nfields
|
| 306 |
+
for col in range(self._nfields):
|
| 307 |
+
val = res.get_value(row, col)
|
| 308 |
+
if val is not None:
|
| 309 |
+
record[col] = self._row_loaders[col](val)
|
| 310 |
+
records.append(make_row(record))
|
| 311 |
+
|
| 312 |
+
return records
|
| 313 |
+
|
| 314 |
+
def load_row(self, row: int, make_row: RowMaker[Row]) -> Optional[Row]:
|
| 315 |
+
res = self._pgresult
|
| 316 |
+
if not res:
|
| 317 |
+
return None
|
| 318 |
+
|
| 319 |
+
if not 0 <= row < self._ntuples:
|
| 320 |
+
return None
|
| 321 |
+
|
| 322 |
+
record: List[Any] = [None] * self._nfields
|
| 323 |
+
for col in range(self._nfields):
|
| 324 |
+
val = res.get_value(row, col)
|
| 325 |
+
if val is not None:
|
| 326 |
+
record[col] = self._row_loaders[col](val)
|
| 327 |
+
|
| 328 |
+
return make_row(record)
|
| 329 |
+
|
| 330 |
+
def load_sequence(self, record: Sequence[Optional[Buffer]]) -> Tuple[Any, ...]:
|
| 331 |
+
if len(self._row_loaders) != len(record):
|
| 332 |
+
raise e.ProgrammingError(
|
| 333 |
+
f"cannot load sequence of {len(record)} items:"
|
| 334 |
+
f" {len(self._row_loaders)} loaders registered"
|
| 335 |
+
)
|
| 336 |
+
|
| 337 |
+
return tuple(
|
| 338 |
+
(self._row_loaders[i](val) if val is not None else None)
|
| 339 |
+
for i, val in enumerate(record)
|
| 340 |
+
)
|
| 341 |
+
|
| 342 |
+
def get_loader(self, oid: int, format: pq.Format) -> "Loader":
|
| 343 |
+
try:
|
| 344 |
+
return self._loaders[format][oid]
|
| 345 |
+
except KeyError:
|
| 346 |
+
pass
|
| 347 |
+
|
| 348 |
+
loader_cls = self._adapters.get_loader(oid, format)
|
| 349 |
+
if not loader_cls:
|
| 350 |
+
loader_cls = self._adapters.get_loader(INVALID_OID, format)
|
| 351 |
+
if not loader_cls:
|
| 352 |
+
raise e.InterfaceError("unknown oid loader not found")
|
| 353 |
+
loader = self._loaders[format][oid] = loader_cls(oid, self)
|
| 354 |
+
return loader
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_typeinfo.py
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Information about PostgreSQL types
|
| 3 |
+
|
| 4 |
+
These types allow to read information from the system catalog and provide
|
| 5 |
+
information to the adapters if needed.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 9 |
+
from enum import Enum
|
| 10 |
+
from typing import Any, Dict, Iterator, Optional, overload
|
| 11 |
+
from typing import Sequence, Tuple, Type, TypeVar, Union, TYPE_CHECKING
|
| 12 |
+
from typing_extensions import TypeAlias
|
| 13 |
+
|
| 14 |
+
from . import errors as e
|
| 15 |
+
from .abc import AdaptContext, Query
|
| 16 |
+
from .rows import dict_row
|
| 17 |
+
from ._encodings import conn_encoding
|
| 18 |
+
|
| 19 |
+
if TYPE_CHECKING:
|
| 20 |
+
from .connection import BaseConnection, Connection
|
| 21 |
+
from .connection_async import AsyncConnection
|
| 22 |
+
from .sql import Identifier, SQL
|
| 23 |
+
|
| 24 |
+
T = TypeVar("T", bound="TypeInfo")
|
| 25 |
+
RegistryKey: TypeAlias = Union[str, int, Tuple[type, int]]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class TypeInfo:
|
| 29 |
+
"""
|
| 30 |
+
Hold information about a PostgreSQL base type.
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
__module__ = "psycopg.types"
|
| 34 |
+
|
| 35 |
+
def __init__(
|
| 36 |
+
self,
|
| 37 |
+
name: str,
|
| 38 |
+
oid: int,
|
| 39 |
+
array_oid: int,
|
| 40 |
+
*,
|
| 41 |
+
regtype: str = "",
|
| 42 |
+
delimiter: str = ",",
|
| 43 |
+
):
|
| 44 |
+
self.name = name
|
| 45 |
+
self.oid = oid
|
| 46 |
+
self.array_oid = array_oid
|
| 47 |
+
self.regtype = regtype or name
|
| 48 |
+
self.delimiter = delimiter
|
| 49 |
+
|
| 50 |
+
def __repr__(self) -> str:
|
| 51 |
+
return (
|
| 52 |
+
f"<{self.__class__.__qualname__}:"
|
| 53 |
+
f" {self.name} (oid: {self.oid}, array oid: {self.array_oid})>"
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
@overload
|
| 57 |
+
@classmethod
|
| 58 |
+
def fetch(
|
| 59 |
+
cls: Type[T], conn: "Connection[Any]", name: Union[str, "Identifier"]
|
| 60 |
+
) -> Optional[T]:
|
| 61 |
+
...
|
| 62 |
+
|
| 63 |
+
@overload
|
| 64 |
+
@classmethod
|
| 65 |
+
async def fetch(
|
| 66 |
+
cls: Type[T], conn: "AsyncConnection[Any]", name: Union[str, "Identifier"]
|
| 67 |
+
) -> Optional[T]:
|
| 68 |
+
...
|
| 69 |
+
|
| 70 |
+
@classmethod
|
| 71 |
+
def fetch(
|
| 72 |
+
cls: Type[T], conn: "BaseConnection[Any]", name: Union[str, "Identifier"]
|
| 73 |
+
) -> Any:
|
| 74 |
+
"""Query a system catalog to read information about a type."""
|
| 75 |
+
from .sql import Composable
|
| 76 |
+
from .connection import Connection
|
| 77 |
+
from .connection_async import AsyncConnection
|
| 78 |
+
|
| 79 |
+
if isinstance(name, Composable):
|
| 80 |
+
name = name.as_string(conn)
|
| 81 |
+
|
| 82 |
+
if isinstance(conn, Connection):
|
| 83 |
+
return cls._fetch(conn, name)
|
| 84 |
+
elif isinstance(conn, AsyncConnection):
|
| 85 |
+
return cls._fetch_async(conn, name)
|
| 86 |
+
else:
|
| 87 |
+
raise TypeError(
|
| 88 |
+
f"expected Connection or AsyncConnection, got {type(conn).__name__}"
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
@classmethod
|
| 92 |
+
def _fetch(cls: Type[T], conn: "Connection[Any]", name: str) -> Optional[T]:
|
| 93 |
+
# This might result in a nested transaction. What we want is to leave
|
| 94 |
+
# the function with the connection in the state we found (either idle
|
| 95 |
+
# or intrans)
|
| 96 |
+
try:
|
| 97 |
+
with conn.transaction():
|
| 98 |
+
if conn_encoding(conn) == "ascii":
|
| 99 |
+
conn.execute("set local client_encoding to utf8")
|
| 100 |
+
with conn.cursor(row_factory=dict_row) as cur:
|
| 101 |
+
cur.execute(cls._get_info_query(conn), {"name": name})
|
| 102 |
+
recs = cur.fetchall()
|
| 103 |
+
except e.UndefinedObject:
|
| 104 |
+
return None
|
| 105 |
+
|
| 106 |
+
return cls._from_records(name, recs)
|
| 107 |
+
|
| 108 |
+
@classmethod
|
| 109 |
+
async def _fetch_async(
|
| 110 |
+
cls: Type[T], conn: "AsyncConnection[Any]", name: str
|
| 111 |
+
) -> Optional[T]:
|
| 112 |
+
try:
|
| 113 |
+
async with conn.transaction():
|
| 114 |
+
if conn_encoding(conn) == "ascii":
|
| 115 |
+
await conn.execute("set local client_encoding to utf8")
|
| 116 |
+
async with conn.cursor(row_factory=dict_row) as cur:
|
| 117 |
+
await cur.execute(cls._get_info_query(conn), {"name": name})
|
| 118 |
+
recs = await cur.fetchall()
|
| 119 |
+
except e.UndefinedObject:
|
| 120 |
+
return None
|
| 121 |
+
|
| 122 |
+
return cls._from_records(name, recs)
|
| 123 |
+
|
| 124 |
+
@classmethod
|
| 125 |
+
def _from_records(
|
| 126 |
+
cls: Type[T], name: str, recs: Sequence[Dict[str, Any]]
|
| 127 |
+
) -> Optional[T]:
|
| 128 |
+
if len(recs) == 1:
|
| 129 |
+
return cls(**recs[0])
|
| 130 |
+
elif not recs:
|
| 131 |
+
return None
|
| 132 |
+
else:
|
| 133 |
+
raise e.ProgrammingError(f"found {len(recs)} different types named {name}")
|
| 134 |
+
|
| 135 |
+
def register(self, context: Optional[AdaptContext] = None) -> None:
|
| 136 |
+
"""
|
| 137 |
+
Register the type information, globally or in the specified `!context`.
|
| 138 |
+
"""
|
| 139 |
+
if context:
|
| 140 |
+
types = context.adapters.types
|
| 141 |
+
else:
|
| 142 |
+
from . import postgres
|
| 143 |
+
|
| 144 |
+
types = postgres.types
|
| 145 |
+
|
| 146 |
+
types.add(self)
|
| 147 |
+
|
| 148 |
+
if self.array_oid:
|
| 149 |
+
from .types.array import register_array
|
| 150 |
+
|
| 151 |
+
register_array(self, context)
|
| 152 |
+
|
| 153 |
+
@classmethod
|
| 154 |
+
def _get_info_query(cls, conn: "BaseConnection[Any]") -> Query:
|
| 155 |
+
from .sql import SQL
|
| 156 |
+
|
| 157 |
+
return SQL(
|
| 158 |
+
"""\
|
| 159 |
+
SELECT
|
| 160 |
+
typname AS name, oid, typarray AS array_oid,
|
| 161 |
+
oid::regtype::text AS regtype, typdelim AS delimiter
|
| 162 |
+
FROM pg_type t
|
| 163 |
+
WHERE t.oid = {regtype}
|
| 164 |
+
ORDER BY t.oid
|
| 165 |
+
"""
|
| 166 |
+
).format(regtype=cls._to_regtype(conn))
|
| 167 |
+
|
| 168 |
+
@classmethod
|
| 169 |
+
def _has_to_regtype_function(cls, conn: "BaseConnection[Any]") -> bool:
|
| 170 |
+
# to_regtype() introduced in PostgreSQL 9.4 and CockroachDB 22.2
|
| 171 |
+
info = conn.info
|
| 172 |
+
if info.vendor == "PostgreSQL":
|
| 173 |
+
return info.server_version >= 90400
|
| 174 |
+
elif info.vendor == "CockroachDB":
|
| 175 |
+
return info.server_version >= 220200
|
| 176 |
+
else:
|
| 177 |
+
return False
|
| 178 |
+
|
| 179 |
+
@classmethod
|
| 180 |
+
def _to_regtype(cls, conn: "BaseConnection[Any]") -> "SQL":
|
| 181 |
+
# `to_regtype()` returns the type oid or NULL, unlike the :: operator,
|
| 182 |
+
# which returns the type or raises an exception, which requires
|
| 183 |
+
# a transaction rollback and leaves traces in the server logs.
|
| 184 |
+
|
| 185 |
+
from .sql import SQL
|
| 186 |
+
|
| 187 |
+
if cls._has_to_regtype_function(conn):
|
| 188 |
+
return SQL("to_regtype(%(name)s)")
|
| 189 |
+
else:
|
| 190 |
+
return SQL("%(name)s::regtype")
|
| 191 |
+
|
| 192 |
+
def _added(self, registry: "TypesRegistry") -> None:
|
| 193 |
+
"""Method called by the `!registry` when the object is added there."""
|
| 194 |
+
pass
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
class RangeInfo(TypeInfo):
|
| 198 |
+
"""Manage information about a range type."""
|
| 199 |
+
|
| 200 |
+
__module__ = "psycopg.types.range"
|
| 201 |
+
|
| 202 |
+
def __init__(
|
| 203 |
+
self,
|
| 204 |
+
name: str,
|
| 205 |
+
oid: int,
|
| 206 |
+
array_oid: int,
|
| 207 |
+
*,
|
| 208 |
+
regtype: str = "",
|
| 209 |
+
subtype_oid: int,
|
| 210 |
+
):
|
| 211 |
+
super().__init__(name, oid, array_oid, regtype=regtype)
|
| 212 |
+
self.subtype_oid = subtype_oid
|
| 213 |
+
|
| 214 |
+
@classmethod
|
| 215 |
+
def _get_info_query(cls, conn: "BaseConnection[Any]") -> Query:
|
| 216 |
+
from .sql import SQL
|
| 217 |
+
|
| 218 |
+
return SQL(
|
| 219 |
+
"""\
|
| 220 |
+
SELECT t.typname AS name, t.oid AS oid, t.typarray AS array_oid,
|
| 221 |
+
t.oid::regtype::text AS regtype,
|
| 222 |
+
r.rngsubtype AS subtype_oid
|
| 223 |
+
FROM pg_type t
|
| 224 |
+
JOIN pg_range r ON t.oid = r.rngtypid
|
| 225 |
+
WHERE t.oid = {regtype}
|
| 226 |
+
"""
|
| 227 |
+
).format(regtype=cls._to_regtype(conn))
|
| 228 |
+
|
| 229 |
+
def _added(self, registry: "TypesRegistry") -> None:
|
| 230 |
+
# Map ranges subtypes to info
|
| 231 |
+
registry._registry[RangeInfo, self.subtype_oid] = self
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
class MultirangeInfo(TypeInfo):
|
| 235 |
+
"""Manage information about a multirange type."""
|
| 236 |
+
|
| 237 |
+
__module__ = "psycopg.types.multirange"
|
| 238 |
+
|
| 239 |
+
def __init__(
|
| 240 |
+
self,
|
| 241 |
+
name: str,
|
| 242 |
+
oid: int,
|
| 243 |
+
array_oid: int,
|
| 244 |
+
*,
|
| 245 |
+
regtype: str = "",
|
| 246 |
+
range_oid: int,
|
| 247 |
+
subtype_oid: int,
|
| 248 |
+
):
|
| 249 |
+
super().__init__(name, oid, array_oid, regtype=regtype)
|
| 250 |
+
self.range_oid = range_oid
|
| 251 |
+
self.subtype_oid = subtype_oid
|
| 252 |
+
|
| 253 |
+
@classmethod
|
| 254 |
+
def _get_info_query(cls, conn: "BaseConnection[Any]") -> Query:
|
| 255 |
+
from .sql import SQL
|
| 256 |
+
|
| 257 |
+
if conn.info.server_version < 140000:
|
| 258 |
+
raise e.NotSupportedError(
|
| 259 |
+
"multirange types are only available from PostgreSQL 14"
|
| 260 |
+
)
|
| 261 |
+
|
| 262 |
+
return SQL(
|
| 263 |
+
"""\
|
| 264 |
+
SELECT t.typname AS name, t.oid AS oid, t.typarray AS array_oid,
|
| 265 |
+
t.oid::regtype::text AS regtype,
|
| 266 |
+
r.rngtypid AS range_oid, r.rngsubtype AS subtype_oid
|
| 267 |
+
FROM pg_type t
|
| 268 |
+
JOIN pg_range r ON t.oid = r.rngmultitypid
|
| 269 |
+
WHERE t.oid = {regtype}
|
| 270 |
+
"""
|
| 271 |
+
).format(regtype=cls._to_regtype(conn))
|
| 272 |
+
|
| 273 |
+
def _added(self, registry: "TypesRegistry") -> None:
|
| 274 |
+
# Map multiranges ranges and subtypes to info
|
| 275 |
+
registry._registry[MultirangeInfo, self.range_oid] = self
|
| 276 |
+
registry._registry[MultirangeInfo, self.subtype_oid] = self
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
class CompositeInfo(TypeInfo):
|
| 280 |
+
"""Manage information about a composite type."""
|
| 281 |
+
|
| 282 |
+
__module__ = "psycopg.types.composite"
|
| 283 |
+
|
| 284 |
+
def __init__(
|
| 285 |
+
self,
|
| 286 |
+
name: str,
|
| 287 |
+
oid: int,
|
| 288 |
+
array_oid: int,
|
| 289 |
+
*,
|
| 290 |
+
regtype: str = "",
|
| 291 |
+
field_names: Sequence[str],
|
| 292 |
+
field_types: Sequence[int],
|
| 293 |
+
):
|
| 294 |
+
super().__init__(name, oid, array_oid, regtype=regtype)
|
| 295 |
+
self.field_names = field_names
|
| 296 |
+
self.field_types = field_types
|
| 297 |
+
# Will be set by register() if the `factory` is a type
|
| 298 |
+
self.python_type: Optional[type] = None
|
| 299 |
+
|
| 300 |
+
@classmethod
|
| 301 |
+
def _get_info_query(cls, conn: "BaseConnection[Any]") -> Query:
|
| 302 |
+
from .sql import SQL
|
| 303 |
+
|
| 304 |
+
return SQL(
|
| 305 |
+
"""\
|
| 306 |
+
SELECT
|
| 307 |
+
t.typname AS name, t.oid AS oid, t.typarray AS array_oid,
|
| 308 |
+
t.oid::regtype::text AS regtype,
|
| 309 |
+
coalesce(a.fnames, '{{}}') AS field_names,
|
| 310 |
+
coalesce(a.ftypes, '{{}}') AS field_types
|
| 311 |
+
FROM pg_type t
|
| 312 |
+
LEFT JOIN (
|
| 313 |
+
SELECT
|
| 314 |
+
attrelid,
|
| 315 |
+
array_agg(attname) AS fnames,
|
| 316 |
+
array_agg(atttypid) AS ftypes
|
| 317 |
+
FROM (
|
| 318 |
+
SELECT a.attrelid, a.attname, a.atttypid
|
| 319 |
+
FROM pg_attribute a
|
| 320 |
+
JOIN pg_type t ON t.typrelid = a.attrelid
|
| 321 |
+
WHERE t.oid = {regtype}
|
| 322 |
+
AND a.attnum > 0
|
| 323 |
+
AND NOT a.attisdropped
|
| 324 |
+
ORDER BY a.attnum
|
| 325 |
+
) x
|
| 326 |
+
GROUP BY attrelid
|
| 327 |
+
) a ON a.attrelid = t.typrelid
|
| 328 |
+
WHERE t.oid = {regtype}
|
| 329 |
+
"""
|
| 330 |
+
).format(regtype=cls._to_regtype(conn))
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
class EnumInfo(TypeInfo):
|
| 334 |
+
"""Manage information about an enum type."""
|
| 335 |
+
|
| 336 |
+
__module__ = "psycopg.types.enum"
|
| 337 |
+
|
| 338 |
+
def __init__(
|
| 339 |
+
self,
|
| 340 |
+
name: str,
|
| 341 |
+
oid: int,
|
| 342 |
+
array_oid: int,
|
| 343 |
+
labels: Sequence[str],
|
| 344 |
+
):
|
| 345 |
+
super().__init__(name, oid, array_oid)
|
| 346 |
+
self.labels = labels
|
| 347 |
+
# Will be set by register_enum()
|
| 348 |
+
self.enum: Optional[Type[Enum]] = None
|
| 349 |
+
|
| 350 |
+
@classmethod
|
| 351 |
+
def _get_info_query(cls, conn: "BaseConnection[Any]") -> Query:
|
| 352 |
+
from .sql import SQL
|
| 353 |
+
|
| 354 |
+
return SQL(
|
| 355 |
+
"""\
|
| 356 |
+
SELECT name, oid, array_oid, array_agg(label) AS labels
|
| 357 |
+
FROM (
|
| 358 |
+
SELECT
|
| 359 |
+
t.typname AS name, t.oid AS oid, t.typarray AS array_oid,
|
| 360 |
+
e.enumlabel AS label
|
| 361 |
+
FROM pg_type t
|
| 362 |
+
LEFT JOIN pg_enum e
|
| 363 |
+
ON e.enumtypid = t.oid
|
| 364 |
+
WHERE t.oid = {regtype}
|
| 365 |
+
ORDER BY e.enumsortorder
|
| 366 |
+
) x
|
| 367 |
+
GROUP BY name, oid, array_oid
|
| 368 |
+
"""
|
| 369 |
+
).format(regtype=cls._to_regtype(conn))
|
| 370 |
+
|
| 371 |
+
|
| 372 |
+
class TypesRegistry:
|
| 373 |
+
"""
|
| 374 |
+
Container for the information about types in a database.
|
| 375 |
+
"""
|
| 376 |
+
|
| 377 |
+
__module__ = "psycopg.types"
|
| 378 |
+
|
| 379 |
+
def __init__(self, template: Optional["TypesRegistry"] = None):
|
| 380 |
+
self._registry: Dict[RegistryKey, TypeInfo]
|
| 381 |
+
|
| 382 |
+
# Make a shallow copy: it will become a proper copy if the registry
|
| 383 |
+
# is edited.
|
| 384 |
+
if template:
|
| 385 |
+
self._registry = template._registry
|
| 386 |
+
self._own_state = False
|
| 387 |
+
template._own_state = False
|
| 388 |
+
else:
|
| 389 |
+
self.clear()
|
| 390 |
+
|
| 391 |
+
def clear(self) -> None:
|
| 392 |
+
self._registry = {}
|
| 393 |
+
self._own_state = True
|
| 394 |
+
|
| 395 |
+
def add(self, info: TypeInfo) -> None:
|
| 396 |
+
self._ensure_own_state()
|
| 397 |
+
if info.oid:
|
| 398 |
+
self._registry[info.oid] = info
|
| 399 |
+
if info.array_oid:
|
| 400 |
+
self._registry[info.array_oid] = info
|
| 401 |
+
self._registry[info.name] = info
|
| 402 |
+
|
| 403 |
+
if info.regtype and info.regtype not in self._registry:
|
| 404 |
+
self._registry[info.regtype] = info
|
| 405 |
+
|
| 406 |
+
# Allow info to customise further their relation with the registry
|
| 407 |
+
info._added(self)
|
| 408 |
+
|
| 409 |
+
def __iter__(self) -> Iterator[TypeInfo]:
|
| 410 |
+
seen = set()
|
| 411 |
+
for t in self._registry.values():
|
| 412 |
+
if id(t) not in seen:
|
| 413 |
+
seen.add(id(t))
|
| 414 |
+
yield t
|
| 415 |
+
|
| 416 |
+
@overload
|
| 417 |
+
def __getitem__(self, key: Union[str, int]) -> TypeInfo:
|
| 418 |
+
...
|
| 419 |
+
|
| 420 |
+
@overload
|
| 421 |
+
def __getitem__(self, key: Tuple[Type[T], int]) -> T:
|
| 422 |
+
...
|
| 423 |
+
|
| 424 |
+
def __getitem__(self, key: RegistryKey) -> TypeInfo:
|
| 425 |
+
"""
|
| 426 |
+
Return info about a type, specified by name or oid
|
| 427 |
+
|
| 428 |
+
:param key: the name or oid of the type to look for.
|
| 429 |
+
|
| 430 |
+
Raise KeyError if not found.
|
| 431 |
+
"""
|
| 432 |
+
if isinstance(key, str):
|
| 433 |
+
if key.endswith("[]"):
|
| 434 |
+
key = key[:-2]
|
| 435 |
+
elif not isinstance(key, (int, tuple)):
|
| 436 |
+
raise TypeError(f"the key must be an oid or a name, got {type(key)}")
|
| 437 |
+
try:
|
| 438 |
+
return self._registry[key]
|
| 439 |
+
except KeyError:
|
| 440 |
+
raise KeyError(f"couldn't find the type {key!r} in the types registry")
|
| 441 |
+
|
| 442 |
+
@overload
|
| 443 |
+
def get(self, key: Union[str, int]) -> Optional[TypeInfo]:
|
| 444 |
+
...
|
| 445 |
+
|
| 446 |
+
@overload
|
| 447 |
+
def get(self, key: Tuple[Type[T], int]) -> Optional[T]:
|
| 448 |
+
...
|
| 449 |
+
|
| 450 |
+
def get(self, key: RegistryKey) -> Optional[TypeInfo]:
|
| 451 |
+
"""
|
| 452 |
+
Return info about a type, specified by name or oid
|
| 453 |
+
|
| 454 |
+
:param key: the name or oid of the type to look for.
|
| 455 |
+
|
| 456 |
+
Unlike `__getitem__`, return None if not found.
|
| 457 |
+
"""
|
| 458 |
+
try:
|
| 459 |
+
return self[key]
|
| 460 |
+
except KeyError:
|
| 461 |
+
return None
|
| 462 |
+
|
| 463 |
+
def get_oid(self, name: str) -> int:
|
| 464 |
+
"""
|
| 465 |
+
Return the oid of a PostgreSQL type by name.
|
| 466 |
+
|
| 467 |
+
:param key: the name of the type to look for.
|
| 468 |
+
|
| 469 |
+
Return the array oid if the type ends with "``[]``"
|
| 470 |
+
|
| 471 |
+
Raise KeyError if the name is unknown.
|
| 472 |
+
"""
|
| 473 |
+
t = self[name]
|
| 474 |
+
if name.endswith("[]"):
|
| 475 |
+
return t.array_oid
|
| 476 |
+
else:
|
| 477 |
+
return t.oid
|
| 478 |
+
|
| 479 |
+
def get_by_subtype(self, cls: Type[T], subtype: Union[int, str]) -> Optional[T]:
|
| 480 |
+
"""
|
| 481 |
+
Return info about a `TypeInfo` subclass by its element name or oid.
|
| 482 |
+
|
| 483 |
+
:param cls: the subtype of `!TypeInfo` to look for. Currently
|
| 484 |
+
supported are `~psycopg.types.range.RangeInfo` and
|
| 485 |
+
`~psycopg.types.multirange.MultirangeInfo`.
|
| 486 |
+
:param subtype: The name or OID of the subtype of the element to look for.
|
| 487 |
+
:return: The `!TypeInfo` object of class `!cls` whose subtype is
|
| 488 |
+
`!subtype`. `!None` if the element or its range are not found.
|
| 489 |
+
"""
|
| 490 |
+
try:
|
| 491 |
+
info = self[subtype]
|
| 492 |
+
except KeyError:
|
| 493 |
+
return None
|
| 494 |
+
return self.get((cls, info.oid))
|
| 495 |
+
|
| 496 |
+
def _ensure_own_state(self) -> None:
|
| 497 |
+
# Time to write! so, copy.
|
| 498 |
+
if not self._own_state:
|
| 499 |
+
self._registry = self._registry.copy()
|
| 500 |
+
self._own_state = True
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_tz.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Timezone utility functions.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
import logging
|
| 8 |
+
from typing import Dict, Optional, Union
|
| 9 |
+
from datetime import timezone, tzinfo
|
| 10 |
+
|
| 11 |
+
from .pq.abc import PGconn
|
| 12 |
+
from ._compat import ZoneInfo
|
| 13 |
+
|
| 14 |
+
logger = logging.getLogger("psycopg")
|
| 15 |
+
|
| 16 |
+
_timezones: Dict[Union[None, bytes], tzinfo] = {
|
| 17 |
+
None: timezone.utc,
|
| 18 |
+
b"UTC": timezone.utc,
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def get_tzinfo(pgconn: Optional[PGconn]) -> tzinfo:
|
| 23 |
+
"""Return the Python timezone info of the connection's timezone."""
|
| 24 |
+
tzname = pgconn.parameter_status(b"TimeZone") if pgconn else None
|
| 25 |
+
try:
|
| 26 |
+
return _timezones[tzname]
|
| 27 |
+
except KeyError:
|
| 28 |
+
sname = tzname.decode() if tzname else "UTC"
|
| 29 |
+
try:
|
| 30 |
+
zi: tzinfo = ZoneInfo(sname)
|
| 31 |
+
except (KeyError, OSError):
|
| 32 |
+
logger.warning("unknown PostgreSQL timezone: %r; will use UTC", sname)
|
| 33 |
+
zi = timezone.utc
|
| 34 |
+
except Exception as ex:
|
| 35 |
+
logger.warning(
|
| 36 |
+
"error handling PostgreSQL timezone: %r; will use UTC (%s - %s)",
|
| 37 |
+
sname,
|
| 38 |
+
type(ex).__name__,
|
| 39 |
+
ex,
|
| 40 |
+
)
|
| 41 |
+
zi = timezone.utc
|
| 42 |
+
|
| 43 |
+
_timezones[tzname] = zi
|
| 44 |
+
return zi
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/_wrappers.py
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Wrappers for numeric types.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
# Wrappers to force numbers to be cast as specific PostgreSQL types
|
| 8 |
+
|
| 9 |
+
# These types are implemented here but exposed by `psycopg.types.numeric`.
|
| 10 |
+
# They are defined here to avoid a circular import.
|
| 11 |
+
_MODULE = "psycopg.types.numeric"
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class Int2(int):
|
| 15 |
+
"""
|
| 16 |
+
Force dumping a Python `!int` as a PostgreSQL :sql:`smallint/int2`.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
__module__ = _MODULE
|
| 20 |
+
__slots__ = ()
|
| 21 |
+
|
| 22 |
+
def __new__(cls, arg: int) -> "Int2":
|
| 23 |
+
return super().__new__(cls, arg)
|
| 24 |
+
|
| 25 |
+
def __str__(self) -> str:
|
| 26 |
+
return super().__repr__()
|
| 27 |
+
|
| 28 |
+
def __repr__(self) -> str:
|
| 29 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class Int4(int):
|
| 33 |
+
"""
|
| 34 |
+
Force dumping a Python `!int` as a PostgreSQL :sql:`integer/int4`.
|
| 35 |
+
"""
|
| 36 |
+
|
| 37 |
+
__module__ = _MODULE
|
| 38 |
+
__slots__ = ()
|
| 39 |
+
|
| 40 |
+
def __new__(cls, arg: int) -> "Int4":
|
| 41 |
+
return super().__new__(cls, arg)
|
| 42 |
+
|
| 43 |
+
def __str__(self) -> str:
|
| 44 |
+
return super().__repr__()
|
| 45 |
+
|
| 46 |
+
def __repr__(self) -> str:
|
| 47 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class Int8(int):
|
| 51 |
+
"""
|
| 52 |
+
Force dumping a Python `!int` as a PostgreSQL :sql:`bigint/int8`.
|
| 53 |
+
"""
|
| 54 |
+
|
| 55 |
+
__module__ = _MODULE
|
| 56 |
+
__slots__ = ()
|
| 57 |
+
|
| 58 |
+
def __new__(cls, arg: int) -> "Int8":
|
| 59 |
+
return super().__new__(cls, arg)
|
| 60 |
+
|
| 61 |
+
def __str__(self) -> str:
|
| 62 |
+
return super().__repr__()
|
| 63 |
+
|
| 64 |
+
def __repr__(self) -> str:
|
| 65 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
class IntNumeric(int):
|
| 69 |
+
"""
|
| 70 |
+
Force dumping a Python `!int` as a PostgreSQL :sql:`numeric/decimal`.
|
| 71 |
+
"""
|
| 72 |
+
|
| 73 |
+
__module__ = _MODULE
|
| 74 |
+
__slots__ = ()
|
| 75 |
+
|
| 76 |
+
def __new__(cls, arg: int) -> "IntNumeric":
|
| 77 |
+
return super().__new__(cls, arg)
|
| 78 |
+
|
| 79 |
+
def __str__(self) -> str:
|
| 80 |
+
return super().__repr__()
|
| 81 |
+
|
| 82 |
+
def __repr__(self) -> str:
|
| 83 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
class Float4(float):
|
| 87 |
+
"""
|
| 88 |
+
Force dumping a Python `!float` as a PostgreSQL :sql:`float4/real`.
|
| 89 |
+
"""
|
| 90 |
+
|
| 91 |
+
__module__ = _MODULE
|
| 92 |
+
__slots__ = ()
|
| 93 |
+
|
| 94 |
+
def __new__(cls, arg: float) -> "Float4":
|
| 95 |
+
return super().__new__(cls, arg)
|
| 96 |
+
|
| 97 |
+
def __str__(self) -> str:
|
| 98 |
+
return super().__repr__()
|
| 99 |
+
|
| 100 |
+
def __repr__(self) -> str:
|
| 101 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
class Float8(float):
|
| 105 |
+
"""
|
| 106 |
+
Force dumping a Python `!float` as a PostgreSQL :sql:`float8/double precision`.
|
| 107 |
+
"""
|
| 108 |
+
|
| 109 |
+
__module__ = _MODULE
|
| 110 |
+
__slots__ = ()
|
| 111 |
+
|
| 112 |
+
def __new__(cls, arg: float) -> "Float8":
|
| 113 |
+
return super().__new__(cls, arg)
|
| 114 |
+
|
| 115 |
+
def __str__(self) -> str:
|
| 116 |
+
return super().__repr__()
|
| 117 |
+
|
| 118 |
+
def __repr__(self) -> str:
|
| 119 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
class Oid(int):
|
| 123 |
+
"""
|
| 124 |
+
Force dumping a Python `!int` as a PostgreSQL :sql:`oid`.
|
| 125 |
+
"""
|
| 126 |
+
|
| 127 |
+
__module__ = _MODULE
|
| 128 |
+
__slots__ = ()
|
| 129 |
+
|
| 130 |
+
def __new__(cls, arg: int) -> "Oid":
|
| 131 |
+
return super().__new__(cls, arg)
|
| 132 |
+
|
| 133 |
+
def __str__(self) -> str:
|
| 134 |
+
return super().__repr__()
|
| 135 |
+
|
| 136 |
+
def __repr__(self) -> str:
|
| 137 |
+
return f"{self.__class__.__name__}({super().__repr__()})"
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/version.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
psycopg distribution version file.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 6 |
+
|
| 7 |
+
# Use a versioning scheme as defined in
|
| 8 |
+
# https://www.python.org/dev/peps/pep-0440/
|
| 9 |
+
|
| 10 |
+
# STOP AND READ! if you change:
|
| 11 |
+
__version__ = "3.1.12"
|
| 12 |
+
# also change:
|
| 13 |
+
# - `docs/news.rst` to declare this as the current version or an unreleased one
|
| 14 |
+
# - `psycopg_c/psycopg_c/version.py` to the same version.
|
pgsql/pgAdmin 4/python/Lib/site-packages/psycopg/waiting.py
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Code concerned with waiting in different contexts (blocking, async, etc).
|
| 3 |
+
|
| 4 |
+
These functions are designed to consume the generators returned by the
|
| 5 |
+
`generators` module function and to return their final value.
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
# Copyright (C) 2020 The Psycopg Team
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
import os
|
| 13 |
+
import sys
|
| 14 |
+
import select
|
| 15 |
+
import selectors
|
| 16 |
+
from typing import Optional
|
| 17 |
+
from asyncio import get_event_loop, wait_for, Event, TimeoutError
|
| 18 |
+
from selectors import DefaultSelector
|
| 19 |
+
|
| 20 |
+
from . import errors as e
|
| 21 |
+
from .abc import RV, PQGen, PQGenConn, WaitFunc
|
| 22 |
+
from ._enums import Wait as Wait, Ready as Ready # re-exported
|
| 23 |
+
from ._cmodule import _psycopg
|
| 24 |
+
|
| 25 |
+
WAIT_R = Wait.R
|
| 26 |
+
WAIT_W = Wait.W
|
| 27 |
+
WAIT_RW = Wait.RW
|
| 28 |
+
READY_R = Ready.R
|
| 29 |
+
READY_W = Ready.W
|
| 30 |
+
READY_RW = Ready.RW
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def wait_selector(gen: PQGen[RV], fileno: int, timeout: Optional[float] = None) -> RV:
|
| 34 |
+
"""
|
| 35 |
+
Wait for a generator using the best strategy available.
|
| 36 |
+
|
| 37 |
+
:param gen: a generator performing database operations and yielding
|
| 38 |
+
`Ready` values when it would block.
|
| 39 |
+
:param fileno: the file descriptor to wait on.
|
| 40 |
+
:param timeout: timeout (in seconds) to check for other interrupt, e.g.
|
| 41 |
+
to allow Ctrl-C.
|
| 42 |
+
:type timeout: float
|
| 43 |
+
:return: whatever `!gen` returns on completion.
|
| 44 |
+
|
| 45 |
+
Consume `!gen`, scheduling `fileno` for completion when it is reported to
|
| 46 |
+
block. Once ready again send the ready state back to `!gen`.
|
| 47 |
+
"""
|
| 48 |
+
try:
|
| 49 |
+
s = next(gen)
|
| 50 |
+
with DefaultSelector() as sel:
|
| 51 |
+
while True:
|
| 52 |
+
sel.register(fileno, s)
|
| 53 |
+
rlist = None
|
| 54 |
+
while not rlist:
|
| 55 |
+
rlist = sel.select(timeout=timeout)
|
| 56 |
+
sel.unregister(fileno)
|
| 57 |
+
# note: this line should require a cast, but mypy doesn't complain
|
| 58 |
+
ready: Ready = rlist[0][1]
|
| 59 |
+
assert s & ready
|
| 60 |
+
s = gen.send(ready)
|
| 61 |
+
|
| 62 |
+
except StopIteration as ex:
|
| 63 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 64 |
+
return rv
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def wait_conn(gen: PQGenConn[RV], timeout: Optional[float] = None) -> RV:
|
| 68 |
+
"""
|
| 69 |
+
Wait for a connection generator using the best strategy available.
|
| 70 |
+
|
| 71 |
+
:param gen: a generator performing database operations and yielding
|
| 72 |
+
(fd, `Ready`) pairs when it would block.
|
| 73 |
+
:param timeout: timeout (in seconds) to check for other interrupt, e.g.
|
| 74 |
+
to allow Ctrl-C. If zero or None, wait indefinitely.
|
| 75 |
+
:type timeout: float
|
| 76 |
+
:return: whatever `!gen` returns on completion.
|
| 77 |
+
|
| 78 |
+
Behave like in `wait()`, but take the fileno to wait from the generator
|
| 79 |
+
itself, which might change during processing.
|
| 80 |
+
"""
|
| 81 |
+
try:
|
| 82 |
+
fileno, s = next(gen)
|
| 83 |
+
if not timeout:
|
| 84 |
+
timeout = None
|
| 85 |
+
with DefaultSelector() as sel:
|
| 86 |
+
while True:
|
| 87 |
+
sel.register(fileno, s)
|
| 88 |
+
rlist = sel.select(timeout=timeout)
|
| 89 |
+
sel.unregister(fileno)
|
| 90 |
+
if not rlist:
|
| 91 |
+
raise e.ConnectionTimeout("connection timeout expired")
|
| 92 |
+
ready: Ready = rlist[0][1] # type: ignore[assignment]
|
| 93 |
+
fileno, s = gen.send(ready)
|
| 94 |
+
|
| 95 |
+
except StopIteration as ex:
|
| 96 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 97 |
+
return rv
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
async def wait_async(
|
| 101 |
+
gen: PQGen[RV], fileno: int, timeout: Optional[float] = None
|
| 102 |
+
) -> RV:
|
| 103 |
+
"""
|
| 104 |
+
Coroutine waiting for a generator to complete.
|
| 105 |
+
|
| 106 |
+
:param gen: a generator performing database operations and yielding
|
| 107 |
+
`Ready` values when it would block.
|
| 108 |
+
:param fileno: the file descriptor to wait on.
|
| 109 |
+
:return: whatever `!gen` returns on completion.
|
| 110 |
+
|
| 111 |
+
Behave like in `wait()`, but exposing an `asyncio` interface.
|
| 112 |
+
"""
|
| 113 |
+
# Use an event to block and restart after the fd state changes.
|
| 114 |
+
# Not sure this is the best implementation but it's a start.
|
| 115 |
+
ev = Event()
|
| 116 |
+
loop = get_event_loop()
|
| 117 |
+
ready: Ready
|
| 118 |
+
s: Wait
|
| 119 |
+
|
| 120 |
+
def wakeup(state: Ready) -> None:
|
| 121 |
+
nonlocal ready
|
| 122 |
+
ready |= state # type: ignore[assignment]
|
| 123 |
+
ev.set()
|
| 124 |
+
|
| 125 |
+
try:
|
| 126 |
+
s = next(gen)
|
| 127 |
+
while True:
|
| 128 |
+
reader = s & WAIT_R
|
| 129 |
+
writer = s & WAIT_W
|
| 130 |
+
if not reader and not writer:
|
| 131 |
+
raise e.InternalError(f"bad poll status: {s}")
|
| 132 |
+
ev.clear()
|
| 133 |
+
ready = 0 # type: ignore[assignment]
|
| 134 |
+
if reader:
|
| 135 |
+
loop.add_reader(fileno, wakeup, READY_R)
|
| 136 |
+
if writer:
|
| 137 |
+
loop.add_writer(fileno, wakeup, READY_W)
|
| 138 |
+
try:
|
| 139 |
+
if timeout is None:
|
| 140 |
+
await ev.wait()
|
| 141 |
+
else:
|
| 142 |
+
try:
|
| 143 |
+
await wait_for(ev.wait(), timeout)
|
| 144 |
+
except TimeoutError:
|
| 145 |
+
pass
|
| 146 |
+
finally:
|
| 147 |
+
if reader:
|
| 148 |
+
loop.remove_reader(fileno)
|
| 149 |
+
if writer:
|
| 150 |
+
loop.remove_writer(fileno)
|
| 151 |
+
s = gen.send(ready)
|
| 152 |
+
|
| 153 |
+
except StopIteration as ex:
|
| 154 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 155 |
+
return rv
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
async def wait_conn_async(gen: PQGenConn[RV], timeout: Optional[float] = None) -> RV:
|
| 159 |
+
"""
|
| 160 |
+
Coroutine waiting for a connection generator to complete.
|
| 161 |
+
|
| 162 |
+
:param gen: a generator performing database operations and yielding
|
| 163 |
+
(fd, `Ready`) pairs when it would block.
|
| 164 |
+
:param timeout: timeout (in seconds) to check for other interrupt, e.g.
|
| 165 |
+
to allow Ctrl-C. If zero or None, wait indefinitely.
|
| 166 |
+
:return: whatever `!gen` returns on completion.
|
| 167 |
+
|
| 168 |
+
Behave like in `wait()`, but take the fileno to wait from the generator
|
| 169 |
+
itself, which might change during processing.
|
| 170 |
+
"""
|
| 171 |
+
# Use an event to block and restart after the fd state changes.
|
| 172 |
+
# Not sure this is the best implementation but it's a start.
|
| 173 |
+
ev = Event()
|
| 174 |
+
loop = get_event_loop()
|
| 175 |
+
ready: Ready
|
| 176 |
+
s: Wait
|
| 177 |
+
|
| 178 |
+
def wakeup(state: Ready) -> None:
|
| 179 |
+
nonlocal ready
|
| 180 |
+
ready = state
|
| 181 |
+
ev.set()
|
| 182 |
+
|
| 183 |
+
try:
|
| 184 |
+
fileno, s = next(gen)
|
| 185 |
+
if not timeout:
|
| 186 |
+
timeout = None
|
| 187 |
+
while True:
|
| 188 |
+
reader = s & WAIT_R
|
| 189 |
+
writer = s & WAIT_W
|
| 190 |
+
if not reader and not writer:
|
| 191 |
+
raise e.InternalError(f"bad poll status: {s}")
|
| 192 |
+
ev.clear()
|
| 193 |
+
ready = 0 # type: ignore[assignment]
|
| 194 |
+
if reader:
|
| 195 |
+
loop.add_reader(fileno, wakeup, READY_R)
|
| 196 |
+
if writer:
|
| 197 |
+
loop.add_writer(fileno, wakeup, READY_W)
|
| 198 |
+
try:
|
| 199 |
+
await wait_for(ev.wait(), timeout)
|
| 200 |
+
finally:
|
| 201 |
+
if reader:
|
| 202 |
+
loop.remove_reader(fileno)
|
| 203 |
+
if writer:
|
| 204 |
+
loop.remove_writer(fileno)
|
| 205 |
+
fileno, s = gen.send(ready)
|
| 206 |
+
|
| 207 |
+
except TimeoutError:
|
| 208 |
+
raise e.ConnectionTimeout("connection timeout expired")
|
| 209 |
+
|
| 210 |
+
except StopIteration as ex:
|
| 211 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 212 |
+
return rv
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
# Specialised implementation of wait functions.
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
def wait_select(gen: PQGen[RV], fileno: int, timeout: Optional[float] = None) -> RV:
|
| 219 |
+
"""
|
| 220 |
+
Wait for a generator using select where supported.
|
| 221 |
+
|
| 222 |
+
BUG: on Linux, can't select on FD >= 1024. On Windows it's fine.
|
| 223 |
+
"""
|
| 224 |
+
try:
|
| 225 |
+
s = next(gen)
|
| 226 |
+
|
| 227 |
+
empty = ()
|
| 228 |
+
fnlist = (fileno,)
|
| 229 |
+
while True:
|
| 230 |
+
rl, wl, xl = select.select(
|
| 231 |
+
fnlist if s & WAIT_R else empty,
|
| 232 |
+
fnlist if s & WAIT_W else empty,
|
| 233 |
+
fnlist,
|
| 234 |
+
timeout,
|
| 235 |
+
)
|
| 236 |
+
ready = 0
|
| 237 |
+
if rl:
|
| 238 |
+
ready = READY_R
|
| 239 |
+
if wl:
|
| 240 |
+
ready |= READY_W
|
| 241 |
+
if not ready:
|
| 242 |
+
continue
|
| 243 |
+
# assert s & ready
|
| 244 |
+
s = gen.send(ready) # type: ignore
|
| 245 |
+
|
| 246 |
+
except StopIteration as ex:
|
| 247 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 248 |
+
return rv
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
if hasattr(selectors, "EpollSelector"):
|
| 252 |
+
_epoll_evmasks = {
|
| 253 |
+
WAIT_R: select.EPOLLONESHOT | select.EPOLLIN | select.EPOLLERR,
|
| 254 |
+
WAIT_W: select.EPOLLONESHOT | select.EPOLLOUT | select.EPOLLERR,
|
| 255 |
+
WAIT_RW: select.EPOLLONESHOT
|
| 256 |
+
| (select.EPOLLIN | select.EPOLLOUT | select.EPOLLERR),
|
| 257 |
+
}
|
| 258 |
+
else:
|
| 259 |
+
_epoll_evmasks = {}
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
def wait_epoll(gen: PQGen[RV], fileno: int, timeout: Optional[float] = None) -> RV:
|
| 263 |
+
"""
|
| 264 |
+
Wait for a generator using epoll where supported.
|
| 265 |
+
|
| 266 |
+
Parameters are like for `wait()`. If it is detected that the best selector
|
| 267 |
+
strategy is `epoll` then this function will be used instead of `wait`.
|
| 268 |
+
|
| 269 |
+
See also: https://linux.die.net/man/2/epoll_ctl
|
| 270 |
+
|
| 271 |
+
BUG: if the connection FD is closed, `epoll.poll()` hangs. Same for
|
| 272 |
+
EpollSelector. For this reason, wait_poll() is currently preferable.
|
| 273 |
+
To reproduce the bug:
|
| 274 |
+
|
| 275 |
+
export PSYCOPG_WAIT_FUNC=wait_epoll
|
| 276 |
+
pytest tests/test_concurrency.py::test_concurrent_close
|
| 277 |
+
"""
|
| 278 |
+
try:
|
| 279 |
+
s = next(gen)
|
| 280 |
+
|
| 281 |
+
if timeout is None or timeout < 0:
|
| 282 |
+
timeout = 0
|
| 283 |
+
else:
|
| 284 |
+
timeout = int(timeout * 1000.0)
|
| 285 |
+
|
| 286 |
+
with select.epoll() as epoll:
|
| 287 |
+
evmask = _epoll_evmasks[s]
|
| 288 |
+
epoll.register(fileno, evmask)
|
| 289 |
+
while True:
|
| 290 |
+
fileevs = None
|
| 291 |
+
while not fileevs:
|
| 292 |
+
fileevs = epoll.poll(timeout)
|
| 293 |
+
ev = fileevs[0][1]
|
| 294 |
+
ready = 0
|
| 295 |
+
if ev & ~select.EPOLLOUT:
|
| 296 |
+
ready = READY_R
|
| 297 |
+
if ev & ~select.EPOLLIN:
|
| 298 |
+
ready |= READY_W
|
| 299 |
+
# assert s & ready
|
| 300 |
+
s = gen.send(ready)
|
| 301 |
+
evmask = _epoll_evmasks[s]
|
| 302 |
+
epoll.modify(fileno, evmask)
|
| 303 |
+
|
| 304 |
+
except StopIteration as ex:
|
| 305 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 306 |
+
return rv
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
if hasattr(selectors, "PollSelector"):
|
| 310 |
+
_poll_evmasks = {
|
| 311 |
+
WAIT_R: select.POLLIN,
|
| 312 |
+
WAIT_W: select.POLLOUT,
|
| 313 |
+
WAIT_RW: select.POLLIN | select.POLLOUT,
|
| 314 |
+
}
|
| 315 |
+
else:
|
| 316 |
+
_poll_evmasks = {}
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
def wait_poll(gen: PQGen[RV], fileno: int, timeout: Optional[float] = None) -> RV:
|
| 320 |
+
"""
|
| 321 |
+
Wait for a generator using poll where supported.
|
| 322 |
+
|
| 323 |
+
Parameters are like for `wait()`.
|
| 324 |
+
"""
|
| 325 |
+
try:
|
| 326 |
+
s = next(gen)
|
| 327 |
+
|
| 328 |
+
if timeout is None or timeout < 0:
|
| 329 |
+
timeout = 0
|
| 330 |
+
else:
|
| 331 |
+
timeout = int(timeout * 1000.0)
|
| 332 |
+
|
| 333 |
+
poll = select.poll()
|
| 334 |
+
evmask = _poll_evmasks[s]
|
| 335 |
+
poll.register(fileno, evmask)
|
| 336 |
+
while True:
|
| 337 |
+
fileevs = None
|
| 338 |
+
while not fileevs:
|
| 339 |
+
fileevs = poll.poll(timeout)
|
| 340 |
+
ev = fileevs[0][1]
|
| 341 |
+
ready = 0
|
| 342 |
+
if ev & ~select.POLLOUT:
|
| 343 |
+
ready = READY_R
|
| 344 |
+
if ev & ~select.POLLIN:
|
| 345 |
+
ready |= READY_W
|
| 346 |
+
# assert s & ready
|
| 347 |
+
s = gen.send(ready)
|
| 348 |
+
evmask = _poll_evmasks[s]
|
| 349 |
+
poll.modify(fileno, evmask)
|
| 350 |
+
|
| 351 |
+
except StopIteration as ex:
|
| 352 |
+
rv: RV = ex.args[0] if ex.args else None
|
| 353 |
+
return rv
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
if _psycopg:
|
| 357 |
+
wait_c = _psycopg.wait_c
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
# Choose the best wait strategy for the platform.
|
| 361 |
+
#
|
| 362 |
+
# the selectors objects have a generic interface but come with some overhead,
|
| 363 |
+
# so we also offer more finely tuned implementations.
|
| 364 |
+
|
| 365 |
+
wait: WaitFunc
|
| 366 |
+
|
| 367 |
+
# Allow the user to choose a specific function for testing
|
| 368 |
+
if "PSYCOPG_WAIT_FUNC" in os.environ:
|
| 369 |
+
fname = os.environ["PSYCOPG_WAIT_FUNC"]
|
| 370 |
+
if not fname.startswith("wait_") or fname not in globals():
|
| 371 |
+
raise ImportError(
|
| 372 |
+
"PSYCOPG_WAIT_FUNC should be the name of an available wait function;"
|
| 373 |
+
f" got {fname!r}"
|
| 374 |
+
)
|
| 375 |
+
wait = globals()[fname]
|
| 376 |
+
|
| 377 |
+
# On Windows, for the moment, avoid using wait_c, because it was reported to
|
| 378 |
+
# use excessive CPU (see #645).
|
| 379 |
+
# TODO: investigate why.
|
| 380 |
+
elif _psycopg and sys.platform != "win32":
|
| 381 |
+
wait = wait_c
|
| 382 |
+
|
| 383 |
+
elif selectors.DefaultSelector is getattr(selectors, "SelectSelector", None):
|
| 384 |
+
# On Windows, SelectSelector should be the default.
|
| 385 |
+
wait = wait_select
|
| 386 |
+
|
| 387 |
+
elif hasattr(selectors, "PollSelector"):
|
| 388 |
+
# On linux, EpollSelector is the default. However, it hangs if the fd is
|
| 389 |
+
# closed while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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
This version of the GNU Lesser General Public License incorporates
|
| 10 |
+
the terms and conditions of version 3 of the GNU General Public
|
| 11 |
+
License, supplemented by the additional permissions listed below.
|
| 12 |
+
|
| 13 |
+
0. Additional Definitions.
|
| 14 |
+
|
| 15 |
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
| 16 |
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
| 17 |
+
General Public License.
|
| 18 |
+
|
| 19 |
+
"The Library" refers to a covered work governed by this License,
|
| 20 |
+
other than an Application or a Combined Work as defined below.
|
| 21 |
+
|
| 22 |
+
An "Application" is any work that makes use of an interface provided
|
| 23 |
+
by the Library, but which is not otherwise based on the Library.
|
| 24 |
+
Defining a subclass of a class defined by the Library is deemed a mode
|
| 25 |
+
of using an interface provided by the Library.
|
| 26 |
+
|
| 27 |
+
A "Combined Work" is a work produced by combining or linking an
|
| 28 |
+
Application with the Library. The particular version of the Library
|
| 29 |
+
with which the Combined Work was made is also called the "Linked
|
| 30 |
+
Version".
|
| 31 |
+
|
| 32 |
+
The "Minimal Corresponding Source" for a Combined Work means the
|
| 33 |
+
Corresponding Source for the Combined Work, excluding any source code
|
| 34 |
+
for portions of the Combined Work that, considered in isolation, are
|
| 35 |
+
based on the Application, and not on the Linked Version.
|
| 36 |
+
|
| 37 |
+
The "Corresponding Application Code" for a Combined Work means the
|
| 38 |
+
object code and/or source code for the Application, including any data
|
| 39 |
+
and utility programs needed for reproducing the Combined Work from the
|
| 40 |
+
Application, but excluding the System Libraries of the Combined Work.
|
| 41 |
+
|
| 42 |
+
1. Exception to Section 3 of the GNU GPL.
|
| 43 |
+
|
| 44 |
+
You may convey a covered work under sections 3 and 4 of this License
|
| 45 |
+
without being bound by section 3 of the GNU GPL.
|
| 46 |
+
|
| 47 |
+
2. Conveying Modified Versions.
|
| 48 |
+
|
| 49 |
+
If you modify a copy of the Library, and, in your modifications, a
|
| 50 |
+
facility refers to a function or data to be supplied by an Application
|
| 51 |
+
that uses the facility (other than as an argument passed when the
|
| 52 |
+
facility is invoked), then you may convey a copy of the modified
|
| 53 |
+
version:
|
| 54 |
+
|
| 55 |
+
a) under this License, provided that you make a good faith effort to
|
| 56 |
+
ensure that, in the event an Application does not supply the
|
| 57 |
+
function or data, the facility still operates, and performs
|
| 58 |
+
whatever part of its purpose remains meaningful, or
|
| 59 |
+
|
| 60 |
+
b) under the GNU GPL, with none of the additional permissions of
|
| 61 |
+
this License applicable to that copy.
|
| 62 |
+
|
| 63 |
+
3. Object Code Incorporating Material from Library Header Files.
|
| 64 |
+
|
| 65 |
+
The object code form of an Application may incorporate material from
|
| 66 |
+
a header file that is part of the Library. You may convey such object
|
| 67 |
+
code under terms of your choice, provided that, if the incorporated
|
| 68 |
+
material is not limited to numerical parameters, data structure
|
| 69 |
+
layouts and accessors, or small macros, inline functions and templates
|
| 70 |
+
(ten or fewer lines in length), you do both of the following:
|
| 71 |
+
|
| 72 |
+
a) Give prominent notice with each copy of the object code that the
|
| 73 |
+
Library is used in it and that the Library and its use are
|
| 74 |
+
covered by this License.
|
| 75 |
+
|
| 76 |
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
| 77 |
+
document.
|
| 78 |
+
|
| 79 |
+
4. Combined Works.
|
| 80 |
+
|
| 81 |
+
You may convey a Combined Work under terms of your choice that,
|
| 82 |
+
taken together, effectively do not restrict modification of the
|
| 83 |
+
portions of the Library contained in the Combined Work and reverse
|
| 84 |
+
engineering for debugging such modifications, if you also do each of
|
| 85 |
+
the following:
|
| 86 |
+
|
| 87 |
+
a) Give prominent notice with each copy of the Combined Work that
|
| 88 |
+
the Library is used in it and that the Library and its use are
|
| 89 |
+
covered by this License.
|
| 90 |
+
|
| 91 |
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
| 92 |
+
document.
|
| 93 |
+
|
| 94 |
+
c) For a Combined Work that displays copyright notices during
|
| 95 |
+
execution, include the copyright notice for the Library among
|
| 96 |
+
these notices, as well as a reference directing the user to the
|
| 97 |
+
copies of the GNU GPL and this license document.
|
| 98 |
+
|
| 99 |
+
d) Do one of the following:
|
| 100 |
+
|
| 101 |
+
0) Convey the Minimal Corresponding Source under the terms of this
|
| 102 |
+
License, and the Corresponding Application Code in a form
|
| 103 |
+
suitable for, and under terms that permit, the user to
|
| 104 |
+
recombine or relink the Application with a modified version of
|
| 105 |
+
the Linked Version to produce a modified Combined Work, in the
|
| 106 |
+
manner specified by section 6 of the GNU GPL for conveying
|
| 107 |
+
Corresponding Source.
|
| 108 |
+
|
| 109 |
+
1) Use a suitable shared library mechanism for linking with the
|
| 110 |
+
Library. A suitable mechanism is one that (a) uses at run time
|
| 111 |
+
a copy of the Library already present on the user's computer
|
| 112 |
+
system, and (b) will operate properly with a modified version
|
| 113 |
+
of the Library that is interface-compatible with the Linked
|
| 114 |
+
Version.
|
| 115 |
+
|
| 116 |
+
e) Provide Installation Information, but only if you would otherwise
|
| 117 |
+
be required to provide such information under section 6 of the
|
| 118 |
+
GNU GPL, and only to the extent that such information is
|
| 119 |
+
necessary to install and execute a modified version of the
|
| 120 |
+
Combined Work produced by recombining or relinking the
|
| 121 |
+
Application with a modified version of the Linked Version. (If
|
| 122 |
+
you use option 4d0, the Installation Information must accompany
|
| 123 |
+
the Minimal Corresponding Source and Corresponding Application
|
| 124 |
+
Code. If you use option 4d1, you must provide the Installation
|
| 125 |
+
Information in the manner specified by section 6 of the GNU GPL
|
| 126 |
+
for conveying Corresponding Source.)
|
| 127 |
+
|
| 128 |
+
5. Combined Libraries.
|
| 129 |
+
|
| 130 |
+
You may place library facilities that are a work based on the
|
| 131 |
+
Library side by side in a single library together with other library
|
| 132 |
+
facilities that are not Applications and are not covered by this
|
| 133 |
+
License, and convey such a combined library under terms of your
|
| 134 |
+
choice, if you do both of the following:
|
| 135 |
+
|
| 136 |
+
a) Accompany the combined library with a copy of the same work based
|
| 137 |
+
on the Library, uncombined with any other library facilities,
|
| 138 |
+
conveyed under the terms of this License.
|
| 139 |
+
|
| 140 |
+
b) Give prominent notice with the combined library that part of it
|
| 141 |
+
is a work based on the Library, and explaining where to find the
|
| 142 |
+
accompanying uncombined form of the same work.
|
| 143 |
+
|
| 144 |
+
6. Revised Versions of the GNU Lesser General Public License.
|
| 145 |
+
|
| 146 |
+
The Free Software Foundation may publish revised and/or new versions
|
| 147 |
+
of the GNU Lesser General Public License from time to time. Such new
|
| 148 |
+
versions will be similar in spirit to the present version, but may
|
| 149 |
+
differ in detail to address new problems or concerns.
|
| 150 |
+
|
| 151 |
+
Each version is given a distinguishing version number. If the
|
| 152 |
+
Library as you received it specifies that a certain numbered version
|
| 153 |
+
of the GNU Lesser General Public License "or any later version"
|
| 154 |
+
applies to it, you have the option of following the terms and
|
| 155 |
+
conditions either of that published version or of any later version
|
| 156 |
+
published by the Free Software Foundation. If the Library as you
|
| 157 |
+
received it does not specify a version number of the GNU Lesser
|
| 158 |
+
General Public License, you may choose any version of the GNU Lesser
|
| 159 |
+
General Public License ever published by the Free Software Foundation.
|
| 160 |
+
|
| 161 |
+
If the Library as you received it specifies that a proxy can decide
|
| 162 |
+
whether future versions of the GNU Lesser General Public License shall
|
| 163 |
+
apply, that proxy's public statement of acceptance of any version is
|
| 164 |
+
permanent authorization for you to choose that version for the
|
| 165 |
+
Library.
|