Re: [sqlalchemy] Baked Query with Bound Entity/FromClause

2021-03-31 Thread Scott Colby
Hi Mike, On Wednesday, March 31, 2021 at 1:36:33 PM UTC-4 Mike Bayer wrote: > so this is not what bound parameters are used for in SQL; bound parameters > are a specific construct in the DBAPI driver that only applies to literal > parameters in a statement, that is, strings, numbers and other

Re: [sqlalchemy] Baked Query with Bound Entity/FromClause

2021-03-31 Thread Mike Bayer
On Wed, Mar 31, 2021, at 12:37 PM, Scott Colby wrote: > Hello, > > I have a bunch of tables with created_at columns and I would like to bake > queries to retrieve counts of rows from them. > > def _entities_created(model: Model, before: datetime) -> int: > baked_query = BAKERY(lambda

[sqlalchemy] Baked Query with Bound Entity/FromClause

2021-03-31 Thread Scott Colby
Hello, I have a bunch of tables with created_at columns and I would like to bake queries to retrieve counts of rows from them. def _entities_created(model: Model, before: datetime) -> int: baked_query = BAKERY(lambda session: session.query(model)) baked_query += lambda q: