Primary key generators

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 [email protected]envelope.

How generators on primary keys are applied

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.

Supported generators for primary key columns

Structural currently supports the following generators for primary key columns:

If you need support for additional types, contact [email protected]envelope.

In addition to the key-specific generators, you can also assign the Character Substitution generator to a primary key column.

You can also assign the Regex Mask and Conditional generators to primary key columns. However:

  • Make sure that the configuration preserves the uniqueness of your primary key values.

  • Do not use these generators on primary key columns that are used for subsetting.

Last updated

Was this helpful?