r/SQL • u/Savings-Feedback6581 • 2d ago
PostgreSQL Self-hosted alternative to Neon's HTTP driver: query your own Postgres via fetch()
/r/postgres/comments/1y3qrfx/selfhosted_alternative_to_neons_http_driver_query/
0
Upvotes
1
u/Discordbothost 1d ago
The Idempotency-Key example covers a lost 202. I'd add one for an unknown commit too. Insert a unique operation ID in the same transaction as the write, then check Postgres for that ID. Reuse it if you retry, so both attempts can't commit.
1
u/MongooseWonderful198 1d ago
Cloudflare Workers can open outbound TCP connections through
cloudflare:sockets. Hyperdrive also supports existing PostgreSQL servers, including self-hosted ones; it isn't limited to Neon. Private databases have supported connection paths too.That changes the Cloudflare part of the comparison: the choice includes a Cloudflare-managed connection pool versus your self-hosted gateway with a portable
fetchinterface. The latter can still be useful across runtimes, but saying Workers can't open TCP hides an option readers may already have. Keeping that distinction explicit would make the deployment comparison more useful.