示例#1
0
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)
示例#2
0
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
示例#3
0
def conn(requireMocking):
    c = database.connect()
    return c