import { neon, neonConfig } from '@neondatabase/serverless'
import { drizzle } from 'drizzle-orm/neon-http'
neonConfig.fetchConnectionCache = true
let cached_db = null
const useDb = () => {
if (!cached_db){
const uri = "postgresql://localhost:5432/db"
const client = neon(uri)
cached_db = drizzle(client, {schema})
}
return cached_db
}
export const db = useDb()
import { neon, neonConfig } from '@neondatabase/serverless'
import { drizzle } from 'drizzle-orm/neon-http'
neonConfig.fetchConnectionCache = true
let cached_db = null
const useDb = () => {
if (!cached_db){
const uri = "postgresql://localhost:5432/db"
const client = neon(uri)
cached_db = drizzle(client, {schema})
}
return cached_db
}
export const db = useDb()