Thanks for the detailed response. I do keep track of these conversions in a dictionary, but some of my constraints are made before the column keys are set, which probably sounds entirely backwards. I'll figure something out though -- at worst I can always parse the string. My use case is far from standard. I'm developing an API that programmatically generates models and relational operations between those models according to a template.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Mon, Oct 2, 2017 at 6:27 AM, Mike Bayer <[email protected]> wrote: > link_to_name is on foreign keys because of the "remoteness" of the > other table, and this flag was added specifically for the reflection > feature, which makes use of link_to_name internally to line up foreign > key columns to an existing table that might be using a key separate > from name for a column. > > For a UniqueConstraint or Index, those are made with immediate > knowledge of the Table in question and within the Table reflection > routine there is a dictionary of col names to columns passed around > for this operation so that any user-defined keys don't get in the way > of linking up these constraints to the table. > > So while you could make yourself a dictionary of column name->column > and use that, that's all the reflection process does internally in any > case, there's no option that does this automatically outside the > reflection process itself. > > Background on what it is you're trying to do would make it more clear > if additional features should be added. > > > On Sat, Sep 30, 2017 at 6:43 PM, Zac Goldstein <[email protected]> wrote: > > Is it possible to use column names instead of keys when creating table > > constraints? I know ForeignKeyConstraint/ForeignKey have a link_to_name > > parameter which I've been able to use, but I haven't found a similar > option > > for other constraints. > > > > -- > > 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 [email protected]. > > To post to this group, send email to [email protected]. > > Visit this group at https://groups.google.com/group/sqlalchemy. > > For more options, visit https://groups.google.com/d/optout. > > -- > 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 a topic in the > Google Groups "sqlalchemy" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/sqlalchemy/56CRbwOgK_0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
