Neon Postgres
Serverless Postgres with connection pooling and branching for TurboJet.
Neon is a serverless PostgreSQL platform with connection pooling, database branching, and autoscaling. Use it when you deploy beyond local Docker Compose.
Local default
Day-to-day development still uses Local (Docker). Neon is optional for hosted or serverless environments. See also Supabase and Railway.
1. Create a Neon account and project
Go to neon.tech, create an account, and create a project. Choose a region close to your deployment for lower latency.
2. Get your connection strings
Neon provides two connection strings under Connection Details:
- Pooled (hostname includes
-pooler): use at runtime for efficient connections. - Direct: use for migrations that need a persistent connection.
postgresql://user:[email protected]/neondb?sslmode=requirepostgresql://user:[email protected]/neondb?sslmode=require3. Configure environment variables
In the repository root .env:
DATABASE_URL="postgresql://user:[email protected]/neondb?sslmode=require"
DIRECT_URL="postgresql://user:[email protected]/neondb?sslmode=require"DATABASE_URL is what Prisma Client uses at runtime. DIRECT_URL is required by migrate/pull scripts.
4. How migrations use DIRECT_URL
This kit does not use prisma.config.ts or a directUrl field in schema.prisma. Instead, package scripts temporarily point Prisma at the direct URL:
"db:migrate": "dotenv -e ../../.env -- sh -c 'DATABASE_URL=\"$DIRECT_URL\" prisma migrate dev'"The same pattern applies to db:migrate:deploy, db:migrate:reset, and db:pull. Runtime queries keep using the pooled DATABASE_URL from .env.
5. Push or migrate the schema
pnpm --filter @repo/database db:migrate
# or, without a migration history:
pnpm --filter @repo/database db:push
pnpm --filter @repo/database db:generate6. Verify
pnpm devNeon branching creates isolated database copies for previews and CI. Pair a branch connection string with your preview environment when needed.
Frequently asked questions
Does Neon support connection pooling?
Yes, via PgBouncer. Use the pooled (-pooler) endpoint for DATABASE_URL and the direct endpoint for DIRECT_URL.
Can I use Neon with this kit’s Prisma setup?
Yes. Keep provider = "postgresql" and set both URLs as above. No Drizzle path is required.