Switch Schemas Used During an App's Lifecycle

When you use your own DB schema, you can switch the schema that your app connects to during its lifecycle. For example, you might want to use a particular schema during the development phase, but switch to another one for testing or for production. You do this using application profiles.

Application profiles help to define combinations of servers and security settings for every environment that you want to deploy your visual app to. You define multiple profiles for an app, with each one containing a different configuration appropriate for the environment. For example, you can have a profile for testing that connects to a test environment, then associate it with the schema used to access testing data. Similarly, you can associate a production profile with a schema for live data.

If a profile isn't explicitly mapped to a particular schema, it will always use the default schema.

To associate a schema with a profile:

  1. Create the application profile you want to use with your schema.

    Visual Builder provides a ready-to-use application profile (Base configuration) that is used by default for development, stage, and production deployments. You can duplicate the default one to create another profile, then associate it with the schema you want to use. If you've already defined the profile you want to use, skip this step.

    1. From the visual application’s menu, click Settings, then click the Application Profiles tab.
    2. From the Base configuration's menu, click Duplicate, then provide a new name (for example, Prod configuration) and description in the Duplicate Application Profile dialog. Click Duplicate.
    3. From the newly created profile menu, select Make publish default to use this profile as the default when the app is published.
  2. Associate the profile with the schema to be used during a particular phase.

    Note:

    Make sure the schema you want to use is defined in the Tenant Settings of your Visual Builder instance. If it isn't listed, talk to your administrator to add it as an available schema for your instance.

    It's possible to map a profile to a schema in the Application Profiles page by selecting the profile you want to manage, then using the profile's Business Objects tab to associate a schema, as shown here:
    Description of byos-settings-app-profile-schema.png follows
    Description of the illustration byos-settings-app-profile-schema.png

    But the Business Objects tab on the Settings editor provides a more visual way to map schemas to profiles, as described here:

    1. Click Settings from the visual application’s menu (if necessary), then click the Business Objects tab.
    2. Under Schema Selection, with your schema already selected, click Add Schema next to Additional Schemas.
    3. Select an available schema (for example, HR), then from the Used in profiles list, select the profile you want to associate the schema with. You can add more than one profile if you want.
    4. Click Add.

      The schema (mapped to the profile) appears under Additional Schemas. If you want to update the profile, click Edit icon in the schema's row and make changes in the Used in profiles column. You can change the selected profile as well as add other profiles.
      Description of byos-settings-edit-addl-schema.png follows
      Description of the illustration byos-settings-edit-addl-schema.png

    Note:

    Details of the tables and views available for use in a schema are fetched once and cached. If the schema (or tables/views within it) was changed, click Reset Cache Schema icon to pick up the latest updates for a particular schema.