pg@9.0 breaking changes ideas #3598
Replies: 14 comments 10 replies
-
remove queryQueueThe "query queue" idea shipped w/ the original version of node-postgres some 15 years ago. It gums up the internals of the client a bit, isn't how most database drivers behave, and is just weird. Espesh w/ async/await I don't think its used much at all on purpose. So, my plan is to deprecate it very soon in the pg@8.x branch - if someone adds a query to the client's internal query queue while the client is already executing a query in flight, I'll log a 1 time deprecation warning to the terminal. In 9.x the behavior will change to throw an error if a query is sent while another query is in flight. |
Beta Was this translation helpful? Give feedback.
-
update pg-typesBecause the version of pg-types I'm using is so many years behind the mainline branch I'm sure there are some breaking changes. I will not ever change the default "timezoneless date parsing" to be a different timezone, so either that needs to get reverted it pg-types 5.x or I'll have to patch over that part. Changing that would be a very subtle breaking change with no way to lint for it as it would be based on database types so I don't think its worth it...even though yeah if I had started out today I would try to align it w/ the way |
Beta Was this translation helpful? Give feedback.
-
pool.end() does not render the pool unusable afterward.2 things actually.
|
Beta Was this translation helpful? Give feedback.
-
Just a suggestion: consider adding a link to this discussion in the README and creating a pinned issue. This way, the discussion would get more visibility. |
Beta Was this translation helpful? Give feedback.
-
remove pgpassIts already deprecated. Make sure it's easy to use as an addon and keep tests for it...just make it a dev dependency for tests. |
Beta Was this translation helpful? Give feedback.
-
remove bring your own promiseIt's 2026 now...probably high time we just use the built in promise library. It's already been deprecated, so its just the removal left. |
Beta Was this translation helpful? Give feedback.
-
add default no-op
|
Beta Was this translation helpful? Give feedback.
-
require socket to be configured (and connected?) by socket creatorI’ll try to get around to expanding on this later, but in short:
(see compatibility issues with Cloudflare sockets, for one; this single change might be enough to allow generic stream to be passed as socket?) |
Beta Was this translation helpful? Give feedback.
-
bundle TS type definitionsremoves need in installing |
Beta Was this translation helpful? Give feedback.
-
move to a promise-only APIwould make library code much, much simpler. maybe also raise the required Node version and consequently the ECMA spec - possibly reducing code complexity and dependencies by using more native stuff. |
Beta Was this translation helpful? Give feedback.
-
Temporal supportTemporals are now shipped in Chrome v8 and will be enabled in nodejs soon. There are a ton of issues listed because of weird date, timezone etc behaviour. The default mode could still be to use Date but with the recommendation to use Temporal and mark using Date objects as legacy stuff. Still supported (for now) but its not the feature and maybe no more further development on that. |
Beta Was this translation helpful? Give feedback.
-
AsyncDisposableYou always have to really really take care of ending connections or returning them to the pool. Don't know how many bugs I and others had in the past because some part was not working correctly. Or didn't work correctly in case of thrown exceptions that stuff was not cleaned up. But this has been solved now for so long. await using connection = pool.connect();
await doMoreStuff();With pools and connections supporting the disposable interface, we can be asolutely sure that the connection is released after more stuff executed - whether it succeeds correctly or something fails. |
Beta Was this translation helpful? Give feedback.
-
Configurable Type ParsingCurrently you must set type parsing options. So if you want to e.g. convert 64bit integers to BigInt and not use strings, you must configure this globally on the |
Beta Was this translation helpful? Give feedback.
-
Automatic Prepared StatementsSo |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to gather feedback on breaking changes to make for pg@9.0. I'd like to start working on getting pg@9.0 out sometime in March so there's plenty of time for ideas!
Beta Was this translation helpful? Give feedback.
All reactions