FastAPI에 모델 (Model) 적용
FastAPI에 모델 (Model) 적용 sqlacodegen을 이용하면 모델 생성 알아서 해줌 pip install sqlacodegen sqlacodegen mysql+pymysql://:@:/ > "./models.py" 결과 # coding: utf-8 from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class User(Base): __tablename__ = 'user' UID =..
2023.03.29