SqlUserDefinedPatternCheck

This check scans SQL for the presence of specific patterns and warns the user when they are found.

Uses

Use the check to notify you when your custom specific patterns in the changelog are found. This quality check is an "open-ended" check which you can copy and customize for as many custom patterns, defined as simple strings or regex, as your naming, security, compliance, and other policies require. For example, if your polices require all tables to begin with tbl_ or indexes to end with _id, this check is easy copied and customized into two checks with those patterns. If you are handy with regex, the limit for pattern finding is greatly expanded. This quality check, like other checks, can be configured with a severity level which returns an exit code designed to stop automated jobs, giving your team time to investigate your user-defined patterns before they are deployed.

Run the SqlUserDefinedPatternCheck check

To run the SqlUserDefinedPatternCheck 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 SqlUserDefinedPatternCheck is enabled.

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

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

false

Default value: 0

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

SEARCH_STRING = null

MESSAGE = A match for regular expression <SEARCH_STRING> was detected in Changeset <CHANGESET>.

Strip_COMMENTS = true

This check scans SQL for the presence of specific patterns and warns the user when they are found.