PostgreSQL support in Cloudflare Service Workers

I discovered that postgreSQL regular clients are not supported by front-end javascript. I mean the real vanilla javascript (not the node.js one).
I am asking it because I’d have liked to use it in a Cloudflare Service Worker.

I found the solution of using an Argo Tunnel but it’s not optimal (since it’s a new subscription of min $5 per month while it’s supported for free in other Cloud Function solutions such as IBM, Google, etc.) Because I think that they support NodeJs instead of Vanilla Js.

So my question is : do you plan to support any SQL client (Postgresql, mysql, etc) in the future? A simple way to support it would be to support TCP natively. Then, simple modules could plug-in without too much effort (ref : ).

What do you think about it?

See this:

The Argon requirement is said be removed eventually, no one knows when.

Yes I saw it already.
But project seems not active for 5 months now and package is still in pre-release. So I wouldn’t rely on it for my Workers.
In addition, Argo tunnel requirements is blocking too currently.

Unfortunately, the only other method is to create an TCP wrapper proxy on a another server and use that to go around the issue, however, those options aren’t more mature than db-connect.

You can use Postgraphile for make GraphQL api from postgresql and graphql-request for data access from workers

1 Like

Thanks, that reminds me of Hasura which is production ready and has a Graphql API.

1 Like

Thank you for your links, they are pretty useful !
Too bad that CF workers doesn’t support it by default… But that’s the price to pay for that amazing CDN ! :smile:

I’m sure it will be supported and probably GraphQL too, it’s very young tech and completely unique. It will take some time to mature.

1 Like

Just dropping it here Accessing-Postgres-From-Cloudflare-Workers | til.

I am using PostgREST and Cloudflare tunnel to make my Worker reach Postgres DB.

1 Like