일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 세이노의가르침
- Validation
- 북스터디
- serverless
- AWS
- BOOK
- Study
- UNiQUE
- 자청
- googleapis
- 일상속귀한배움
- futureself
- OOP
- Nestjs
- 역행자
- 부자아빠가난한아빠2
- 퓨처셀프
- nodemailer
- 독후감
- 오브젝트
- 클린코드
- 개발자
- validator
- 조영호
- PRISMA
- typescript
- nodejs
- 객체지향의사실과오해
- 스터디
- Object
- Today
- Total
목록PRISMA (2)
우당탕탕 우리네 개발생활

postgresql과 Prisma의 조합으로 compound key unique index 사용을 고민할 때 마주할 수 있는 문제와 이를 partial index를 통해 해결하는 방법을 공유하고자 합니다.배경특정 도메인에 대한 ERD를 구현하는 과정에서 특정 테이블에 대해 2개의 컬럼과 한 개의 nullable 컬럼의 조합으로 unique index를 만들기로 했습니다. 이 과정에서 deletedAt 컬럼(삭제된 Datetime을 기록하는 컬럼)을 nullable로 갖는 soft-delete 방법 역시 사용하기로 했습니다. 2개의 컬럼값과 deletedAt 컬럼이 null값을 갖는 행을 유효한 행으로 보고, deletedAt이 null값이 아닌 행들은 삭제된 데이터로 취급합니다.왜 soft-delete를..
최근 prisma 라이브러리에 대한 typing이 얼마나 섬세하게 작성되어 있는지 새삼 느낄 수 있었다. const updateUser = await prisma.user.update({ where: { email: 'viola@prisma.io', }, /** Type '{ email: string; }' is not assignable to type 'UserWhereUniqueInput'. Object literal may only specify known properties, and 'email' does not exist in type 'UserWhereUniqueInput'.ts(2322) index.d.ts: The expected type comes..