system.db.setDatasourceEnabled

Description

Enables/disables a given database connection.

Syntax

system.db. setDatasourceEnabled( name, enabled )

  • Parameters

String name - The name of the database connection in Ignition.

Boolean enabled

  • Returns

nothing

  • Scope

All

Code Examples
Code Snippet
#Example 1: Enable a connection
system.db.setDatasourceEnabled("MySQL", 1)
Code Snippet
#Example 2: Disable a connection
system.db.setDatasourceEnabled("MySQL", 0)