def METHOD_NAME(config):
    """
    Initialize the database.
    This creates a database engine from the provided configuration and
    configures the scoped session to use the engine.
    Args:
        config (dict): A dictionary that contains the configuration necessary
            to initialize the database.
    Returns:
        sqlalchemy.engine: The database engine created from the configuration.
    """
    #: The SQLAlchemy database engine. This is constructed using the value of
    #: ``DB_URL`` in :mod:`anitya.config``.
    engine = create_engine(config["DB_URL"], echo=config.get("SQL_DEBUG", False))
    # Source: https://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#foreign-key-support
    if config["DB_URL"].startswith("sqlite:"):
        event.listen(
            engine,
            "connect",
            lambda db_con, con_record: db_con.execute("PRAGMA foreign_keys=ON"),
        )
    Session.configure(bind=engine)
    return engine