Is there way to get the database name the sql based historian provider uses in scripting?
I’m making a history migration tool.
Thanks.
Is there way to get the database name the sql based historian provider uses in scripting?
I’m making a history migration tool.
Thanks.
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‘.
Yes but this only returns the default database connection of the project not the database connection used by the storage provider?
The Core Historian (and internal historian) do not have a database connection. The SQL Historian's name is always the same name as the database connection.
This is true for Ignition 8.1 but as you can see in my screenshots from 8.3, the Historian name is “Postgres” but the database connection it is using (Data Source) is “Ignition”.
Ah, hadn't noticed that.
Some introspection may be needed.
Right now, you could use the REST API to read the config or reach into technically unsupported territory and use the underlying ConfigurationManager directly. In some future 8.3 version, hopefully 8.3.5, you'll be able to use system.config scripting to access configuration directly.