mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-30 12:33:52 -06:00
e27e39a8f3
server connection. The BaseDriver and BaseConnection are two abstract classes, which allows us to replace the existing driver with the currently used. The current implementation supports to connect the PostgreSQL and Postgres Plus Advanced Server using the psycopg2 driver.
34 lines
1018 B
Python
34 lines
1018 B
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2015, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
"""A blueprint module providing utility functions for the application."""
|
|
|
|
import datetime
|
|
from flask import session, current_app
|
|
from pgadmin.utils import PgAdminModule
|
|
import pgadmin.utils.driver as driver
|
|
|
|
MODULE_NAME = 'misc'
|
|
|
|
# Initialise the module
|
|
blueprint = PgAdminModule(MODULE_NAME, __name__,
|
|
url_prefix='')
|
|
|
|
##########################################################################
|
|
# A special URL used to "ping" the server
|
|
##########################################################################
|
|
|
|
|
|
@blueprint.route("/ping", methods=('get', 'post'))
|
|
def ping():
|
|
"""Generate a "PING" response to indicate that the server is alive."""
|
|
driver.ping()
|
|
|
|
return "PING"
|