-
-
Notifications
You must be signed in to change notification settings - Fork 0
SQLBoiler 도입 #137
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
SQLBoiler 도입 #137
Conversation
Summary of ChangesHello @KubrickCode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 Go 애플리케이션의 데이터베이스 접근 계층을 GORM에서 SQLBoiler로 전환하는 대규모 리팩토링을 수행합니다. 이는 데이터베이스 상호작용의 견고성과 효율성을 높이고, 자동 생성된 코드를 활용하여 개발 프로세스를 간소화하며, 장기적인 유지보수 부담을 줄이는 것을 목표로 합니다. 기존 비즈니스 로직은 새로운 DB 계층에 맞춰 업데이트되었습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
SQLBoiler 도입을 위한 대규모 리팩토링이 진행되었습니다. GORM에서 SQLBoiler로 ORM을 교체하면서 많은 파일이 변경되었습니다. 전반적으로 SQLBoiler의 기능을 잘 활용하고 있지만, 몇 가지 중요한 개선점이 보입니다. 특히 트랜잭션 처리 로직에 심각한 버그가 있으며, 여러 곳에서 N+1 쿼리 문제와 같은 성능 저하 요인이 발견되었습니다. 또한, nil 컨텍스트를 전달하여 패닉을 유발할 수 있는 코드도 있습니다. 이러한 부분들을 수정하여 안정성과 성능을 높이는 것이 좋겠습니다.
src/go/apps/market-item-stat-scraper/converter/converter_test.go
Outdated
Show resolved
Hide resolved
47a4d17 to
f91951a
Compare
|
/gemini review |
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.
Code Review
안녕하세요. SQLBoiler 도입을 통해 데이터베이스 스키마를 단일 진실 공급원(SSOT)으로 삼고, 타입-세이프한 코드를 생성하도록 데이터 접근 계층을 리팩터링한 점이 인상 깊습니다. 이는 코드의 유지보수성과 안정성을 크게 향상시킬 것입니다. 몇 가지 성능 및 버그 수정과 관련된 제안 사항을 남겼으니 확인 부탁드립니다.
f91951a to
17bbc81
Compare
17bbc81 to
104f1c5
Compare
|
/gemini review |
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.
Code Review
SQLBoiler를 도입하여 기존 GORM의 스키마 이중 관리 문제를 해결하려는 좋은 시도입니다. 전체적으로 데이터 접근 계층을 리팩토링하고, 레포지토리 패턴과 Decimal 래퍼를 도입한 점이 인상적입니다.
다만, 몇 가지 성능 관련 문제점들이 보입니다. 아이템 통계 업데이트 시 발생하는 N+1 쿼리 문제와, 루프 내에서 개별적으로 DB 작업을 수행하는 비효율적인 CreateMany/UpsertMany 구현이 있습니다.
자세한 내용은 각 파일에 대한 리뷰 코멘트를 참고해주세요.
- 기존에 prisma 로 마이그레이션 관리를 하지만, code first 방식의 gorm 을 사용했기 때문에 schema 를 다시 go 쪽에 작성해야하는 문제가 있었음. 데이터베이스에 변경사항이 있을 때 마다 schema.prisma 와 schema.go 를 항상 같이 신경써야했음. - 마이그레이션은 prisma 를 통해 중앙 관리할 예정이기 때문에 db first 방식인 SQLBoiler 방식으로 전면 교체함. - 이를 통해 go 쪽에서는 간단한 명령어만으로 코어 모델 및 메서드를 db로부터 뽑아와서 생성할 수 있게됨.
104f1c5 to
192d2eb
Compare
Uh oh!
There was an error while loading. Please reload this page.