[NestJS] Repository 생성하기


[NestJS] Repository 생성하기

Repository 레포지토리는 엔티티 개체와 함께 작동하며 엔티티 찾기, 삽입, 업데이트, 삭제등을 처리한다. 데이터베이스에 관련된 일은 서비스에서 하는게 아닌 repository에서 하면된다. 이걸 Repository Pattern이라고 부른다. INSERT, FIND, DELETE 등등 repository 생성 1. repository 생성하기 - board.repository.ts 2. 생성한 파일에 repository를 위한 class 생성하기 - 생성 시 Repository class를 extends 해준다. (Find, Insert, Delete 등 entity를 컨트롤 해줄 수 있다.) @EntityRepository() - class를 사용자 정의 저장소로 선언하는 데 사용된다. 사용자 지정 저장소는 일부 특정 엔터티를 관리하거나 일반 저장소 일 수 있다. 3..........



원문링크 : [NestJS] Repository 생성하기