Skip to content
stacks

PostgreSQL with Drizzle for Next.js and SvelteKit

PostgreSQL for the Next.js and SvelteKit stacks through Drizzle ORM and node-postgres (pg): Docker Compose dev and test databases, checked-in SQL migrations with a drift check, a server-only database module and repository, a readiness route, and tests on databases cloned from a migrated template.

Category: service

In your existing repository

Ask your agent to check compatibility, follow this fragment’s brief, and verify the resulting project. What happens next

Applies to:
nextjs, sveltekit
Requires tools:
docker
Conflicts with:
effect-sql-postgres

Add to your project

Paste the prompt into the coding agent working on your project.

View prompt
Add the drizzle-postgres fragment to this existing repository. 1. Run npx @steamfield/stacks show drizzle-postgres --json and check that it fits the project. If it does not, explain why before changing files. 2. Run npx @steamfield/stacks add drizzle-postgres and follow the brief it prints. 3. In this repository, run npx @steamfield/stacks verify. Fix failures without weakening or skipping verification steps. 4. Summarize what changed and the verification result. Quote published stats only when they are available, including their interval and sample size. The stacks docs, written for agents, are at https://stacks.steamfield.io/llms.txt.
Or use the terminal
npx @steamfield/stacks add drizzle-postgres
Verify steps
StepPhaseLayerCommand
db-upsetupinstallbun run db:up
db-migratesetupinstallbun run db:migrate
test-dbchecktestbun run test:db
db-checkcheckcheckbun run db:check
db-downteardowninstallbun run db:down
Use with a new stack

Starting fresh instead? These stacks support this fragment.

  • nextjsoptional
    npx @steamfield/stacks new nextjs --with drizzle-postgres
  • sveltekitoptional
    npx @steamfield/stacks new sveltekit --with drizzle-postgres

Files

  • docs/guidance/drizzle-postgres/database.md
  • docs/guidance/drizzle-postgres/index.md
  • docs/guidance/drizzle-postgres/testing.md

Usage

Among stacks projects in the 28 days through 30 Oct 2026: Project count: not enough runs yet; Green rate: not enough runs yet.

Weekly projects by stack

Projects whose final fragment set included this fragment, grouped by stack.

Weekly projects including this fragment, by stack: time span

Not enough published observations yet.

Not enough published observations yet.

Stacks projects per UTC week through 30 Oct 2026. Published stack counts only.

Data table
Week endingStackProjects
5 Jul 2026nextjs–
12 Jul 2026nextjs–
19 Jul 2026nextjs–
26 Jul 2026nextjs–
2 Aug 2026nextjs–
9 Aug 2026nextjs–
16 Aug 2026nextjs–
23 Aug 2026nextjs–
30 Aug 2026nextjs–
6 Sept 2026nextjs–
13 Sept 2026nextjs–
20 Sept 2026nextjs–
27 Sept 2026nextjs–
4 Oct 2026nextjs–
11 Oct 2026nextjs–
18 Oct 2026nextjs–
25 Oct 2026nextjs–
5 Jul 2026sveltekit–
12 Jul 2026sveltekit–
19 Jul 2026sveltekit–
26 Jul 2026sveltekit–
2 Aug 2026sveltekit–
9 Aug 2026sveltekit–
16 Aug 2026sveltekit–
23 Aug 2026sveltekit–
30 Aug 2026sveltekit–
6 Sept 2026sveltekit–
13 Sept 2026sveltekit–
20 Sept 2026sveltekit–
27 Sept 2026sveltekit–
4 Oct 2026sveltekit–
11 Oct 2026sveltekit–
18 Oct 2026sveltekit–
25 Oct 2026sveltekit–

By stack

How often this fragment stays in a default composition, or gets attached as an option.

nextjs
Optional · attached0%

– projects including the fragment

sveltekit
Optional · attached0%

– projects including the fragment

Stacks projects · 28 days through 30 Oct 2026. Counts rounded to 5.

Data table
StackProjectsRoleShare
nextjs–Optional · attached0%
sveltekit–Optional · attached0%

Green rate with and without it

This compares projects; it isn't an effect of the fragment.

Not enough runs in this breakdown yet.

Stacks projects · 28 days through 30 Oct 2026. Counts rounded to 5.

Often used with

Co-occurrence above the baseline, within a stack. Required fragment pairs are excluded.

Not enough runs in this breakdown yet.

Stacks projects · 28 days through 30 Oct 2026. Counts rounded to 5.

Computed 31 Oct 2026, through 30 Oct 2026. Numbers describe stacks projects, not the ecosystem.