mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-01 21:09:10 -06:00
35 lines
770 B
Python
35 lines
770 B
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2023, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
from flask import current_app
|
|
|
|
from .registry import DriverRegistry
|
|
|
|
|
|
def get_driver(_type, app=None):
|
|
|
|
if app is not None:
|
|
DriverRegistry.load_modules(app)
|
|
|
|
return DriverRegistry.get(_type)
|
|
|
|
|
|
def init_app(app):
|
|
drivers = dict()
|
|
|
|
setattr(app, '_pgadmin_server_drivers', drivers)
|
|
DriverRegistry.load_modules(app)
|
|
|
|
return drivers
|
|
|
|
|
|
def ping():
|
|
for type in DriverRegistry._registry:
|
|
DriverRegistry._objects[type].gc_timeout()
|