typeorm repository
Nestjs - Typeorm Repository 사용하기
Nestjs - Typeorm Repository 사용하기
2021.05.31repository import restaurants 라는 App 안에서 resturants.module.ts 에서 entities 안에 정의된 모델을 import 해야 합니다. TypeOrmModule.forFeature() 안에 배열 형식으로 entities 안에 정의된 모델을 import 합니다. DB에 접근할 수 있는 service 만들기 restaurants/restaurants.service.ts 파일을 만든뒤 다음과 같이 작성합니다. 그런다음 restaurants.resolver.ts 로 이동하여 constructor(private readonly restaurantService: ResaurantService) {} 를 추가합니다. 마지막으로 restaurants.module.ts 에서 p..