loopdb: use pgx v5 for postgres#1152
Conversation
Summary of ChangesHello, 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! This pull request modernizes the database layer by migrating to the pgx/v5 driver for PostgreSQL. This change ensures better compatibility and performance, standardizes error handling across the application, and streamlines the dependency tree by removing outdated v4 references. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request migrates the database driver and migration framework from the legacy lib/pq and pgx/v4 to pgx/v5, along with updating Go and other dependencies. A critical issue was found in loopdb/postgres.go where the driver name is defined as "pgx/v5". Since the pgx/v5 stdlib driver registers itself as "pgx", using "pgx/v5" in sql.Open will cause a runtime panic.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| const ( | ||
| dsnTemplate = "postgres://%v:%v@%v:%d/%v?sslmode=%v" | ||
| pgxDriver = "pgx/v5" |
There was a problem hiding this comment.
The pgx/v5/stdlib driver registers itself under the name "pgx", not "pgx/v5". Using "pgx/v5" as the driver name in sql.Open will result in a runtime panic/error: sql: unknown driver "pgx/v5" (forgotten import?).\n\nPlease change the pgxDriver constant to "pgx" to ensure the driver can be correctly loaded.
| pgxDriver = "pgx/v5" | |
| pgxDriver = "pgx" |
• ## Summary
pgx/v5stdlib driverpgx/v5/pgconntypeslnd/kvdband tidy module files solooprpcno longer pulls inpgx/v4