Replies: 1 comment
-
|
I think that it is not a good idea to add clients for third-party services or software to a language runtime's built-in API. In this regard, I don't think FYI, an issue seemed to be fixed recently that is related to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Deno still doesn't have a good native Postgres solution, despite Postgres being used in many projects and examples, and is on track to become the #1 DBMS.
The ideal outcome is there's a recommended/blessed postgres package for use with Deno Typescript projects in 2025 and beyond. (If there is one please let me know).
The current solutions have been plagued with subtle issues related to TLS, random disconnects, and Deno compatibility over the years continuing to now:
1.
jsr:@db/postgresaka denodrivers/postgresGenerally billed as the Deno-first postgres solution, but is relatively immature & unmaintained and suffers from many connection and functionality issues:
caCertificatesnot working denodrivers/postgres#506As these issues are critical and ongoing (connections can't be made securely or break randomly), and are without active development, this project hasn't really been suitable for production use or even hobby projects in my experience.
2.
npm:postgresaka Postgres.jsThis is a popular modern TypeScript postgres client, and states it supports Deno.
In practice, there's Deno-specific connection reliability issues with this library as well, see:
I personally find this API to be a bit opinionated with use of template literals, making it not easily adaptable to existing SQL code. Thus it may not be the best default option for Deno examples and projects.
Last, Postgres.js could be added to
jsrwhich has not been done yet.3.
npm:pgaka node-postgresThis is the most popular overall JS postgres client. From my experience, it's the best and most reliable solution, but it's far from ideal.
The main downsides are:
Overall, I believe it would be beneficial for the Deno core team (and/or community) to push for a reliable and consistent approach to using Postgres or SQL, prioritizing making database connections stable and secure.
Postgres is at the heart of the majority of web apps today, and is now natively integrated with Deno Deploy, yet the reality is there isn't a modern & reliable Postgres solution for use with Deno yet.
Beta Was this translation helpful? Give feedback.
All reactions