Back to Drizzle Orm

ConnectVercel

src/mdx/get-started/postgresql/ConnectVercel.mdx

latest382 B
Original Source

Create a index.ts file in the src directory and initialize the connection:

typescript
import { drizzle } from 'drizzle-orm/vercel-postgres';

const db = drizzle();

If you need to provide your existing driver:

typescript
import { sql } from '@vercel/postgres';
import { drizzle } from 'drizzle-orm/vercel-postgres';

const db = drizzle({ client: sql })