'Create a database fixture.
:param database: The type of database, \'main\' or \'api\'
:param connection: The connection string to use'

def __init__(self, database='main', connection=None):

    super(Database, self).__init__()
    global SESSION_CONFIGURED
    if (not SESSION_CONFIGURED):
        session.configure(CONF)
        SESSION_CONFIGURED = True
    self.database = database
    if (database == 'main'):
        if (connection is not None):
            ctxt_mgr = session.create_context_manager(connection=connection)
            facade = ctxt_mgr.get_legacy_facade()
            self.get_engine = facade.get_engine
        else:
            self.get_engine = session.get_engine
    elif (database == 'api'):
        self.get_engine = session.get_api_engine
