Skip to content

CandidateKey

Helper class for defining candidate keys of tables. A candidate key is a column in a table that can uniquely identify each record, ensuring that no two rows have the same key value. A table can have more than one candidate key columns.

NameTypeDescriptionOptional
column_namestrName of the candidate key column.No
is_featurestrIndicates whether the candidate key is to be considered a Graph Neural Network (GNN) feature. Default is False.Yes.

An instance of the CandidateKey class.

from relationalai_gnns import GNNTable, CandidateKey
candidate_key = CandidateKey(column_name="studentId")
students_table = GNNTable(
connector=connector,
name="Students",
source="SYNTH_DB.SYNTH_SCHEMA.STUDENTS",
candidate_keys=[candidate_key]
)