コード例 #1
0
def rebuild_db():
    try:
        connection = connect_db()
        msg = DbContext.rebuild_database(connection, app.open_resource)
    except Exception as e:
        msg = 'Rebuilding the database an exception took place: %s' % str(e)
    return msg
コード例 #2
0
def connect_db():
    database_path = os.path.join(APP_ROOT, 'database/' + app.config['DATABASE'])
    return DbContext.get_connection(database_path)
コード例 #3
0
 def get_db_connection(cls):
     db_path = DatabaseUtils._get_database_test_path()
     return DbContext.get_connection(db_path)
コード例 #4
0
 def get_db_connection_in_memory(cls):
     return DbContext.get_connection(':memory:')
コード例 #5
0
 def recreate_database(cls, connection):
     return DbContext.rebuild_database(connection, cls._open_schema_file)