Deploying with Vercel: A Perfect Match
Vercel revolutionized frontend deployment. AgenticSQL revolutionizes the backend foundation. Together, they create a full-stack, production-grade workflow that moves at the speed of your ideas. This guide shows you how to connect your Vercel project to your AgenticSQL database in two simple steps.
Prerequisites
- •You have an existing project deployed on Vercel.
- •You have already generated and deployed your database using AgenticSQL.
Retrieve Your Database Connection URL
Navigate to your AgenticSQL Dashboard.
In the Database Deployments list, find the database you want to connect to.
Click the 'Copy' icon next to the Connection URL. The full URL is now on your clipboard.
Your connection URL will look like this:
postgresql://username:password@your-db.region.rds.amazonaws.com:5432/databaseSet the DATABASE_URL in Vercel
Navigate to your project in your Vercel Dashboard.
Go to the Settings tab.
In the side menu, click on Environment Variables.
Create a new variable:
DATABASE_URLPaste the full connection URL you copied from the AgenticSQL dashboardEnsure you add it to Production, Preview, and Development environments.
Click Save.
Pro Tip
For maximum security, we recommend using Vercel's "Secret" variable type. AgenticSQL's connection URLs are fully compatible with Vercel's security best practices.
That's It. You're Connected.
Your Vercel deployment is now connected to your production-grade AgenticSQL database. The next time you push a deployment, your application will automatically use the new DATABASE_URL.
No IP whitelisting. No complex network configuration. Just a simple, secure connection that works. This is the power of a modern, decoupled stack. You focus on your frontend. We'll handle the foundation.
Using the Connection in Your Code
Once your environment variable is set, access it in your Vercel deployment like any other environment variable.
Next.js Example
// In your Next.js API route or server component
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false }
});
export async function GET() {
const client = await pool.connect();
const result = await client.query('SELECT * FROM users');
client.release();
return Response.json(result.rows);
}Prisma Example
// In your .env file (for local development)
DATABASE_URL="postgresql://..."
// In your schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Drizzle ORM Example
// In your db connection file
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export const db = drizzle(pool);Why This Works So Well
Zero Configuration
No VPC peering. No IP whitelisting. No firewall rules. AgenticSQL databases are designed to work seamlessly with modern deployment platforms.
Production-Grade Security
Your database runs on AWS RDS with SSL encryption, IAM authentication, and VPC isolation. Vercel's edge network connects securely.
Global Performance
Vercel's edge functions connect to your AWS-hosted database with optimized routing. Low latency, high reliability.
Instant Updates
Change your database connection? Update the environment variable in Vercel. Your next deployment picks it up automatically.
The Modern Stack
Vercel handles your frontend. AgenticSQL handles your database. AWS handles the infrastructure. You handle the innovation.
This is how full-stack development should work. No friction. No complexity. Just pure velocity.