[sqlalchemy] Re: Trouble eager loading with inheritance mapping

2018-01-07 Thread Theron Luhn
:03 PM UTC-8, Theron Luhn wrote: > > I'll be using the mappings laid out in > http://docs.sqlalchemy.org/en/latest/orm/inheritance.html for my examples. > > "Employee" is configured with "with_polymorphic": "*" > > So if I were to do a query li

[sqlalchemy] Trouble eager loading with inheritance mapping

2018-01-07 Thread Theron Luhn
I'll be using the mappings laid out in http://docs.sqlalchemy.org/en/latest/orm/inheritance.html for my examples. "Employee" is configured with "with_polymorphic": "*" So if I were to do a query like so: db.query(Company).filter(Company.id == 1).options(subqueryload('employee')) The eager

[sqlalchemy] Query counter [code review]

2017-03-21 Thread Theron Luhn
Hi! Because the SQLAlchemy ORM by default lazy-loads relationships, I've found that the greatest performance issues are caused by burgeoning query counts. In order to try and keep on top of this, I've decided to count and log the number of queries per request in my web application. I wrote

[sqlalchemy] Strategies for populating test database

2016-12-07 Thread Theron Luhn
I'm unit testing my database-driven application using the technique laid out here: http://alextechrants.blogspot.com/2013/08/unit-testing-sqlalchemy-apps.html One thing I've struggled with for years now is managing mock data. Some things I've tried: * Populating the database with