Re: [sqlalchemy] Tips for schema based db traversal and building

2015-09-30 Thread Steve Murphy
See below On Tuesday, September 8, 2015 at 9:00:12 PM UTC-4, Michael Bayer wrote: > > > > you can get these like this: > > from sqlalchemy import inspect > insp = inspect(my_engine) > > fk_constraints = insp.get_foreign_keys('mytable') > uq_constraints = insp.get_unique_constraints('mytable') >

Re: [sqlalchemy] Tips for schema based db traversal and building

2015-09-30 Thread Jonathan Vanasco
On Tuesday, September 8, 2015 at 9:00:12 PM UTC-4, Michael Bayer wrote: > > q = select([tab.c[name] for name in ["id", "name", "address"]]) > adding... If you want to load particular columns off a relationship, you even do that using the `load_only` method. -- You received this message

Re: [sqlalchemy] Tips for schema based db traversal and building

2015-09-30 Thread Steve Murphy
On Wednesday, September 30, 2015 at 1:43:46 PM UTC-6, Michael Bayer wrote: > > there's no known bugs in fetching unique constraints. PG 8.4 is a pretty > old version but should be working. > > note that a unique index and a unique constraint aren't listed as the same > thing, however.you

Re: [sqlalchemy] Tips for schema based db traversal and building

2015-09-09 Thread Steve Murphy
Oh, Michael! You have made my day. It just gets better and better! I don't know how I missed these items, but your examples are very helpful. Many thanks! On Tuesday, September 8, 2015 at 7:00:12 PM UTC-6, Michael Bayer wrote: > > > > On 9/8/15 12:57 PM, Steve Murphy wrote: > > > A bit

Re: [sqlalchemy] Tips for schema based db traversal and building

2015-09-08 Thread Mike Bayer
On 9/8/15 12:57 PM, Steve Murphy wrote: A bit difficult is grabbing just certain columns in the select, given that we have only a list of column names. That would be real nice if such a method were available in the core API. For example, a method for select whereby I could supply a simple

[sqlalchemy] Tips for schema based db traversal and building

2015-09-08 Thread Steve Murphy
This message concerns using sqlAlchemy for schema based traversal and manipulation. It is the result of a project to transfer data from on database to another, where objects refer to each other, and must be copied to new rows in the target db, and have all the foreign references updated in