Hi, I'm trying to configure a project with database branching using the vercel integration. I've got two persistent branches (main and dev) where preview envs are branched off of dev. For some reason, the default postgres_url setup via the integration causes an ssl error
SELF_SIGNED_CERT_IN_CHAIN
SELF_SIGNED_CERT_IN_CHAIN
my config for reference
import { Pool } from "pg";const postgresConfig = { connectionString: process.env.POSTGRES_URL,};const config = { ...(postgresConfig?.connectionString?.includes("localhost") ? {} : { ssl: { rejectUnauthorized: true, ca: Buffer.from(process.env.POSTGRES_SSL_CA!, "base64").toString("utf-8"), }, }), ...postgresConfig,};const pool = new Pool(config);export default pool;
import { Pool } from "pg";const postgresConfig = { connectionString: process.env.POSTGRES_URL,};const config = { ...(postgresConfig?.connectionString?.includes("localhost") ? {} : { ssl: { rejectUnauthorized: true, ca: Buffer.from(process.env.POSTGRES_SSL_CA!, "base64").toString("utf-8"), }, }), ...postgresConfig,};const pool = new Pool(config);export default pool;
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.