
Netlify Database
This teaches Claude how to work with Netlify's GA managed Postgres product, which auto-provisions a database for every deploy and gives each preview branch its own isolated fork of production data. The skill is opinionated about workflow: it insists on installing Drizzle from the beta dist-tag (where the Netlify adapter lives), blocks any direct schema changes outside of migration files, and routes everything through netlify database commands instead of raw psql or API calls. The guidance is unusually specific about failure modes and includes a full playbook for switching from the deprecated Netlify DB extension or other external Postgres providers. Use this when a project needs structured, relational, or user-generated data, not just file storage.
- skills.sh installs
- 3.1K
- GitHub stars
- 51
- last updated
- Aug 21, 2026
Install
$ npx -y skills add netlify/context-and-tools --skill netlify-database --agent claude-codeInstalls into .claude/skills of the current project.
Files
Netlify Database
Zero-config managed Postgres. Install @netlify/database, write migrations under netlify/database/migrations/, deploy — Netlify provisions the DB and applies migrations automatically. Queryable from Functions, Edge Functions, Builds, and Agent Runners.
Modern client (reach for this)
import { getDatabase } from "@netlify/database";
const db = getDatabase(); // auto-selects connection for the runtime
const userId = 42;
const users = await db.sql`SELECT * FROM users WHERE id = ${userId}`; // auto-parameterized
Own driver / ORM instead:
import { getConnectionString } from "@netlify/database";
const connectionString = getConnectionString(); // correct branch for this env
Legacy — do NOT use for new code: import { neon } from "@netlify/neon". Superseded by @netlify/database. Replace neon() calls with the Drizzle netlify-db adapter or a Postgres driver via getConnectionString(). The legacy env var NETLIFY_DATABASE_URL is replaced by NETLIFY_DB_URL.
Where things go
Sponsors
Details
- Repository
- github.com/netlify/context-and-tools
- Categories
- Backend & APIs, Documentation, Cloud & Infrastructure, Databases
- First seen
- Jul 14, 2026