Skip to content
impulseDOCS
Get Started

Connecting

Grab DATABASE_URL from the Connect tab. TLS is required.

Terminal window
psql "$DATABASE_URL"
// Node — postgres.js
import postgres from 'postgres';
const sql = postgres(process.env.DATABASE_URL, { ssl: 'require' });
# Python — psycopg
import os, psycopg
conn = psycopg.connect(os.environ["DATABASE_URL"], sslmode="require")

Use the pooled connection string (Connect tab toggle) for serverless platforms and app servers with many short-lived connections; use the direct string for migrations and long-lived sessions.