def sqla_13_all_users(session: Session = Depends(), paginate: Paginate = Depends()): query = (session.query(user_cls).options(joinedload("notes")).order_by( user_cls.id)) return paginate(query)
def query_count(session: Session, query: DbQuery) -> int: return (session.query(user_cls).statement.with_only_columns( [func.count()]).scalar())