Beispiel #1
0
def main():
    try:
        conn = database_connection.get_connection()
        result = select_example1_by_id(conn, 11)
        print(result)
    finally:
        conn.close()
Beispiel #2
0
 def setUpClass(cls):
     cls.conn = database_connection.get_connection()
     # データ初期化
     csv_to_db.load(
         cls.conn,
         example1=
         'tests/data/test_example1/example1_test_select_example1_by_id.csv')
     cls.conn.commit()
Beispiel #3
0
 def wrapper(*args, **kwargs):
     try:
         conn = database_connection.get_connection()
         conn.begin()
         load(conn, truncate=truncate, **targets)
         conn.commit()
     except Exception as e:
         conn.rollback()
         raise e
     finally:
         conn.close()
     return func(*args, **kwargs)
Beispiel #4
0
def main():
    conn = database_connection.get_connection()
    conn.begin()
    try:
        init_db(conn, csv_dir="tests/data")
        conn.commit()
    except Exception as e:
        logger.error(e)
        conn.rollback()
        sys.exit(1)
    finally:
        conn.close()
    sys.exit(0)
Beispiel #5
0
 def setUpClass(cls):
     cls.conn = database_connection.get_connection()