Top  | Previous | Next

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 - When True, enables the datasource; disables the datasource when False.

Returns

nothing

Scope

All

Examples

Example 1: Enable a connection

 

system.db.setDatasourceEnabled("MySQL", True)

 

Example 2: Disable a connection

 

system.db.setDatasourceEnabled("MySQL", False)