netlify db connect reads NETLIFY_DB_URL
Introduced 2026-04-09 · score 0.92
HOW TO USE IT
When `NETLIFY_DB_URL` is present, run `netlify db connect` to connect using that connection string. The v24.11.0 source checks this variable before its stored local connection string.
WHY THIS HELPS
Connect an agent runner to the database for its corresponding deploy preview.
REQUIREMENTS AND LIMITATIONS
- Version: 24.11.0
- NETLIFY_DB_URL: When set, supplies the connection string used by the connect command.
- The environment variable must be present.
- Docs conflict: Current Netlify CLI docs use `netlify database connect` and specify Node.js 20.12.2+ and Netlify CLI 26.0.0+; these docs describe a later version than v24.11.0: https://docs.netlify.com/build/data-and-storage/netlify-database/cli/
FIRST-PARTY EVIDENCE
- https://github.com/netlify/cli/releases/tag/v24.11.0
- https://github.com/netlify/cli/pull/8142
- https://github.com/netlify/cli/blob/v24.11.0/src/commands/database/db-connection.ts
Check the installed version and the source before using it. Entry JSON