On Mar 12, 2013, at 6:32 AM, Felix Schwarz <felix.schw...@oss.schwarz.eu> wrote:

> 
> 
> Am 11.03.2013 17:27, schrieb Michael Bayer:
>> OK well that table has no primary key established.
> 
> I see. So even if MySQL tells me (in 'show fields') that a column is a primary
> key, SQLAlchemy won't recognize it unless the column is explicitely marked as
> primary key (as opposed to a unique key).
> 
> Makes sense, still a pitty that my DB schema is so broken (it's an old
> MediaWiki dump).


a unique key is not the same thing as a primary key, and MySQL reflection uses 
the SHOW CREATE TABLE output to reflect, as we can't get all the information we 
need in any other way for that platform (one of the many ways MySQL is unlike 
any other backend).

I suppose the reflection could have some feature where you flag it as, "single 
unique key w/no primary key means that's the primary key", but we've not had 
requests for this feature before.

We will at some point be adding a feature whereby one can intercept the event 
where we reflect the primary key; we have this event for individual columns 
now.  When that event is present, you'll be able to flip on the "primary key" 
flag for unique column sets as needed.


-- 
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 post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to