FastAPI sqlalchemy DB 쿼리 생성법
1. execute, scalars, scalar 차이session.execute(stmt)쿼리 실행 → Result 객체 반환Result 객체session.execute(stmt).all()전체 결과 가져오기List[Row][ (1, 'Alice'), (2, 'Bob') ]session.execute(stmt).fetchall()Core 스타일 전체 결과List[Tuple][ (1, 'Alice'), (2, 'Bob') ]session.execute(stmt).first()첫 결과 RowRow or None(1, 'Alice')session.scalars(stmt).all()하나의 컬럼 or 모델 객체 리스트List[Any][1, 2] 또는 [User(id=1, name='Alice'), User(id..