Look at the primary_key attribute of the table instance.

uu = Table('u',meta,
        Column('id',Integer,primary_key=True),
        Column('data',Integer))
print uu.primary_key.columns
['u.id']


Mike


On Tue, Apr 28, 2009 at 7:53 PM, Paul Rigor (gmail) <[email protected]>wrote:

> Hi gang,
> I've recently started using sqlalchemy, so hopefully this isn't a stupid
> question...
>
> I was wondering whether there was an easy way to obtain a particular
> table's schema if one is using just bare connection (ie, not using any
> special orm's).  Specifically, is there a utility method somewhere which
> allows one to obtain the primary key of a table?
>
> Thanks!!
> paul
>
> --
> Paul Rigor
> Graduate Student
> Institute for Genomics and Bioinformatics
> Donald Bren School of Information and Computer Sciences
> University of California in Irvine
> 248 ICS2 Bldg.
> +1 (760) 536 - 6767 (skype)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to