netlify-database

Provision and manage Netlify Database Postgres instances with Drizzle ORM migrations and CLI workflows.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-database-jamesmitofsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-database
Source: https://github.com/JamesMitofsky/tag-archive/tree/main/.claude/skills/netlify-database
Command: npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-database-jamesmitofsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/database, drizzle-orm, drizzle-kit, and includes references (resource) components.

What problem does it solve? Setting up and operating a managed Postgres database on Netlify involves provisioning, schema migrations, preview branching, and production data changes — each with failure modes that can corrupt migration history or touch the wrong database. This Skill encodes the supported workflows and guardrails so agents and developers avoid out-of-band changes, deprecated tooling, and unsafe direct connections. ## Core Features & Use Cases - Provisioning and CLI operations: Covers netlify database init, status, connect, migrations new/apply/pull/reset, and reset, with a preview-first deploy workflow and documented recovery for first-deploy provisioning failures. - Drizzle ORM integration: Guides schema definition in db/schema.ts, the drizzle-orm/netlify-db adapter (requiring the @beta dist-tag), and migration generation into netlify/database/migrations/ so deploys apply them automatically. - Safe production data handling: Enforces DML migrations for production data changes, expand-and-contract for breaking schema changes, and a phased provider-switch process from the legacy @netlify/neon extension or any external Postgres. - Use Case: A developer adds dynamic data to a Netlify site — the Skill walks them through installing @netlify/database, generating a timestamped migration, testing it locally with netlify database migrations apply, and shipping it via a preview deploy before promoting to production. ## Quick Start Ask the AI to set up Netlify Database with Drizzle for your project, defining a starter schema and generating the first migration for a preview deploy.

Frequently Asked Questions about netlify-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Netlify Database with Drizzle ORM?

Run `netlify database init` for an interactive setup, or install `@netlify/database` plus `drizzle-orm@beta` and `drizzle-kit@beta` manually. Define tables in `db/schema.ts`, point `drizzle.config.ts` output at `netlify/database/migrations`, and generate migrations with `drizzle-kit generate`.

How do I apply migrations to a Netlify Database?

Locally, run `netlify database migrations apply` against the dev database. For preview branches and production, Netlify applies migration files automatically during deploy — never run `drizzle-kit migrate` or `drizzle-kit push` against a hosted database.

What is the difference between Netlify Database and the Netlify DB extension?

Netlify Database is the GA managed Postgres product using `@netlify/database` and the `NETLIFY_DB_URL` env var. The older Netlify DB extension is a deprecated Beta using `@netlify/neon` and `NETLIFY_DATABASE_URL`; new creation through it is blocked.

Why does drizzle-orm/netlify-db fail to resolve after install?

The Netlify Database adapter only exists on the `beta` release line of Drizzle. Install `drizzle-orm@beta` and `drizzle-kit@beta` — the default `latest` versions do not include the `drizzle-orm/netlify-db` adapter.

Can I run psql or raw SQL against a Netlify-hosted database?

No. Use `netlify database connect --query` for read queries instead of psql or other raw clients. Never run DDL like CREATE, ALTER, or DROP through any direct connection — schema changes must go through migration files applied by the deploy.

How do I change existing production data in Netlify Database?

Express production data changes as DML migration files committed to `netlify/database/migrations/`; the deploy applies them. Verify in a deploy preview first, since previews run against a forked copy of production data.