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 support@tonic.ai.

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.

Limitations

Supported generators for primary key columns

Structural currently supports the following generators for primary key columns:

If you need support for additional types, contact support@tonic.ai.

Exception for Scale table mode

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.

Last updated