EntityInfoBuilder provides an interface for collecting information about multiple entities in bulk. SqlEntityInfoBuilder does so using database queries.
This functionality is used primarily to fetch the labels of all referenced entities that are to be shown on an Item page. If these entities are defined on different repositories, the EntityInfoBuilder needs to be able to collect and combine information from all of them - that is, we need a DispatchingEntityInfoBuilder that delegates to a set of "actual" EntityInfoBuilder instances. Code that currently constructs or requires an SqlEntityInfoBuilder should in the future construct or require a DispatchingEntityInfoBuilder.
To achieve this, SqlEntityInfoBuilderFactory needs to be wrapped in a DispatchingEntityInfoBuilderFactory, or become generic, relying on callback for performing the actual implementation. The code that constructs the DispatchingEntityInfoBuilderFactory needs access to information defiend in the foreignRepos client setting, probably best in the form of a RepoDefinitions object, similar to EntityTypeDefinitions and DataTypeDefinitions.