Generators that are applied to primary key columns are different from other generators in the following ways:
The generated data must be unique in order to not break constraints
The generators are consistent (same input → same output), so that when this generator is applied to a primary key column and its linked foreign key columns, no links are broken.
This is accomplished using format preserving encryption.
For more information on this, and details on how to provide your own encryption key, contact support@tonic.ai.
You apply a primary key generator in the same way as you do any other generator.
Tonic Structural then automatically applies the same generator to all foreign key columns that reference the primary key.
Foreign keys are either defined by the source schema or added from the Foreign Key Relationships page. For more information, go to Viewing and adding foreign keys.
Structural currently supports the following generators for primary key columns:
ASCII Key The ASCII Key generator does not preserve the format of the input value. It uses the ASCII alphabet for input and the alphanumeric alphabet for output. This leads to output values that are longer than the input values.
If you need support for additional types, contact support@tonic.ai.
Primary key generators are not supported in the Scale table mode. The process requires control over the key columns to make sure that all of the relationships are maintained.
You also cannot assign a primary key generator on a table that is related to a Scale mode table through a foreign key.
Most Tonic Structural generators consume source data and perform an operation on it to produce destination data.
For example, the Character Scramble generator takes the original data from the source database, replaces the letters and numbers with random letters and numbers, and then writes the result to the destination database.
Composite generators do not generate data directly. Instead, they apply other generators, referred to as sub-generators, to specific sub-values within the column or based on conditions.
Structural provides the following composite generators:
Most composite generators treat the input as structured data that the generator parses using a domain-specific syntax, such as:
XPath for XML or HTML
JSONPath for JSON or a Spark StructType
Regular expressions for text
These generators allow you to select a sub-value of the input, and then configure a specific generator to apply to only that sub-value. This means that you can take your original structured data and selectively mask the content.
For example, for the following structured content:
{ name: { first: "Tj", last: "Bass" } }
You indicate to use the Name generator to replace the value of last
. The result is something like:
{ name: { first: "Tj", last: "Pine" } }
The Conditional generator is slightly different. It allows you to apply a specific generator when the column value matches a specific condition. For example, you can indicate to apply a Character Scramble generator only if the column value is something other than "test".
You cannot configure generator presets for composite generators from the Generator Presets view. The Generator Presets view does not have access to data to use for path expressions or conditions.
From a column configuration panel, you can save the current configuration as the new baseline configuration, and reset the configuration to the current baseline.
For any composite generator, when you select the generator to apply to a selected sub-value or based on a specified condition, you cannot select another composite generator.
For example, you cannot apply a Conditional or XML Mask generator to the value of a specified path expression.
For composite generators other than the Conditional or Regex Mask generators, you cannot configure a sub-generator to be consistent with another column.
Composite generators
Composite generators apply a generator to a specific data element or based on a condition.
Primary key generators
Learn about generators that you can apply to primary key columns.