-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] 태그 검색 API & 전체 태그 조회 구현 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
report: Run #55
🎉 All tests passed! |
pilyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿 좋아용
-
100개정도 이상일때 인덱스 타는것
=> 매우 좋아용 -
db migration 생성 관련
=> migration을 자동으로 생성하고나서 이후에 수동으로 생성된 마이그래이션 파일을 수정하면 해당 파일의 해시가 변경되어서 바뀐 해시를 적용시켜줘야해용
실행해줘야할 명령어
atlas migrate hash --dir "file://ent/migrate/migrations"그런데,, 이렇게 해서 적용해보니까 그 gin index설정하는부분에서 먼가 문제가 생기고있는것같은데,, 이건 나도 한번 추가적으로 확인해봐야할것같네.. (아직 더 찾아보거나 시도를 못해봐서 일단 리뷰로 남겨두기만 합니다)
일단 아래는 실행시켜본것들이야
❯ ./script/create_migration.sh teset
You have a checksum error in your migration directory.
L3: 20250129135532_20250129_create_tag.sql.sql was edited
Please check your migration files and run 'atlas migrate hash' to re-hash the contents
Error: checksum mismatch
❯ atlas migrate hash --dir "file://ent/migrate/migrations"
❯ ./script/create_migration.sh teset
Error: create index "tag_name" to table: "tags": pq: access method "gin" does not support unique indexes- 그외 코드적인것들 리뷰 남겼습니다
report: Run #56
🎉 All tests passed! |
report: Run #57
🎉 All tests passed! |
pilyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
태그 검색 API, 전체 태그 조회 구현해놨습니다
Tag Entity 추가
Tag Entity가 추가됐어요 엔티티는 요기
생성 API
태그 검색
[GET]
/tags?search=param전체 조회
[GET]
/tags응답 형식은 두 API 모두 동일합니당
고민한 점
sqlx같은 다른 라이브러리를 사용하지 않고,
entgo로
ilike %param%;쿼리를 생성하도록 만들어놨습니다(ilike : 대소문자 구분 안함)로컬에서 row를 추가/삭제하면서 테스트해본 결과 대략 100개 넘어갈 때부터 trgm 인덱스를 타더라구요
저희 배포시 태그가 100개는 넘어갈 것 같아서 이대로 올립니다~
그 외 특이사항
=> migration script에 인덱스 생성하도록 따로 작성해뒀는데, 혹시 문제가 되려나요?!
그 외
https://www.postgresql.org/docs/current/pgtrgm.html
https://www.postgresql.org/docs/current/gin.html