def query_count(session: Session, query: DbQuery) -> int: return session.execute(select(func.count(user_cls.id))).scalar()
def query_count(session: Session, query: Select) -> int: return session.execute(select( func.count()).select_from(user_cls)).scalar()
def count_user_notes(user_id: int, session: Session = Depends()) -> int: return session.execute( select(func.count( note_cls.id)).where(note_cls.user_id == user_id)).scalar()