Add a hack to allow us to reset the URL that the code connects to
Add a hack to allow us to reset the URL that the code connects to

The database code has currently been optimized for a 1:1 mapping between the
server and the database, where the server needs to make multiple intensive
queries to the database, for example, to read trajectory information from the
database for multiple users at a time, for the post-processing.

This has led to design decisions in which we cache the database connection and
re-use it, to avoid overloading the server with multiple queries.

We are now getting some requests for federated data.

A concrete example is
https://github.com/e-mission/e-mission-eval-private-data/pull/28/commits/952c476dec745eb66477fed8d699f1bab85d84c0
where we wanted to compare the characteristics of multiple datasets
(https://github.com/e-mission/e-mission-eval-private-data/pull/28)

An upcoming example would be to "roll up" multiple dashboard deployments (e.g.
from individual cities) into a program level dashboard. We anticipate that
these will be low, volume, intermittent accesses to generate analyses and
metrics.

The long-term fix is probably to create a FederatedTimeseries (similar to the
AggregateTimeseries that merges data across users). But for now, we just
implement a hack to reset the connection and reconnect it to a different URL.
This means that we cannot access all databases in parallel, we will need to
access them serially. But for the current use case, that is sufficient since we
can concatenate all the data and work with it later.

e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server