PostgreSQL November 9, 2026

How to Connect Node.js, Prisma, and Python to a Remote PostgreSQL Database

FreeDB supports both MySQL 8.0 (port 3306) and PostgreSQL (port 5432). You can spin up a free PostgreSQL database from your dashboard for quick testing, or keep up to 5 PostgreSQL databases on the Pro Persistent Plan ($5/mo) with daily pg_dump backups.

1. Copy Your PostgreSQL Connection URI

In your FreeDB Dashboard, select PostgreSQL (Port 5432) and click Create database. Copy the connection URI from your database card:

DATABASE_URL="postgresql://u_youruser:yourpassword@sql.freedb.tech:5432/freedb_yourdb"

2. Connect from Node.js (pg / Prisma / Drizzle)

import pg from 'pg';
const { Pool } = pg;

const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
});

const { rows } = await pool.query('SELECT current_database(), NOW() AS server_time');
console.log(rows);

3. Connect from Python (psycopg2)

import psycopg2

conn = psycopg2.connect("postgresql://u_youruser:yourpassword@sql.freedb.tech:5432/freedb_yourdb")
cur = conn.cursor()
cur.execute("SELECT current_database(), version();")
print(cur.fetchone())

4. Run Queries or Import a .sql File

You can run queries or upload a .sql / .sql.gz dump directly from the SQL Console in your FreeDB dashboard, or connect with a client like DBeaver, TablePlus, or psql.