def alive(event, context): """ tells us if the db server is alive """ try: connect(True) return success() except Exception as e: return server_error(e, status_code=http.HTTPStatus.SERVICE_UNAVAILABLE)
import http import sys import urllib.parse import simplejson as json from loguru import logger from cis import database, headers from cis.database import connect conn = database.connect() # initialize the loguru logger logger.add(sys.stdout, format="{time} {level} {message}", filter="compounds", level="INFO", backtrace=True, diagnose=True) TARGET_TYPE = ['confirmed', 'unconfirmed', 'istd'] MAX_QUERY_LIMIT = 150 column_dict = { 'tgt_id': { 'name': 'id', 'idx': 1 }, 'name': { 'name': 'name', 'idx': 2
def conn(requireMocking): c = database.connect() return c