A particular column may be constrained by more than one foreign key constraint (although this is very uncommon), and a particular foreign key constraint may be "composite" in that it refers to multiple columns. All primary and foreign key constructs in SQLAlchemy are inherently composite. having APIs that refer to single-column keys, like "table.primary_key_column" and stuff like that, encourages applications to hardcode themselves to be non-composite, and there's really no point in doing so. If I'm writing a program that looks at primary and foreign key constraints in an abstract sense I would want it to assume composite in all cases.
On Thu, Dec 31, 2020, at 3:53 PM, Matthew Graham wrote: > Are you saying with the multiple foreign keys that for each key, multiple > columns can be used? I am aware that if you had table A and it had columns > B_id and C_id that B_id may be a fk to B and C_id may be a reign key to C, > but are you essentially saying there is an equivalence to a "composite" > foreign key so that you can have a foreign key on columns B_id1 and B_id2 in > A to refer to, only in conjunction, B? > Also thanks for referring me to inspector, I will give that a go > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/CAP-Gp5PoX7vvcfOUN2j3RS1LM8Cv300YmT7Ne3e1YzXc3J3Gkg%40mail.gmail.com > > <https://groups.google.com/d/msgid/sqlalchemy/CAP-Gp5PoX7vvcfOUN2j3RS1LM8Cv300YmT7Ne3e1YzXc3J3Gkg%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/12781196-61f2-4ac7-9df3-762982e5cac4%40www.fastmail.com.