GNNTable.unset_foreign_key()
Unset an existing column as a foreign key in the GNN table. This will remove the column from its role as foreign key.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
foreign_key | ForeignKey | The foreign key definition to unset. | No |
Returns
Section titled “Returns”Raises ValueError if the referenced column does not exist in the GNN table or KeyError if the foreign key is not part of the declared foreign keys.
Example
Section titled “Example”from relationalai_gnns import GNNTable, ForeignKey
table_with_foreign_keys = GNNTable( connector=connector, name="TableWithFKeys", source="DATABASE.SCHEMA.TABLE_WITH_FKEYS", type="node", foreign_keys=[ForeignKey(column_name="Id1", link_to="TableWithCKey1.Id1"), ForeignKey(column_name="Id2", link_to="TableWithCKey2.Id2")])
table_with_foreign_keys.unset_foreign_key(ForeignKey(column_name="Id1", link_to="TableWithCKey1.Id1"))