mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-08 15:13:10 -06:00
28 lines
745 B
Python
28 lines
745 B
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
from sqlalchemy import create_engine, inspect
|
|
|
|
|
|
def check_external_config_db(database_uri):
|
|
"""
|
|
Check if external config database exists if it
|
|
is being used.
|
|
"""
|
|
engine = create_engine(database_uri)
|
|
try:
|
|
connection = engine.connect()
|
|
if inspect(engine).has_table("server"):
|
|
return True
|
|
return False
|
|
except Exception:
|
|
return False
|
|
finally:
|
|
connection.close()
|