Use Hyperdrive when the worker needs a real PostgreSQL path behind Cloudflare’s pooling layer
Hyperdrive gives Workers a pooled, Cloudflare-managed connection path to existing PostgreSQL databases.
Hyperdrive is modeled in Devflare config, compile flows, local Miniflare wiring, and pure tests through explicit local connection strings.
For local work, point the binding at a local or test PostgreSQL database. Cloudflare still owns the hosted pooling layer, placement, account credentials, and production routing.
- Config key
- Authoring shape
- Best for
- Workers that connect to PostgreSQL through Hyperdrive
Use the binding from application code
After Devflare generates the worker env, import from and keep the first Hyperdrive path close to the route, handler, or service method that needs it.
Keep this first path small enough that the config, env binding, and user-visible behavior are easy to review together.
Read one product through Hyperdrive
Local and Remote Support
Devflare has a real lane for Hyperdrive, but the local contract is intentionally narrower than Cloudflare's hosted product. The docs call out the supported local path and the remote boundary separately.
Full local support when Devflare has a local database connection string for the binding. Use the documented local lane only for the behavior Devflare explicitly models, and keep the narrower boundary visible in code review.
Use Cloudflare when the app depends on real preview isolation or actual postgres query behavior. This is the lane for full Hyperdrive product fidelity, remote state, lifecycle behavior, and platform-specific limits.
When this binding fits best
- Use Hyperdrive when the worker needs PostgreSQL and you want the Cloudflare-managed connection path rather than raw direct wiring.
- It fits best when a real Postgres database already exists and the worker boundary should speak to it deliberately.
- If your data is already a comfortable fit for D1, D1 may still be the simpler first choice.
Testing path
- Use to override the configured local connection string in CI or per-developer shells.
- Preview-scoped Hyperdrive configs are not auto-cloned from the base configuration because stored credentials are not always available for that.
- When a preview Hyperdrive config does not exist, Devflare may fall back to the base configuration and warn.
Local and hosted responsibilities are different
Devflare can wire the local database path. Cloudflare still owns hosted pooling, production credentials, placement, billing, and account state.
Open the next page when you need it
Subpage
Hyperdrive internals
InternalsCheck emitted Wrangler , preview behavior, and Cloudflare-specific details.
Subpage
Testing Hyperdrive
TestingPick the or with path first, then move to remote checks only when the test needs them.
Subpage
Hyperdrive example
ExampleCopy a fuller application path when the quick example is too small.