Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

db.ts

13 lines282 Bytes

1import { neon } from '@neondatabase/serverless'
2​
3let client: ReturnType<typeof neon>
4​
5export async function getClient() {
6 if (!process.env.VITE_DATABASE_URL) {
7 return undefined
8 }
9 if (!client) {
10 client = await neon(process.env.VITE_DATABASE_URL!)
11 }
12 return client