You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user, it would be useful to be able to programmatically set primary keys, sequence keys, sequences indices and alternate keys for specific table in myMultiTableMetadata.
Expected behavior
Add set_primary_key(table_name, id) method
Under the hood should call SingleTableMetadata.set_primary_key for the right table
Parameters:
table_name: string that is the name of the table to add the primary key for
id: string of column name that is going to be the primary key, or tuple string column names
Warnings:
If there is already a key raise this warnings Warning: There is an existing primary key 'user_id'. This key will be removed.
Errors:
Same errors as in the single table case
If the table doesn't exist raise the following error Error: Unknown table name ('userss')
Problem Description
As a user, it would be useful to be able to programmatically set primary keys, sequence keys, sequences indices and alternate keys for specific table in my
MultiTableMetadata
.Expected behavior
set_primary_key(table_name, id)
methodSingleTableMetadata.set_primary_key
for the right tabletable_name
: string that is the name of the table to add the primary key forid
: string of column name that is going to be the primary key, or tuple string column namesWarning: There is an existing primary key 'user_id'. This key will be removed.
Error: Unknown table name ('userss')
set_sequence_key(table_name, id)
methodtable_name
: string that is the name of the tableid
: string of column name that is going to be the sequence keySingleTableMetadata.set_sequence_key
for the right tableWarning: Sequential modeling is not yet supported on SDV Multi Table models.
set_sequence_index(table_name, column_name)
methodtable_name
: string that is the name of the tablecolumn_name
: string of column name that is going to be the sequence indexSingleTableMetadata.set_sequence_index
for the right tableWarning: Sequential modeling is not yet supported on SDV Multi Table models.
add_alternate_keys(table_name, ids)
methodtable_name
: string that is the name of the tableids
: A list of strings or tuples of string that represent column namesSingleTableMetadata.add_alternate_keys
for the right tableAdditional context
validate
method in Add validate method to SingleTableMetadata #879 .The text was updated successfully, but these errors were encountered: