Skip to content

fix(postgres): update pg and @types/pg#18002

Open
WikiRik wants to merge 1 commit intomainfrom
WikiRik/postgres-deps-update
Open

fix(postgres): update pg and @types/pg#18002
WikiRik wants to merge 1 commit intomainfrom
WikiRik/postgres-deps-update

Conversation

@WikiRik
Copy link
Member

@WikiRik WikiRik commented Oct 10, 2025

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description of Changes

pg and @types/pg use pg-types@v2 so I had to use that as well. The TypeId and TypeParser types is not exported from @types/pg directly so we can't get rid of pg-types or import it from pg

Summary by CodeRabbit

  • New Features

    • Added support for the fallback_application_name connection option for PostgreSQL connections.
  • Chores

    • Updated PostgreSQL client and related type dependencies to newer compatible versions.
  • Refactor

    • Internal type handling adjusted to align with updated dependencies and removed legacy compiler workarounds; no public API or runtime behavior changes beyond the new connection option.

@WikiRik WikiRik requested a review from a team as a code owner October 10, 2025 12:00
@WikiRik WikiRik requested review from ephys and sdepold October 10, 2025 12:00
@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Updated Postgres package: dependency version bumps, added a new string connection option key fallback_application_name, and adjusted typings by replacing an imported TypeParser with a local type alias and removing related @ts-expect-error comments. No runtime control-flow or public API changes. (49 words)

Changes

Cohort / File(s) Summary
Dependency bumps
packages/postgres/package.json
Updated dependency versions: @types/pg (^8.11.14 → ^8.15.5), pg (^8.15.6 → ^8.16.3), pg-types (^4.1.0 → ^2.2.0).
Connection options extension
packages/postgres/src/_internal/connection-options.ts
Added string connection option key fallback_application_name to STRING_CONNECTION_OPTION_MAP, affecting derived STRING_CONNECTION_OPTION_NAMES.
Typing adjustments for pg-types v2
packages/postgres/src/connection-manager.ts
Removed TypeParser import from pg-types, defined a local TypeParser type alias, and removed two @ts-expect-error comments; no runtime changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to connection-manager.ts where the local TypeParser alias replaces the imported type and listeners were adjusted.
  • Verify STRING_CONNECTION_OPTION_NAMES consumers compile with the added fallback_application_name.
  • Check package.json dependency bumps for any typings/runtime surface changes (pg/pg-types).

Suggested reviewers

  • ephys
  • sdepold

Poem

I twitch my whiskers at versioned skies,
A fallback name tucked where config lies.
I sketch a type to mend the seam,
No logic shifted—only a gleam.
Hop-scotch merge, a tidy tweak, hooray! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(postgres): update pg and @types/pg' accurately describes the main changes in the pull request, which involve updating dependency versions for pg and @types/pg packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch WikiRik/postgres-deps-update

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89938a9 and 6921b95.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • packages/postgres/package.json (1 hunks)
  • packages/postgres/src/_internal/connection-options.ts (1 hunks)
  • packages/postgres/src/connection-manager.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/postgres/src/connection-manager.ts
  • packages/postgres/src/_internal/connection-options.ts
  • packages/postgres/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Upload install and build artifact (Node 20)
  • GitHub Check: Upload install and build artifact (Node 18)
  • GitHub Check: Analyze (javascript)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sequelize-bot sequelize-bot bot added the conflicted This PR has merge conflicts and will not be present in the list of PRs to review label Oct 12, 2025
"pg": "^8.16.3",
"pg-hstore": "^2.3.4",
"pg-types": "^4.1.0",
"pg-types": "^2.2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very odd somehow. Why is it major version downgrading?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pg and @types/pg use pg-types@v2 so I had to use that as well. Not sure why we updated to a newer major version, since it conflicts. There is an open issue for pg to update to the newest pg-types, but that hasn't been resolved yet

@WikiRik WikiRik force-pushed the WikiRik/postgres-deps-update branch from 89938a9 to 6921b95 Compare November 11, 2025 15:34
@sequelize-bot sequelize-bot bot removed the conflicted This PR has merge conflicts and will not be present in the list of PRs to review label Nov 11, 2025
@WikiRik WikiRik requested a review from sdepold November 11, 2025 15:34
@sequelize-bot sequelize-bot bot added the conflicted This PR has merge conflicts and will not be present in the list of PRs to review label Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicted This PR has merge conflicts and will not be present in the list of PRs to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants