I'm wondering it wouldn't make sense to use a query builder / query object pattern as a part of this API. Currently, `self.session.query(User)` is duplicated in three places. SQLAlchemy queries already allow for this: Construct a base query `self.session.query(User)` somewhere, extend it with a WHERE clause using `query.filter_by(active=False)`, and use `query.all()` to actually fetch the rows from the DB.

This would obviously change the API in a way that it returns queries, not result sets any more, so the responsibility to actually execute the query would be delegated to the caller. But it would allow for easily constructing ad-hoc queries like `users.filter_by(some=property)` without having to account for that particular rare case in the API (or inefficiently fetching tons of actual rows and filtering down in Python).

Same goes for batching: If the API just returns queries, it's trivial to do a `users.limit(25)` in order to do pagination.