Deployment modes override and rename to override with another type?

@paul-griffith I don't know if it's an intended behaviour.

I've created 3 modes DB_MYSQL, DB_POSTGRES, DB_SQLSERVER

Initially I had 3 connections for various database flavour:

  • bdref (mysql)
  • bdref_postgres (postgres)
  • bdref_sqlserver (sqlserver)

Initially I think it was not possible to override a connection and change the driver type...
But, if I create an override on bdref_postgres and I rename it "bdref" it seems to be ok ?
But is it supported ?

@Kevin.Herron as for database connection, can we have a device depending from the deployment mode ? device A in one mode is modbus but device A in another mode is Simulator ? (not a modbus with another settings)

1 Like

seems to be supported according the docs:

Deployment modes can change anything (though it's not necessarily recommended).

If it helps, think of it as a single project inheritance tree. If you're in the dev mode, you're consuming external -> system -> core, then whatever dev defines, and then potentially overridden by anything local:

Tree External External System System External->System Core Core System->Core Dev Dev Core->Dev Test Test Core->Test Prod Prod Core->Prod Local Local Dev->Local Actual Loaded Config Local->Actual

Then if you switch to test you're using a totally different set of resources:

Tree External External System System External->System Core Core System->Core Dev Dev Core->Dev Test Test Core->Test Prod Prod Core->Prod Local Local Test->Local Actual Loaded Config Local->Actual

And if you started your gateway without a deployment mode, all your modes are ignored:

Tree External External System System External->System Core Core System->Core Dev Dev Core->Dev Test Test Core->Test Prod Prod Core->Prod Local Local Core->Local Actual Loaded Config Local->Actual
1 Like

Technically supported yes, but not by the UI, which has never supported the idea of changing the "type" of some instance of an extension point once configured (driver type, JDBC driver type, OPC connection, etc...), even before deployment modes existed.

In fact, from the gateway UI, I can obtain different JDBC driver types for each deloyement mode of one named connection.

I create one connection "bdref" with Mysql driver.
I create another connection "bdref_postgres" with postgres driver.
I create an override for the "bdref_postgres" connection with a deployement mode set to DB_POSTGRES
I rename the overrided "bdref_postgres" to "bdref" and then this override is displayed under the "bdref" connection.

As a consequence: the connection "bdref" has a connection of another driver type.
I was looking to obtain this result frm the gateway UI but I don't known if it's "allowed" from an override point of view.

It seems that for a same ressource name, a different type of ressource is allowed in different deployement mode ?

That's perfect for my need ! But I wonder if I can use this pattern of deployement for db connections, driver or user source ?

C:\Program Files\Inductive Automation\Ignition\data\config\resources\core\ignition\database-connection\bdref

{
  "connectURL": "jdbc:mysql://127.0.0.1:3306/bdref",
  "connectionProps": "zeroDateTimeBehavior\u003dconvertToNull;connectTimeout\u003d120000;socketTimeout\u003d120000;",
  "connectionResetParams": "",
  "defaultTransactionLevel": "DEFAULT",
  "driver": "MySQL ConnectorJ",
...
}

C:\Program Files\Inductive Automation\Ignition\data\config\resources\DB_POSTGRES\ignition\database-connection\bdref

{
  "connectURL": "jdbc:postgresql://localhost:5432/bdref",
  "connectionProps": null,
  "connectionResetParams": "",
  "defaultTransactionLevel": "DEFAULT",
  "driver": "PostgreSQL JDBC Driver",
...
}

hey @mazeyrat , did you end up testing this configuration? This is exactly what I’m looking for as well. I want an IdP to be of different types in dev and prod, so I can just change the deployment mode while using the same IdP.

For what it’s worth, I interpreted @Kevin.Herron ‘s message as Ignition would support this behaviour. The reason you can’t change the type isn’t related to deployment modes (it was never allowed on an existing config), and since you renamed the overridden "bdref_postgres" to “bdref“, that “bdref“ will be used if you select DB_POSTGRES deployment mode, instead of the core resource, since you have that resource now defined in DB_POSTGRES mode. Being a different “type” should not stop Ignition from using that resource.

I haven’t tested this, though, so if you have carried out some real-world tests already, please let us know.

I only tested this approach to change the driver type of a db connection accoding to the deployment mode and it works.

1 Like