Connecting PostgreSQL
Post AI connects to any PostgreSQL-compatible database via Cloudflare Hyperdrive. Currently tested with Neon, Supabase, and standard Postgres.
1. Create a Hyperdrive config
Section titled “1. Create a Hyperdrive config”Using the Cloudflare CLI:
npx cf-workers hyperdrive create post-ai-postgres \ --connection-string="postgres://user:password@host:5432/dbname"Note the returned config ID (e.g. 22be071d).
2. Set the Hyperdrive binding
Section titled “2. Set the Hyperdrive binding”In your wrangler.toml (or contact support to configure via dashboard):
[[hyperdrive]]binding = "HYPERDRIVE"id = "22be071d"3. Verify connectivity
Section titled “3. Verify connectivity”curl https://postdb.dev/api/health \ -H "Authorization: Bearer YOUR_API_KEY"Response includes hyperdrive: "ok" when connected.
Supported databases
Section titled “Supported databases”- Neon — recommended, serverless Postgres
- Supabase — use the direct connection string (not pooler)
- Self-hosted Postgres — any Postgres 14+
- Amazon RDS — standard Postgres connection string