When you set up a Database as a Historical Provider it becomes available to the designer, as a selection in the history section of the tag editor (as you know).
If you want to look up history for a tag path on a different provider than what is set in the tag editor, then you will need to manually construct the Historical tag path with the correct Historical Provider.
Here is a little script I adapted that shows how to do it (aside from manual concatenation).
def getHistoricalTagPath(path):
from com.inductiveautomation.ignition.common import QualifiedPath, WellKnownPathTypes,QualifiedPathUtils
from com.inductiveautomation.ignition.common.tags.paths.parser import TagPathParser
qPath = QualifiedPathUtils.fromTagPathNew(TagPathParser.parseSafe('default',path))
gateway = system.tag.readBlocking('[System]Gateway/SystemName'])
driver = ':'.join([gateway.value,qPath.getPathComponent('prov')])
return QualifiedPath.Builder().set(WellKnownPathTypes.HistoryProvider,'YourHistoryProvider').setDriver(driver).setTag(qPath.getPathComponent('tag')).build().toString()
You can find the original script and conversation here: