Added support for psycopg3 along with psycopg2. #5011

This commit is contained in:
Khushboo Vashi
2023-02-15 11:31:29 +05:30
committed by Akshay Joshi
parent 7a4951f211
commit 5e0daccf76
635 changed files with 6500 additions and 1534 deletions

View File

@@ -11,7 +11,6 @@
a webserver, this will provide the WSGI interface, otherwise, we're going
to start a web server."""
import sys
if sys.version_info < (3, 4):
@@ -35,6 +34,17 @@ if 'PGADMIN_SERVER_MODE' in os.environ:
else:
builtins.SERVER_MODE = None
if (3, 10) > sys.version_info > (3, 8) and os.name == 'posix':
# Fix eventlet issue with Python 3.9.
# Ref: https://github.com/eventlet/eventlet/issues/670
# This was causing issue in psycopg3
from eventlet import hubs
hubs.use_hub("poll")
# Ref: https://github.com/miguelgrinberg/python-socketio/issues/567
# Resolve BigAnimal API issue
import selectors
selectors.DefaultSelector = selectors.PollSelector
import config
import setup
from pgadmin import create_app, socketio