netlify-database

Provision and manage Netlify's managed Postgres database with Drizzle ORM migrations.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-database-syedarmanali2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-database
Source: https://github.com/SyedArmanAli2003/AgroNaV/tree/main/.agents/skills/netlify-database
Command: npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-database-syedarmanali2003

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 safely operating a Postgres database on Netlify involves provisioning, schema migrations, preview branching, and production data handling — doing any of these out-of-band (raw DDL, direct psql access, manual migrate commands) causes drift and broken deploys. This Skill provides the correct, supported workflow for every stage. ## Core Features & Use Cases - Provisioning & Setup: Install @netlify/database and bootstrap with netlify database init, with auto-provisioning at deploy time and isolated preview branches forked from production data. - Drizzle ORM Workflow: Configure db/schema.ts, drizzle.config.ts, and the drizzle-orm/netlify-db adapter (installed from the @beta dist-tag), with migrations generated into netlify/database/migrations/ and applied automatically by deploys. - Safe Production Operations: Enforces rules like never running DDL through direct connections, never applying migrations to hosted databases manually, and expressing production data changes as DML migrations. - Use Case: A developer building a Netlify-hosted app needs a database for user records. The Skill guides them through netlify database init, defining a Drizzle schema, generating a migration, testing locally with netlify dev, and shipping via a preview-first deploy. ## Quick Start Ask the AI to set up a Netlify Database with Drizzle ORM for your project, starting with netlify database init and a starter schema for your app's entities.

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 a Postgres database on Netlify?

Run `netlify database init` to install `@netlify/database`, optionally configure Drizzle, and scaffold a starter migration. The database auto-provisions on the next deploy, and each deploy preview gets its own branch forked from production data.

How do I use Drizzle ORM with Netlify Database?

Install `drizzle-orm@beta` and `drizzle-kit@beta` — the `drizzle-orm/netlify-db` adapter only exists on the beta line. Define tables in `db/schema.ts`, set `out: "netlify/database/migrations"` in `drizzle.config.ts`, and generate migrations with `drizzle-kit generate`.

Should I use Netlify Database or Netlify Blobs for storing data?

Use Netlify Database for any dynamic, structured, or relational data such as user records, orders, and sessions. Use Netlify Blobs only for file and asset storage like images, documents, and uploads — not as a dynamic data store.

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

The Netlify Database adapter is missing because `drizzle-orm` and `drizzle-kit` were installed from the default `latest` tag. Reinstall both packages with the `@beta` dist-tag, which contains the adapter while keeping standard import paths.

Can I run drizzle-kit migrate against a production Netlify database?

No. Netlify applies migrations to hosted databases automatically during deploys. Only use `netlify database migrations apply` for the local development database, and never run DDL through `psql` or `netlify database connect`.

How do I migrate from the legacy Netlify DB extension to Netlify Database?

Follow a three-phase switch: provision Netlify Database alongside the source with a baseline schema migration, swap code to `@netlify/database` and rehearse on a preview with imported data, then cut over production with a final pg_dump/pg_restore data import.