This API was added in Profound.js 5.0.0
This API returns a database connection definition object that can be passed to some SQL and Data APIs to specify the desired database connection.
- Database connection name (String/optional). A name corresponding to an entry in the databaseConnections configuration option.
If this parameter is omitted, then the default database connection definition is returned. In Profound.js Spaces, the default database connection is normally the workspace's built-in MariaDB database. However, if the Profound.js Spaces workspace is called from IBM i using the NODERUN command, the default database connection is overridden to work with the calling IBM i database. In this case the workspace's built-in MariaDB database can be accessed by passing connection name "workspace".
A database connection definition object that can be passed to the following APIs:
The return value is passed to the above APIs as the first parameter, followed by the other parameters as documented for each API.
The database connection definition object also has a property called 'connection' which has a reference to the corresponding entry from the databaseConnections configuration option.
An exception is is thrown if the database connection name is not valid.