I would like to temporarily drop a foreign key constraint while loading
data and then revert the constraint's removal when done. I'm hoping to do
this without needing any specific knowledge of the constraints definition
at the time I re-create it. By that I mean something similar to this
On Friday, October 30, 2015 at 11:38:50 AM UTC-4, Michael Bayer wrote:
> you wouldn't typically want to specify contains_eager('bar') if the SQL
> has no JOIN in it, which you'd do with query.join().
There's no valid reason for using the `contains_eager` here -- it's just a
typo.
I
That clears it all up. I used __table_args__ and ForeignKeyConstrait.
Alembic handled it perfectly.
Thanks Mike for your help and for creating these libraries.
On Thu, Oct 29, 2015 at 8:34 PM, Mike Bayer
wrote:
>
>
> On 10/29/15 4:26 PM, Gastón Avila wrote:
> > Hi
I realize this is a very old question but it took me a little while to find
the 'proper way' and/or 'pythonic+sqlalchemy' way to do it so here is the
solution:
from sqlalchemy.sql.functions import GenericFunction
class XMLTypeFunc(GenericFunction):
type=CLOB
name='XMLType'
On 10/29/15 7:54 PM, Jonathan Vanasco wrote:
>
>
> The difference is between these 2 forms:
>
> [(f.id, f.bar_id) for f in
> session.query(Foo).options(joinedload('bar')).order_by(Foo.id.desc()).offset(0).limit(100).all()]
> [(f.id, f.bar_id) for f in
>