A few settings are available in the PowerServer project settings and also in the PowerServer solution to assist you to handle various connection scenarios. Specifically:
-
If as the app developer, you want to switch between different development, testing and even production environment for running the app.
Technique: If the different environment uses the same database type(s), configure multiple DB connection profiles in the PowerServer project settings, each profile for one environment. When you run the PowerServer Web APIs, you can select the actual connection profile with which the Web APIs will run. If the different environment uses different database type(s), configure multiple PowerServer projects, each project for one environment. You can then use different PowerServer projects for different environments.
-
If as the app developer, you want to assign different database access, to different app users.
Technique: Enabling the "Allow dynamic connection using the transaction LogID and LogPass" option in the cache settings. The LogID and LogPass may be unique to each app user. If you enable this option, the database connection will be set up according to the access permission associated with the LogID and LogPass.
-
If as the app distributor (or independent software vendor), you want to have the deployed app working in customer-specific database environment.
Technique: Configuring different cache groups (DBParm CacheGroup property)
You can define multiple database connection scenarios in the cache groups, by changing the PowerServer C# solution or dynamically calling the PowerServer APIs in PowerScript. Then, you can dynamically specify the CacheGroup value in DBParm, so that the deployed application will work in different database connection scenarios for different use cases.
-
If as the app administrator, you have updated the database environment and want to enable the Web APIs to work with the updated databases.
Technique: Directly updating the connection settings in the Applications.json file
The Applications.json file can be edited after the Web APIs have been compiled. If the changes are minor, you can directly update the Applications.json file as the temporary solution.