0. install for mac 보호되어 있는 글 입니다. 2025. 4. 18. SQLAlchemy 관계 종류 1:1 (일대일)예: 유저(User)는 하나의 프로필(Profile)만 가짐# user.pyclass User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True) username = Column(String) profile = relationship("Profile", back_populates="user", uselist=False)# profile.pyclass Profile(Base): __tablename__ = "profiles" id = Column(Integer, primary_key=True) bio = Column(String) user_id = Column(Integer,.. 2025. 4. 17. SQLAlchemy DB 처리 방식 1. SQLAlchemy + Pydantic 방식Pydantic과 함께 쓰면 API/DB 역할 분리가 명확함DB 데이터를 "객체"로 다룰 수 있음 (User, Post 등)relationship, ForeignKey로 테이블 간 관계 표현 가능# 1. Pydantic 모델 (입출력용)class UserCreate(BaseModel): username: str email: str# 2. SQLAlchemy ORM 모델 (DB 테이블 대응)class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True) username = Column(String) email = Column(String)# 3. .. 2025. 4. 17. MongoDB 7.0 설치 TL;DR - Install Mac, Ubuntu1. Mac OSbrew tab mongodb/brewbrew install mongodb-community@7.0brew services start mongodb-community@7.0brew services listName Status User Filemongodb-community@7.0 started nhn ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community@7.0.plist mongoshCurrent Mongosh Log ID: 67ff12bbd129c363bc1041e5Connecting to: mongodb://127.0.0.1:27017/?directConne.. 2025. 4. 16. etcd 상태 확인 etcdctl 설치ETCD_VER=v3.5.9 # 최신 버전 확인 후 필요 시 변경# 다운로드 및 압축 해제wget https://github.com/etcd-io/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gztar xvf etcd-${ETCD_VER}-linux-amd64.tar.gz# 실행 파일을 /usr/local/bin으로 이동sudo mv etcd-${ETCD_VER}-linux-amd64/etcdctl /usr/local/bin/# 설치 확인etcdctl version v3.5.20 amd64 패키지 https://github.com/etcd-io/etcd/releases/download/v3.5.20/etcd.. 2025. 3. 26. [etcd] 백업 etcd 백업wget https://github.com/etcd-io/etcd/releases/download/v3.5.19/etcd-v3.5.19-linux-arm64.tar.gz sudo etcdctl snapshot save etcd-snapshot.db --endpoints=https://127.0.0.1:2379 --cacert=./ca.crt --cert=./healthcheck-client.crt --key=./healthcheck-client.key{"level":"info","ts":"2025-03-17T15:16:59.834146+0900","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"et.. 2025. 3. 17. 이전 1 ··· 5 6 7 8 9 10 11 ··· 17 다음