❖ ForeignToPrimaryKeySubset
Last updated
Last updated
Use the ForeignToPrimaryKeySubset CAG Pattern when you have a 1-to-many connection between tables, but only certain values are allowed to have connections.
Create a ForeignToPrimaryKeySubset
pattern object.
Parameters:
(required) parent_table_name
: A string with the name of the parent table in the relationship
(required) child_table_name
: A string with the name of the child table in the relationship
(required) child_foreign_key
: A string with the name of the foreign key column in the child. This column is only allowed to be connected to the parent table with certain values.
(required) conditional_column_name
: A string with the name of the conditional column in the parent table. The values in this column determine which connections are allowed.
(required) conditional_values
: A list of values of the conditional column. Only these particular values are allowed to have connections with the child table.
Make sure that all the tables and columns you provide are listed in your Metadata, as well as the relationship between the primary and foreign key.
Apply the pattern to any SDV synthesizer. Then fit and sample as usual.
❖ SDV Enterprise bundle. This feature is available for purchase as an SDV Enterprise bundle. For more information, visit our page to .