Re: [sqlalchemy] explain analyze on statement

2019-01-21 Thread Mike Bayer
On Mon, Jan 21, 2019 at 12:23 PM Zsolt Ero wrote: > > Thanks it works perfectly, even with datetimes! > > Can I do something similar to make > > stmt.compile(dialect=postgresql.dialect(), > compile_kwargs={"literal_binds": True}) > > compatible with datetime? Or maybe not this, but I'm looking

Re: [sqlalchemy] explain analyze on statement

2019-01-21 Thread Zsolt Ero
Thanks it works perfectly, even with datetimes! Can I do something similar to make stmt.compile(dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True}) compatible with datetime? Or maybe not this, but I'm looking for a way to print a statement which I could copy and paste into

Re: [sqlalchemy] Eager load extra columns in many to many relationships

2019-01-21 Thread Mike Bayer
On Mon, Jan 21, 2019 at 10:17 AM Harshvardhan Gupta wrote: > > Hi, thanks for the reply. > > From what I understand , your example shows me filtering through a many to > many relationship. However I was looking for explicitly also loading the > extra field in the pivot table. > In your example,

Re: [sqlalchemy] Eager load extra columns in many to many relationships

2019-01-21 Thread Harshvardhan Gupta
Hi, thanks for the reply. >From what I understand , your example shows me filtering through a many to many relationship. However I was looking for explicitly also loading the extra field in the pivot table. In your example, will CorporateApplications.foo also be loaded in the result ? On

Re: [sqlalchemy] Eager load extra columns in many to many relationships

2019-01-21 Thread Mike Bayer
On Sun, Jan 20, 2019 at 7:50 AM Harshvardhan Gupta wrote: > > I have two tables, Corporates and Users , each corporate can be reviewing > multiple users, and each user can apply to multiple corporates. > > My models are defined as: > > class Corporate(Dictifiable, db.Model): > > > >