> ## Documentation Index
> Fetch the complete documentation index at: https://a5eb32f-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://a5eb32f-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://a5eb32f-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://a5eb32f-docs-2.manicule.dev/.well-known/llms-manifest.json

# Connect a Neon Postgres Database (/connectors/neon)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 670 · updated: 2026-11-25 -->
Related: [Choose and Connect Your Services](/connectors/overview.md), [Import and Sync a GitHub Repository](/connectors/github.md), [Connect and Work With GitLab](/connectors/gitlab.md), [Connect and Deploy to Vercel](/connectors/vercel.md), [Connect and Deploy to Netlify](/connectors/netlify.md), [Connect a Supabase Backend](/connectors/supabase.md)

> Connect Neon, configure a pooled Postgres connection, and test migrations on a separate database branch.

Use Neon when your Cloud Studio project needs serverless PostgreSQL and you want to test schema changes on an isolated database branch. Connecting a Neon account and connecting your app to a database are separate steps. Choose or create the database in Neon, then give the app the connection string for the branch you intend to use.

## Connect Neon to your project

<Steps>
<Step title="Connect your Neon account">Open **Connectors** in the [BhaiCode dashboard](https://app.bhaico.de). Select **Neon**, then **Connect**, and authorize the account that owns the database project.</Step>

<Step title="Choose the database and branch">In Neon, create or open the database project and select the branch you want. A database provider entry in Studio doesn't create a Neon database or supply its credentials. Make sure the selected branch belongs to the project you actually want to query.</Step>

<Step title="Set the application connection string">Copy the connection string for that branch into the app's server-side `DATABASE_URL` environment variable. Use a pooled connection for application traffic when your driver supports it; for example, an edge or serverless app can use `@neondatabase/serverless`.</Step>

<Step title="Verify the connection">Run a read-only query from the server against a table you expect on that branch. If the app can connect but the table is missing, check the branch in Neon before changing the application code.</Step>
</Steps>

## Test a migration off production

Create an isolated database branch for the feature you're building. If useful, give it the same name as the code branch so reviewers can identify the pair. Matching names don't set the connection string. Point the test environment at the Neon branch before running the migration.

Use a direct connection for schema migrations. Test the migration against representative data, then exercise the app against the changed schema before you apply the reviewed migration to production. Keep the test and production connection strings separate so a test can't alter production data by mistake.

If you switch branches during development, update the connection string before restarting the app. Repeat your read-only check to confirm the app is using the intended schema before running another migration.

<Warning>Both pooled and direct connection strings are credentials. Keep them on the server and out of source files, browser code, and logs.</Warning>

## Next

* [Query Neon from server-side code](/databases/neon-postgres)
* [Apply a database migration](/databases/migrations)
