WarnOnUseDatabase

This check warns a user when generated or raw SQL contains 'USE DATABASE' directive.

Uses

Use the check to warn when changeset's generated or raw SQL contain 'USE DATABASE' directive. Unintended or unauthorized database use can lead to security and compliance issues, especially in regulated industries. This quality check alerts users so they can exercise more control over database use privileges and permission changes, which is especially important in automated data pipelines, before these changes are deployed to your production environments.

Run the WarnOnUseDatabase check

The WarnOnUseDatabase check is enabled by default, so you will not need to turn it on if you have not changed your settings previously. To run the WarnOnUseDatabase check, ensure you have a Liquibase Pro license key and the checks-scope property includes changelog. The checks-scope parameter is set in the default properties file, environment variable, or any standard method. Then, check the changelog to see if WarnOnUseDatabase is enabled.

Enable the WarnOnUseDatabase check by running the following command in the CLI:

liquibase checks enable --check-name=WarnOnUseDatabase
Short Name Scope Enabled Severity Customization Description
WarnOnUseDatabase changelog

true

Default value: 0

  • 'INFO' | 0
  • 'MINOR' | 1
  • 'MAJOR' | 2
  • 'CRITICAL' | 3
  • 'BLOCKER' | 4

<none>

This check warns a user when generated or raw SQL contains 'USE DATABASE' directive.