[sqlalchemy] Apparently redundant subqueryloads with single table inheritance

2012-06-05 Thread Kent
I am subquery loading some related properties for a polymorphic inheritance use case similar to the script attached. SQLA seems to be issuing several extra queries that I didn't expect and don't think it needs. In the attached example, I expected a total of 4 queries issued for the

Re: [sqlalchemy] Apparently redundant subqueryloads with single table inheritance

2012-06-05 Thread Michael Bayer
On Jun 5, 2012, at 4:21 PM, Kent wrote: I am subquery loading some related properties for a polymorphic inheritance use case similar to the script attached. SQLA seems to be issuing several extra queries that I didn't expect and don't think it needs. In the attached example, I expected

Re: [sqlalchemy] Apparently redundant subqueryloads with single table inheritance

2012-06-05 Thread Kent Bower
Thank you! On 6/5/2012 4:41 PM, Michael Bayer wrote: On Jun 5, 2012, at 4:21 PM, Kent wrote: I am subquery loading some related properties for a polymorphic inheritance use case similar to the script attached. SQLA seems to be issuing several extra queries that I didn't expect and don't

[sqlalchemy] Support for hierarchyid of SQL Server 2008?

2012-06-05 Thread RainG
Hi, I noticed that currently hierarchyid( http://msdn.microsoft.com/en-us/library/bb677290.aspx) of SQL Server 2008 and up is not being supported. Although this type seems kind of out of the place of the general framework of SQLAlchemy, it nevertheless seems to be one potentially efficient

Re: [sqlalchemy] Support for hierarchyid of SQL Server 2008?

2012-06-05 Thread Michael Bayer
This is just a datatype so follow the instructions at http://docs.sqlalchemy.org/en/rel_0_7/core/types.html#creating-new-types to implement your own version of this type.The trick of course is that the DBAPI supports it as well, i.e. pyodbc or pymssql. If not, you may have to petition

[sqlalchemy] CircularDependencyError with relationships

2012-06-05 Thread Alex Grönholm
I have trouble configuring two relationships from one class to another. The following code should be fairly self-explanatory: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Company(Base):