mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support for the infrastructure for on demand access/create the
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.
This commit is contained in:
@@ -8,9 +8,13 @@
|
||||
##########################################################################
|
||||
|
||||
"""A blueprint module providing utility functions for the application."""
|
||||
MODULE_NAME = 'misc'
|
||||
|
||||
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__,
|
||||
@@ -19,7 +23,11 @@ blueprint = PgAdminModule(MODULE_NAME, __name__,
|
||||
##########################################################################
|
||||
# A special URL used to "ping" the server
|
||||
##########################################################################
|
||||
@blueprint.route("/ping")
|
||||
|
||||
|
||||
@blueprint.route("/ping", methods=('get', 'post'))
|
||||
def ping():
|
||||
"""Generate a "PING" response to indicate that the server is alive."""
|
||||
driver.ping()
|
||||
|
||||
return "PING"
|
||||
|
||||
Reference in New Issue
Block a user