[#55] fix: PostgreSQL 파라미터 타입 추론 오류 수정 #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
관련 이슈
📌 작업 개요
/api/v1/transporter/dispatch-listAPI에서 status 파라미터 미입력 시 발생하는 PostgreSQL 타입 추론 오류 수정DispatchRepository.findDispatchesByDistance()Native Query 개선문제점
ERROR: could not determine data type of parameter $3오류 발생IN (:statuses)절에서 null 파라미터의 타입을 추론하지 못함해결 방법
IN절을ANY연산자로 변경CAST(:statuses AS text[])타입 캐스팅 추가(:statuses IS NULL OR d.status IN (:statuses))(CAST(:statuses AS text[]) IS NULL OR d.status = ANY(CAST(:statuses AS text[])))✨ 기타 참고 사항
✅ 체크리스트
application.yml파일을 수정했다면, Notion에 업로드, github security 수정 및 공유했어요.테스트 시나리오:
1. status 파라미터 없이 요청 (전체 조회)
GET /api/v1/transporter/dispatch-list
2. status 파라미터 1개
GET /api/v1/transporter/dispatch-list?status=OPEN
3. status 파라미터 복수 개
GET /api/v1/transporter/dispatch-list?status=OPEN&status=HOLD