-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
I would like to use an offline local instance of postgress while developing on my computer, I'm trying something like this:
import { neon, neonConfig } from '@neondatabase/serverless'
import { drizzle } from 'drizzle-orm/neon-http'
import schema from "../database/schema.js"
neonConfig.fetchConnectionCache = true
let cached_db = null
const useDb = () => {
if (!cached_db){
const uri = process.dev ? 'postgresql://localhost:5432/dbname' : process.env.NEON_URI
const client = neon(uri)
cached_db = drizzle(client, {schema})
}
return cached_db
}
export const db = useDb()
But I keep getting an error that my uri is wrong
durdenx
Metadata
Metadata
Assignees
Labels
No labels