❖ PrimaryToPrimaryKey
Use the PrimaryToPrimaryKey constraint when you have an exact 1-to-1 connection between the primary keys of two or more tables.
This constraint is deprecated. Instead of supplying a PrimaryToPrimaryKey constraint, connect primary keys in your metadata via a parent/child relationship. For more information, see the Metadata API.
"tables": {
"Users": {
"primary_key": "ID",
...
},
"Supplemental Info": {
"primary_key": "ID",
...
}
},
"relationships": [{
"parent_table_name": "Users",
"child_table_name": "Supplemental Info",
"parent_primary_key": "ID",
"child_foreign_key": "ID"
}]
Constraint API
Create a PrimaryToPrimaryKey constraint
Parameters:
(required)
table_names: A list of strings, representing the table names whose primary keys are all connected. You must provide two or more table names.
Make sure that all the tables in you provide are in your Metadata, and have a primary key associated with them.
Usage
Apply the constraint to any SDV synthesizer. Then fit and sample as usual.
For more information about using predefined constraints, please see the Constraint-Augmented Generation tutorial.
Last updated