NeonN
Neon14mo ago
5 replies
endless-jade

Can't connect to local db with drizzle-kit

I followed this guide: https://neon.tech/guides/local-development-with-neon#local-postgresql to set up a local database but I get this error: 'connect ECONNREFUSED ::1:443' when I try to run migrations and such.

I have set the DATABASE_URL to the local connection string (postgres://postgres:postgres@db.localtest.me:5432/main?sslmode=require) and this is my drizzle.config.ts:
import { config } from 'dotenv';
import { defineConfig } from 'drizzle-kit';

config({ path: '.env.local' });

if (!process.env.DATABASE_URL) {
  throw new Error('DATABASE_URL not found');
}

export default defineConfig({
  schema: './src/db/schemas/*',
  out: './migrations',
  dialect: 'postgresql',
  dbCredentials: {
    url: process.env.DATABASE_URL,
  },
  strict: true,
  verbose: true,
});
Neon
Learn how to efficiently develop applications locally with Neon
Local Development with Neon - Neon Guides
Was this page helpful?