Skip to content
Dashboard

Update: As of June 9, 2025 Vercel Postgres was replaced with Vercel Marketplace Storage integrations, featuring automatic account provisioning and unified billing. Learn more.

app/page.tsx
import { sql } from '@vercel/postgres';
import { redirect } from 'next/navigation';
async function create(formData: FormData) {
'use server';
const { rows } = await sql`
INSERT INTO products (name)
VALUES (${formData.get('name')})
`;
redirect(`/product/${rows[0].slug}`);
}
export default function Page() {
return (
<form action={create}>
<input type="text" name="name" />
<button type="submit">Submit</button>
</form>
);
}

Use Vercel Postgres with Next.js Server Actions (to be announced Thursday)