Redgate Test Data Manager

Add custom classification rules

Contents


Adding Custom Classification Rules on the UI

Provision is made on the image preview side drawer to include custom classification rules as part of your image customization. In the Condition Text field add your preferred custom classification rule and hit save.


After you hit save, your custom dataset should look something like this:


Further detailed description on how to craft  basic custom classification rules is provided below. For more complex conditions see complex conditions 


Basic Conditions

A basic condition can be a statement about:

  • a column type
  • a column width
  • a column name
  • a table name
  • a schema name (only relevant to SQL Server or PostgreSQL)

NB In the following there are sometimes alternative keywords that achieve the same. None of the keywords are case sensitive.

Column Type

A column type condition can check whether a column contains a particular type of data. At the moment only two types are supported string (for any type of text column) and date (for any type of date column).

Examples:

Column.Type is string
Column.Type is date

Column Width

A column width condition checks whether a column's width is a particular size.

Examples:

Column.Width < 10
Column.Width = 12
Column.Width >= 6 (always true if column has no max width)

Schema/Table/Column Name

There are various conditions you can check that are related to the name of a schema/table/column.

All text must be in single quotes e.g. 'name'. Single quotes can be escaped with a backslash \ e.g. 'numéro d\'inscription au répertoire'

(not) equal text

Column.Name equals 'name'
Table.Name not equals 'company'

(not) contains text

Schema.Name contains 'customer'
Table.Name not contains 'product'

contains (all/any/none) of comma separated text

Column.Name contains all of 'membership', 'number' 
Column.Name contains any of 'num', 'number', 'no'
Column.Name contains none of 'code', 'type'

(not) starts with

Column.Name starts with 'ABC_' 
Column.Name not starts with 'Customer_' 

(not) ends with

Column.Name ends with '_ABC' 
Column.Name not ends with '_Name'

Complex Conditions

Basic conditions can be combined into more complex conditions by joining them together with AND and OR, and wrapping groups of conditions in brackets

Column.Type is string AND Column.Width > 7 AND ((Column.Name starts with 'Product_' AND Column.Name ends with '_Owner') OR (Column.Name starts with 'Produkt_' AND Column.Name ends with '_Inhaber'))

Recommendations

To avoid false positives :

  • include basic conditions to exclude common words e.g. Column.Name contains none of 'code', 'type'
  • include basic conditions to specify the data type of the column e.g. Column.Type is date
  • include basic conditions to specify the width of the column e.g. Column.Width => 7



Didn't find what you were looking for?