Exemplo n.º 1
0
 def query_count(session: Session, query: DbQuery) -> int:
     return session.execute(select(func.count(user_cls.id))).scalar()
Exemplo n.º 2
0
 def query_count(session: Session, query: Select) -> int:
     return session.execute(select(
         func.count()).select_from(user_cls)).scalar()
Exemplo n.º 3
0
 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()