I have a Declarative-instrumented class with several constraints, some 
defined at the table level and some on a column. AFAICT, all the 
constraints are configured correctly because they are rendered correctly by 
CreateTable() when called with the class's Table instance. In order to 
import some data into my carefully designed model, I need to drop some 
constraints, then recreate them NOT VALID. I want to use the existing Table 
instance to execute SQL rather than typing duplicate SQL manually. However, 
I'm having trouble introspecting the Table instance to find a specific 
CheckConstraint defined on a specific column. The Table instance's 
"constraints" property does not contain the constraint I need. I can find a 
CheckConstraint instance in the column's "constraints" property but it's 
not bound to a Table so I can't just pass it to DropConstraint(). What is 
the proper way to get a CheckConstraint instance defined on a column that I 
can pass to DropConstraint() and AddConstraint()?

-- 
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 post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to