Get database name of sql based historical provider

Is there way to get the database name the sql based historian provider uses in scripting?

I’m making a history migration tool.

Thanks.

Are you aware of the System Tags Folder?

Scripting:

I might have not been as clear,

I want to get the datasource( database connection) linked to the Storage Provider (Historian)

So in this example the Storage provider is “Postgres” which is connected to database connection called ‘Ignition‘.