Cloudflare native Sveltekit: Hyperdrive, Postgres, Pages
Setting up Sveltekit with Cloudflare Pages and Hyperdrive. Serverless!
You want to deploy sveltekit with Postgres to cloudflare?
If your postgers is already pooled you can use it very easily with a env var.
import {DATABASE_URL} from "$env/static/private"
import postgres from "postgres";
import {drizzle} from "drizzle-orm/postgres-js";
//...
// postgres-js db
const client = postgres(DATABASE_URL);
// drizzle db
const db = drizzle(client);
However, if the postgres is not pooled, and is running on 5432, then we should use Hyperdrive to pool connections. Otherwise, frequent serverless requests will blow up your postgres. See supabase page on connection pooling at Connect to your database | Supabase Docs

Hyperdrive will be maintained by Cloudflare infra and made as an available binding for your worker or pages functions.
Enabled node_js compat, injest Hyperdrive into hooks.server.ts locals object, and you’re good to go.
The bindings is shown here:
Here hypg is a random name, HYPERDRIVE is the binding var.
https://mywords.io runs with this set up. Have fun.