Пример #1
0
def get_components():
    if not hasattr(get_components, "components"):
        cur = connection.get_cursor()
        cur.execute("""SELECT name FROM COMPONENTS""")
        rows = cur.fetchall()
        get_components.components = set([row[0] for row in rows])
    return get_components.components
Пример #2
0
 def crash_and_burn(self, queries):
     answers = []
     cur = connection.get_cursor()
     for query in queries:
         try:
             cur.execute(query)
             result = cur.fetchall()
             df = DataFrame(result)
             answers.append(df[0].tolist())
         except (Exception):
             pass
     cur.close()
     return answers