connect to local postgres

Does anyone knows how to connect to a local pg with neon?
I tried:

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()

And I get:

 ERROR  [worker reload] [worker init] Database connection string format should be: postgresql://user:password@host.tld/dbname?option=value
Was this page helpful?