Skip to content
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

dep: upgrade pg-types to ^4 #3400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

aqeelat
Copy link

@aqeelat aqeelat commented Mar 9, 2025

When this pr is merged, we can update @types/pg to not depend on @types/pg-types

@brianc
Copy link
Owner

brianc commented Mar 10, 2025

pg-types @ 4.x is not backwards compatible, so it requires a major version bump (and a LOT of headache for library consumers)

@brianc
Copy link
Owner

brianc commented Mar 10, 2025

I think there needs to be another fork or something of pg-types that does not do the date/time zone conversion differently. Unfortunately changing that would be insanely breaking for a lot of deployed code-bases even though the original decision 15 years ago wasn't the best....I'm not convinced its worth the forced upgrade there.

@aqeelat
Copy link
Author

aqeelat commented Mar 11, 2025

@brianc can you elaborate on what that means?

Also, does it make sense to use pg-types without node-postgres? If not, then why not move the source code for that library into this repo and tie their development together?

@aqeelat
Copy link
Author

aqeelat commented Mar 11, 2025

Oh I just came across brianc/node-pg-types#50 and the PRs related to it.
Should I convert this into a discussion?

@aqeelat
Copy link
Author

aqeelat commented Mar 11, 2025

From what I can gather:

  1. the Date objects will now be parsed to the current timezone even if they do not have timezone in them (which is why the test is failing). To fix this test, we could retrieve the timezone of the db connection and then add the offset.
  2. postgres DATEs will be returned as string

But yeah, this should be a major version bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants