If you want PostgreSQL in Next.js without a heavier ORM layer, Drizzle is the clean middle path: typed schema, typed queries, and SQL that still feels close to the database. This quickstart keeps to the shortest useful path: one DBHost database, one Drizzle setup, and one server-side query. Best fit: Teams that want type-safe SQL, explicit schema files, and a lighter abstraction than Prisma. Not for: Teams that want full ORM modeling, or teams that want zero schema tooling and prefer plain SQL only. If you want to compare this path with Prisma or plainDocumentation Index
Fetch the complete documentation index at: https://docs.dbhost.app/llms.txt
Use this file to discover all available pages before exploring further.
pg, start with the Next.js + PostgreSQL guide.
What you need
- A DBHost account and one active database
- A Next.js app
- Node.js 18 or later
- Drizzle ORM,
pg, and Drizzle Kit installed in the app
DBHost exposes PostgreSQL through PgBouncer on port
6432. That pooled
connection string is the default path for normal Drizzle app queries.1. Create a database in DBHost
Create a database from the dashboard, then copy the connection string from the database detail page. If you are starting from zero, that is still the fastest first step. DBHost gives you the host, port, username, and password before you touch schema files or query code.2. Install Drizzle
From your Next.js project:3. Point Drizzle at DBHost
Add the DBHost connection string to.env.local or the environment file your app already uses:
4. Add the Drizzle config and schema
5. Push the schema
For a quickstart, pushing is enough:generate and migrate when you want reviewed SQL migrations in source control.
6. Create a reusable database client
Use one sharedpg pool and hand it to Drizzle:
7. Query from a server component
When DBHost helps most
- You want PostgreSQL working with Drizzle without managing PgBouncer yourself
- You want one pooled URL ready on day one
- You want backups and password resets from the dashboard later
- You want the option to automate database actions through the published CLI or REST API
Next steps
Start for Free
Create a DBHost account and provision your first database.
Compare Next.js Paths
See when Drizzle, Prisma, or plain
pg is the better fit for your app.- See the DBHost quickstart for the shortest path to your first database.
- See the Next.js + PostgreSQL guide if you want to compare Drizzle with Prisma or plain
pg. - See the CLI if you want to script database actions from your terminal.
- See the API reference if your deployment pipeline already speaks HTTP.