Postgrest driver #1677

Closed
opened 2026-03-13 08:55:23 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @kof on GitHub (Aug 11, 2025).

Is this suited for github?

  • Yes, this is suited for github

A lot of issues exist associated with cloudflare workers (when not using hyperdrive which is new), here is an AI generated reponse, it's more complete than I could write myself:

No true connection pooling: Each request runs in its own isolate; you can’t hold or reuse DB connections, causing per-request connection churn and DB exhaustion.

Handshake/latency overhead: Without pooling, every request pays a fresh TLS + auth handshake, adding latency and load on Postgres.

Transaction lifetimes are fragile: You can’t reliably keep a connection open across multiple awaits/requests; long transactions or cursors are brittle.

Resource limits: CPU time, memory, and response size limits in Workers make large result sets and heavy queries prone to timeouts or OOM.

Egress IP uncertainty: Workers don’t give you a fixed egress IP by default; IP allow-listing your database firewall is unreliable.

Regional latency mismatch: Edge execution near the user + DB in a single region = high, variable RTT for global traffic.

Driver binaries/native deps: Drivers that rely on native modules (libpq, OpenSSL) can’t run in the sandbox; WASM ports are rare and incomplete.

Retries can double-write: Lack of idempotency across network flakiness can cause duplicate inserts/side effects when the driver can’t guarantee atomic retries.

Harder per-user RBAC at the edge: Mapping end-user identity to DB roles per request is complex when you’re proxying raw connections from a short-lived isolate.

Operational visibility: You lose standard HTTP observability (ETags, cache headers, gateway rate-limits) when speaking the DB protocol directly.

Describe the solution you'd like

Postgrest is just a fetch, so its extremely easy to use from any environment.

Describe alternatives you've considered

I don't know any

Additional context

No response

Originally created by @kof on GitHub (Aug 11, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. A lot of issues exist associated with cloudflare workers (when not using hyperdrive which is new), here is an AI generated reponse, it's more complete than I could write myself: No true connection pooling: Each request runs in its own isolate; you can’t hold or reuse DB connections, causing per-request connection churn and DB exhaustion. Handshake/latency overhead: Without pooling, every request pays a fresh TLS + auth handshake, adding latency and load on Postgres. Transaction lifetimes are fragile: You can’t reliably keep a connection open across multiple awaits/requests; long transactions or cursors are brittle. Resource limits: CPU time, memory, and response size limits in Workers make large result sets and heavy queries prone to timeouts or OOM. Egress IP uncertainty: Workers don’t give you a fixed egress IP by default; IP allow-listing your database firewall is unreliable. Regional latency mismatch: Edge execution near the user + DB in a single region = high, variable RTT for global traffic. Driver binaries/native deps: Drivers that rely on native modules (libpq, OpenSSL) can’t run in the sandbox; WASM ports are rare and incomplete. Retries can double-write: Lack of idempotency across network flakiness can cause duplicate inserts/side effects when the driver can’t guarantee atomic retries. Harder per-user RBAC at the edge: Mapping end-user identity to DB roles per request is complex when you’re proxying raw connections from a short-lived isolate. Operational visibility: You lose standard HTTP observability (ETags, cache headers, gateway rate-limits) when speaking the DB protocol directly. ### Describe the solution you'd like Postgrest is just a fetch, so its extremely easy to use from any environment. ### Describe alternatives you've considered I don't know any ### Additional context _No response_
GiteaMirror added the integration label 2026-03-13 08:55:23 -05:00
Author
Owner

@frectonz commented on GitHub (Aug 11, 2025):

This doesn't really fit well in the core better-auth library. If you would like to work on this, you can do that by creating an adapter for it.

https://www.better-auth.com/docs/guides/create-a-db-adapter

@frectonz commented on GitHub (Aug 11, 2025): This doesn't really fit well in the core `better-auth` library. If you would like to work on this, you can do that by creating an adapter for it. https://www.better-auth.com/docs/guides/create-a-db-adapter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1677